Skip to content

Transforms: share the view/permute algebra with all backends - #22119

Open
rascani wants to merge 2 commits into
mainfrom
gh/rascani/23/head
Open

Transforms: share the view/permute algebra with all backends#22119
rascani wants to merge 2 commits into
mainfrom
gh/rascani/23/head

Conversation

@rascani

@rascani rascani commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

dim_maps holds the algebra that permute-fusing passes use to decide whether a
reshape can be commuted past a transpose, and whether two data-movement ops
cancel. It is the piece a backend cannot reasonably reimplement, and today it
is only reachable by depending on the Arm backend.

Nothing in it is Arm-specific: 1030 lines importing sympy, torch and
exir.dialects, with no reference to TOSA, Ethos or any Arm pass. Move it to
backends/transforms so that op-level backends -- Cortex-M first -- can build on
the same layout optimization infrastructure rather than growing a parallel copy.

A re-export shim stays at the old path forwarding every symbol other modules
import, including the underscore-prefixed helpers, so in-flight Arm work is
unaffected and its 746-line test suite runs unchanged against the moved module.

This also resolves a latent build problem it was tangled in. The Arm :core
target lists arm_pass_utils.py in explicit srcs, and that file imports dim_maps,
which was globbed into :passes -- while :passes depends on :core. The dependency
could not be declared without a cycle. dim_maps now has its own target below
both, so the edge is expressible.

No behaviour change; the module is byte-identical apart from its path.

Authored with Claude Code.

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 43 New Failures, 2 Cancelled Jobs

As of commit 0b038a5 with merge base e831b3e (image):

NEW FAILURES - The following jobs have failed:

CANCELLED JOBS - The following jobs were cancelled. Please retry:

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 Aug 25, 2026
@github-actions github-actions Bot added ciflow/trunk module: arm Issues related to arm backend labels Aug 25, 2026
@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]
@rascani
rascani marked this pull request as ready for review August 25, 2026 04:12
@rascani
rascani requested a review from digantdesai as a code owner August 25, 2026 04:12
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.

1 participant