Skip to content

Add pass to remove non-contiguous dim order from a graph.#21057

Open
MartinPavella wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:nxg01483/EIEX-993-create-find-dim-order-removing-pass
Open

Add pass to remove non-contiguous dim order from a graph.#21057
MartinPavella wants to merge 1 commit into
pytorch:mainfrom
nxp-upstream:nxg01483/EIEX-993-create-find-dim-order-removing-pass

Conversation

@MartinPavella

@MartinPavella MartinPavella commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

The second (and last) part of #20094. The pass preserves the dim order of the inputs, but internally the graph will use only the contiguous dim order.

For models exported with channels last example inputs, dim_order_clone operators will be inserted to make the inputs contiguous internally. These dim_order_clone ops can then be targeted by a solution from #20095.

Test plan

pytest backends/transforms/test/test_enforce_contiguous_dim_order.py

The pass preserves the dim order of the inputs, but internally the graph will use only the contiguous dim order.
@MartinPavella MartinPavella self-assigned this Jul 21, 2026
@MartinPavella MartinPavella added the python Pull requests that update python code label 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/21057

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

❌ 1 New Failure, 1 Unrelated Failure

As of commit 16832a4 with merge base a19d1ba (image):

NEW FAILURE - The following job has failed:

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
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@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.

@rascani
rascani requested review from mcremon-meta and rascani July 21, 2026 20:58
@rascani

rascani commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

cc @mcremon-meta

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. python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants