Skip to content

Arm backend: Remove no-op repeat nodes in ConvertExpandCopyToRepeatPass #10137

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martinlsm
Copy link
Collaborator

@martinlsm martinlsm commented Apr 14, 2025

Update ConvertExpandCopyToRepeatPass to eliminate Repeat nodes where all repetition counts are one, as these are functionally equivalent to a simple copy. This reduces unnecessary operations in the graph.

This patch affects two unit tests in
backends/arm/test/ops/test_expand.py. The models (test subjects) in those unit tests are in the affected cases optimized such that the only computation node (torch.Tensor.expand) they each contain is optimized away by the modified ConvertExpandCopyToRepeatPass. This will make Vela complain saying that the model is empty and the TOSA file cannot be compiled. Set the affected unit tests to xfail since they are expected to be resolved later in another patch.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218

Update ConvertExpandCopyToRepeatPass to eliminate Repeat nodes where all
repetition counts are one, as these are functionally equivalent to a
simple copy. This reduces unnecessary operations in the graph.

This patch affects two unit tests in
backends/arm/test/ops/test_expand.py. The models (test subjects) in
those unit tests are in the affected cases optimized such that the only
computation node (torch.Tensor.expand) they each contain is optimized
away by the modified ConvertExpandCopyToRepeatPass. This will make Vela
complain saying that the model is empty and the TOSA file cannot be
compiled. Set the affected unit tests to xfail since they are expected
to be resolved later in another patch.

Change-Id: I8f118c30eb9ecde09a7b8dcefd41b1fb65af8a3b
@martinlsm martinlsm requested a review from digantdesai as a code owner April 14, 2025 13:49
Copy link

pytorch-bot bot commented Apr 14, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit f742511 with merge base a260704 (image):

NEW FAILURE - The following job has failed:

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 14, 2025
@martinlsm
Copy link
Collaborator Author

@pytorchbot label "partner: arm"

@pytorch-bot pytorch-bot bot added the partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm label Apr 14, 2025
@martinlsm
Copy link
Collaborator Author

@pytorchbot label "topic: not user facing"

@martinlsm
Copy link
Collaborator Author

@pytorchbot label ciflow/trunk

@oscarandersson8218
Copy link
Collaborator

@martinlsm Linting issues need to be addressed. Apart from that it looks good to me.

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. partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm topic: not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants