Skip to content

Channels last: optimize structural layout regions - #21962

Open
rascani wants to merge 8 commits into
gh/rascani/15/headfrom
gh/rascani/8/head
Open

Channels last: optimize structural layout regions#21962
rascani wants to merge 8 commits into
gh/rascani/15/headfrom
gh/rascani/8/head

Conversation

@rascani

@rascani rascani commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Introduce common structural layout-copy helpers and teach the shared transpose
and permute transforms to preserve layout provenance only when every
contributing copy is layout-owned.

Add opt-in layout-region boundary propagation with backend barriers, rank and
broadcast validation, constant remapping, alias handling, symbolic-shape
support, and copy-volume safety. Per-channel QDQ remains a barrier because its
axis is dimension-dependent.

Read the whole of remove_permutes_around_elementwise_ops.py rather than the
diff: the boundary machinery is easier to follow as a unit than as a patch
against the pre-existing subgraph walk.

Local Corstone-300 run of the full Cortex-M suite (670 passed, 4 skipped, 45
xfailed, 4 xpassed), the transforms suites, and lintrunner.

Authored with Codex.

[ghstack-poisoned]
[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 9 Unrelated Failures

As of commit 88da265 with merge base 8b93850 (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.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@AdrianLundell

Copy link
Copy Markdown
Collaborator

What is the reason for extending this pass rather than generalizing the PropagateViewCopyPermuteUp/Down passes from the arm backend? The biggest issue which introduced unnecessary permutes in the arm backend before the refactor was view operators which forced channels-first format, and I don't see that solved by this pass.

Also, is it necessary to distinguish between layout introduced ops and existing ones?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants