Skip to content

[arm][ez] Add xfail for norm tests #10043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2025
Merged

[arm][ez] Add xfail for norm tests #10043

merged 1 commit into from
Apr 10, 2025

Conversation

SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Apr 10, 2025

Summary:

Context

#9938 made it so that linalg_vector_norm is now decomposed when exporting to Edge. However, this broke some tests in the arm delegate because export passes cannot handle the decomposed operator sequence. To account for this, add xfail for the failing tests since linalg_vector_norm is not supported in TOSA yet.

Changes

Add xfail for norm tests in test_torch_functions.py

Test Plan:

Test Plan

Check CI that failing test is recovered.

@SS-JIA SS-JIA requested a review from digantdesai as a code owner April 10, 2025 02:42
Copy link

pytorch-bot bot commented Apr 10, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/10043

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 89f3ff0 with merge base c9c5481 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 10, 2025
@SS-JIA SS-JIA added the release notes: arm Changes to the ARM backend delegate label Apr 10, 2025
Copy link
Contributor

@digantdesai digantdesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@SS-JIA
Copy link
Contributor Author

SS-JIA commented Apr 10, 2025

After investigating the root cause of the new test failures, my understanding of the situation is:

  • linalg_vector_norm is not supported by TOSA and isn't lowered to the arm delegate. See the test output below, I collected it by running pytest backends/arm/test/models/test_torch_functions.py -s after reverting [ez][release blocker fix] Insert linalg_vector_norm into decomp table used for Edge export #9938
  • After linalg_vector_norm is decomposed, it seems that the arm delegate export passes cannot handle the decomposed op sequence. The export pass that's having issues is the KeepDimsFalseToSqueezePass. Currently it seems that only pow is lowered after the op is decomposed.
  • However, if linalg_vector_norm is added to the list of ops to not be decomposed, this will trigger a failure in _sanity_check_graph_for_non_decomp_ops() because the op is not decomposed and it is not lowered to arm delegate

It seems to me that it isn't correct to add linalg_vector_norm to the list of ops to not be decomposed, since arm delegate doesn't actually support it. The more correct thing to do, imo is add an xfail to the failing tests. In the future, linalg_vector_norm can be supported by supporting the op outright (at which point it can be added to the not decomposed list) or by supporting the decomposed op sequence.

Updating the PR to add xfail instead of not decomposing linalg_vector_norm. cc: @digantdesai

================================================================================================================================ test session starts ================================================================================================================================
platform linux -- Python 3.10.0, pytest-8.0.1, pluggy-1.4.0
rootdir: /home/ssjia/Github/executorch/backends/arm/test
configfile: pytest.ini
plugins: anyio-4.6.0, hypothesis-6.98.10, xdist-3.5.0, rerunfailures-15.0
collected 2 items                                                                                                                                                                                                                                                                   

backends/arm/test/models/test_torch_functions.py  ARM_TEST_SEED=273800142  INFO:executorch.backends.arm.test.tester.test_pipeline:Running pipeline with stages:
 ['export', 'check_not.quant_nodes', 'to_edge_transform_and_lower', 'check_not.exir', 'to_executorch', 'run_method_and_compare_outputs'].
INFO:executorch.backends.arm.tosa_partitioner:TOSAPartitioner::partition
INFO:executorch.backends.arm.tosa_partitioner:Partitioning for TOSABackend: TOSA-0.80+MI
INFO:executorch.backends.arm.tosa_partitioner:The following nodes were rejected for TOSA-0.80+MI:
INFO:executorch.backends.arm.tosa_partitioner:
╒═════════════════════════════════╤═════════════════════════════════╤═════════════════════════════╤═════════════════════════════════════╕
│ Node name                       │ Target                          │ Torch func                  │ Reason                              │
╞═════════════════════════════════╪═════════════════════════════════╪═════════════════════════════╪═════════════════════════════════════╡
│ aten_linalg_vector_norm_default │ aten.linalg_vector_norm.default │ ('norm_1', 'function.norm') │ Not included in BaseTOSASupportList │
│                                 │                                 │                             │ or a registered tosa_support_check  │
╘═════════════════════════════════╧═════════════════════════════════╧═════════════════════════════╧═════════════════════════════════════╛
INFO:executorch.backends.arm.tosa_partitioner:(Placeholders and outputs are not included in this list)
INFO:executorch.backends.arm.test.tester.arm_tester:Comparing Stage 'ToExecutorch' with Stage 'InitialModel'
INFO:executorch.backends.arm.test.tester.arm_tester:Run #0, input shapes: [5, 5]
ERROR:executorch.backends.arm.test.tester.test_pipeline:
Failure in stage <run_method_and_compare_outputs>: 
   Ran model with TosaReferenceModelDispatch but never ran TOSABackend delegate.
. ARM_TEST_SEED=4240174922  INFO:executorch.backends.arm.test.tester.test_pipeline:Running pipeline with stages:
 ['quantize', 'export', 'to_edge_transform_and_lower', 'check_not.exir', 'to_executorch', 'run_method_and_compare_outputs'].
