Add Unsqueeze copy partitioner configs to reduce XNNPACK delegate fragmentation#19261
Merged
meta-codesync[bot] merged 1 commit intopytorch:mainfrom May 4, 2026
Merged
Conversation
…gmentation Summary: `aten.unsqueeze_copy.default` already have working `NodeVisitor` implementation in `backends/xnnpack/operators/op_squeeze.py`, but it was never wired into `ALL_PARTITIONER_CONFIGS`. As a result the partitioner could not absorb them, which forced delegate breaks every time the graph passed through one of these reshapes. This adds `GenericNodePartitionerConfig` subclass`UnsqueezeCopyConfig` which accepts `unsqueeze_copy.default` only when the inserted dim is the trailing dim (mirrors `UnsqueezeVisitor`'s constraint). Differential Revision: D103450015
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19261
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (2 Unrelated Failures)As of commit 2a1f4c3 with merge base a7e44bf ( BROKEN TRUNK - The following jobs failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Contributor
|
@pssrawat has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103450015. |
GregoryComer
approved these changes
May 1, 2026
Member
GregoryComer
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks for adding this.
kimishpatel
approved these changes
May 4, 2026
Contributor
kimishpatel
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
aten.unsqueeze_copy.defaultalready have workingNodeVisitorimplementation inbackends/xnnpack/operators/op_squeeze.py, but it was never wired intoALL_PARTITIONER_CONFIGS. As a result the partitioner could not absorb them, which forced delegate breaks every time the graph passed through one of these reshapes.This adds
GenericNodePartitionerConfigsubclassUnsqueezeCopyConfigwhich acceptsunsqueeze_copy.defaultonly when the inserted dim is the trailing dim (mirrorsUnsqueezeVisitor's constraint).Differential Revision: D103450015