Skip to content

Arm backend: Improve permute/view fusing#21055

Open
AdrianLundell wants to merge 1 commit into
pytorch:mainfrom
AdrianLundell:temp
Open

Arm backend: Improve permute/view fusing#21055
AdrianLundell wants to merge 1 commit into
pytorch:mainfrom
AdrianLundell:temp

Conversation

@AdrianLundell

@AdrianLundell AdrianLundell commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator
  • Makes view/permutes always split to all branches of a node with multiple outputs for downward propagation. Note that this will never increase the number of permutes/views in the graph, since any non-fused permutes/views will propagate back and be fused together again by the upward propagation pass.

  • Adds support for where operator to fuse_identical_input_transforms

  • Replaces _would_strand_layout_op_on_wider_elements with MoveDataMovementOpsToSmallerDtypePass to allow ops to
    propagate more freely during the fusing phase

  • Adds tosa ops to MatchArgsPass since it is run after some ops have been rewritten to TOSA.

  • Generalizes refresh_permute_view_meta into refresh_node_meta which works for any operators and uses that.

cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani

Adds transpose counting to pixel-shuffle tests including
a mixed precision case with decomposed Q/DQ nodes which
the previous permute propagation did not handle.

This is fixed by adding support for propagating views and
permutes over across forks in the graph, as long as it can
be proven that the branches will eventually converge.

Also adds support for where to fuse_identiacal_input_transforms

Signed-off-by: Adrian Lundell <adrian.lundell@arm.com>
Change-Id: If66ff26d8020cdeab9ea88bc87a687a63a57dda0
@AdrianLundell AdrianLundell added partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm ciflow/trunk release notes: none Do not include this in the release notes labels Jul 21, 2026
@pytorch-bot

pytorch-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 3 New Failures, 1 Cancelled Job, 1 Unrelated Failure

As of commit 9526704 with merge base a19d1ba (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOB - The following job was cancelled. Please retry:

BROKEN TRUNK - The following job 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 Jul 21, 2026
@github-actions github-actions Bot added the module: arm Issues related to arm backend label Jul 21, 2026
@AdrianLundell
AdrianLundell requested a review from rascani July 21, 2026 08:24
lambda arg: arg.meta["val"] if isinstance(arg, torch.fx.Node) else arg,
)
node.meta["val"] = cast(Any, node.target)(*args, **kwargs)
except Exception:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any way to narrow this to expected Exception classes?

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 partner: arm For backend delegation, kernels, demo, etc. from the 3rd-party partner, Arm 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