INFO:executorch.backends.arm.tosa_partitioner:TOSAPartitioner::partition
INFO:executorch.backends.arm.tosa_partitioner:Partitioning for TOSABackend: TOSA-0.80+BI
INFO:executorch.backends.arm.tosa_partitioner:The following nodes were rejected for TOSA-0.80+BI:
INFO:executorch.backends.arm.tosa_partitioner:
╒═════════════════════════════════╤═════════════════════════════════╤═════════════════════════════╤═════════════════════════════════════╕
│ Node name                       │ Target                          │ Torch func                  │ Reason                              │
╞═════════════════════════════════╪═════════════════════════════════╪═════════════════════════════╪═════════════════════════════════════╡
│ aten_linalg_vector_norm_default │ aten.linalg_vector_norm.default │ ('norm_1', 'function.norm') │ Not included in BaseTOSASupportList │
│                                 │                                 │                             │ or a registered tosa_support_check  │
╘═════════════════════════════════╧═════════════════════════════════╧═════════════════════════════╧═════════════════════════════════════╛
INFO:executorch.backends.arm.tosa_partitioner:(Placeholders and outputs are not included in this list)
INFO:executorch.backends.arm.test.tester.arm_tester:Comparing Stage 'ToExecutorch' with Stage 'Quantize'
INFO:executorch.backends.arm.test.tester.arm_tester:Run #0, input shapes: [5, 5]
ERROR:executorch.backends.arm.test.tester.test_pipeline:
Failure in stage <run_method_and_compare_outputs>: 
   Ran model with TosaReferenceModelDispatch but never ran TOSABackend delegate.
.

Summary:
## Context

#9938 made it so that `linalg_vector_norm` is now decomposed when exporting to Edge. However, this broke some tests in the arm delegate because export passes cannot handle the decomposed operator sequence. To account for this, add `xfail` for the failing tests since `linalg_vector_norm` is not supported in TOSA yet.


## Changes

Add `xfail` for `norm` tests in `test_torch_functions.py`

Test Plan:
## Test Plan

Check CI that failing test is recovered.
@SS-JIA SS-JIA changed the title [arm][ez] Do not decompose linalg_vector_norm [arm][ez] Add xfail for norm tests Apr 10, 2025
@zingo zingo added the module: arm Issues related to arm backend label Apr 10, 2025
@zingo
Copy link
Collaborator

zingo commented Apr 10, 2025

Thanks for the fix, good work!

@SS-JIA SS-JIA merged commit f2a08da into main Apr 10, 2025
170 of 245 checks passed
@SS-JIA SS-JIA deleted the pr10043 branch April 10, 2025 13:42
@SS-JIA
Copy link
Contributor Author

SS-JIA commented Apr 10, 2025

@pytorchbot cherry-pick --onto release/0.6 -c critical

pytorchbot pushed a commit that referenced this pull request Apr 10, 2025
Summary:
## Context

#9938 made it so that
`linalg_vector_norm` is now decomposed when exporting to Edge. However,
this broke some tests in the arm delegate because export passes cannot
handle the decomposed operator sequence. To account for this, add
`xfail` for the failing tests since `linalg_vector_norm` is not
supported in TOSA yet.

## Changes

Add `xfail` for `norm` tests in `test_torch_functions.py`

Test Plan:
## Test Plan

Check CI that failing test is recovered.

(cherry picked from commit f2a08da)
@pytorchbot
Copy link
Collaborator

Cherry picking #10043

The cherry pick PR is at #10078 and it is recommended to link a critical cherry pick PR with an issue. The following tracker issues are updated:

Details for Dev Infra team Raised by workflow job

kirklandsign pushed a commit that referenced this pull request Apr 11, 2025
Summary:
## Context

#9938 made it so that
`linalg_vector_norm` is now decomposed when exporting to Edge. However,
this broke some tests in the arm delegate because export passes cannot
handle the decomposed operator sequence. To account for this, add
`xfail` for the failing tests since `linalg_vector_norm` is not
supported in TOSA yet.


## Changes

Add `xfail` for `norm` tests in `test_torch_functions.py`

Test Plan:
## Test Plan

Check CI that failing test is recovered.
keyprocedure pushed a commit to keyprocedure/executorch that referenced this pull request Apr 21, 2025
Summary:
## Context

pytorch#9938 made it so that
`linalg_vector_norm` is now decomposed when exporting to Edge. However,
this broke some tests in the arm delegate because export passes cannot
handle the decomposed operator sequence. To account for this, add
`xfail` for the failing tests since `linalg_vector_norm` is not
supported in TOSA yet.


## Changes

Add `xfail` for `norm` tests in `test_torch_functions.py`

Test Plan:
## Test Plan

Check CI that failing test is recovered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: arm Issues related to arm backend release notes: arm Changes to the ARM backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants