Skip to content

Add Unsqueeze copy partitioner configs to reduce XNNPACK delegate fragmentation#19261

Open
pssrawat wants to merge 1 commit intopytorch:mainfrom
pssrawat:export-D103450015
Open

Add Unsqueeze copy partitioner configs to reduce XNNPACK delegate fragmentation#19261
pssrawat wants to merge 1 commit intopytorch:mainfrom
pssrawat:export-D103450015

Conversation

@pssrawat
Copy link
Copy Markdown
Contributor

@pssrawat pssrawat commented May 1, 2026

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 subclassUnsqueezeCopyConfig which accepts unsqueeze_copy.default only when the inserted dim is the trailing dim (mirrors UnsqueezeVisitor's constraint).

Differential Revision: D103450015

…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
@pssrawat pssrawat requested a review from digantdesai as a code owner May 1, 2026 20:19
@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented May 1, 2026

🔗 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 New Failure, 2 Unrelated Failures

As of commit 2a1f4c3 with merge base a7e44bf (image):

NEW FAILURE - The following job has failed:

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.

@meta-cla meta-cla 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 May 1, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 1, 2026

@pssrawat has exported this pull request. If you are a Meta employee, you can view the originating Diff in D103450015.

@pssrawat pssrawat added the release notes: none Do not include this in the release notes label May 1, 2026
Copy link
Copy Markdown
Member

@GregoryComer GregoryComer left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for adding this.

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. fb-exported meta-exported release notes: none Do not include this in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants