Skip to content
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

Conditionally support expand_copy in XNNPACK delegate #7960

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GregoryComer
Copy link
Member

Summary

Expand is sometimes used to to express an unsqueeze operation (inserting singleton dims) - one motivating example is in MobileBERT (link). This PR adds a pass to XNNPACK to conditionally transform expand_copy into view_copy, as long as the expand is used solely to add singleton dimensions. It also updates the partitioner with the appropriate constraint.

Note that this PR is stacked on top of #7959, as it relies on these changes (delegation of view_copy).

Test plan

Added test coverage in backends/xnnpack/test/ops/test_expand.py and backends/xnnpack/test/passes/test_expand_to_view_pass.py. These cover end-to-end delegation and pass-specific logic.

@GregoryComer GregoryComer added the release notes: xnnpack Changes to the XNNPack backend delegate label Jan 27, 2025
Copy link

pytorch-bot bot commented Jan 27, 2025

🔗 Helpful Links

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

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

❌ 1 New Failure

As of commit 7ce711f with merge base e78ed83 (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 Jan 27, 2025
@GregoryComer GregoryComer requested a review from mcr229 January 27, 2025 08:42
@GregoryComer GregoryComer marked this pull request as ready for review January 27, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: xnnpack Changes to the XNNPack backend delegate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants