Skip to content

Add initial permute-view fusing test-suite.#20415

Open
AdrianLundell wants to merge 2 commits into
pytorch:mainfrom
AdrianLundell:change-1281780
Open

Add initial permute-view fusing test-suite.#20415
AdrianLundell wants to merge 2 commits into
pytorch:mainfrom
AdrianLundell:change-1281780

Conversation

@AdrianLundell

@AdrianLundell AdrianLundell commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Initial work on #20097, using the tests from the transpose count suite in the arm backend. All modules are exported and to_edge_transform_and_lowered with a single mock-pass which is intended to run the full pipeline for converting a graph to contiguous channels last format and fusing any additional permutes.

The number of permutes and views are counted before and after the pipeline to track any change in the models.

Other backends are encouraged to add their own test of interest to ensure that changes to the in-common passes will not regress individual backends. Additionally a number of full model tests will be added.

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

Initial work on pytorch#20097, using the tests from the transpose
count suite in the arm backend. All modules are exported
and to_edge_transform_and_lowered with a single mock-pass
which is intended to run the full pipeline for converting a graph
to contiguous channels last format and fusing any additional
permutes.

The number of permutes and views are counted before
and after the pipeline to track any change in the models.

Other backends are encouraged to add their own test of interest
to ensure that changes to the in-common passes will not regress
individual backends. Additionally a number of full model tests
will be added.

Signed-off-by: Adrian Lundell <adrian.lundell@arm.com>
Change-Id: I0c4cc5ba72036e539ab640ddaed2c63b145874cf
Copilot AI review requested due to automatic review settings June 22, 2026 07:27
@AdrianLundell AdrianLundell added 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 labels Jun 22, 2026
@pytorch-bot

pytorch-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures, 3 Unrelated Failures

As of commit 01c3c9b with merge base 0da9ca3 (image):

NEW FAILURES - The following jobs have 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 Jun 22, 2026

Copilot AI left a comment

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.

Pull request overview

Adds an initial (currently skipped) test suite under backends/transforms/test/ intended to track permute/view operator counts before/after running an edge transform/lower pipeline, and to verify numerical equivalence across a set of representative modules/models.

Changes:

  • Introduces a catalog of test modules and “case” definitions covering conv/linear/attention/RNN/etc. plus channels-last variants.
  • Adds a custom ExportPass that counts permute- and view-like Edge ops before/after the pass pipeline.
  • Adds two pytest entrypoints (normal + channels-last), currently marked as proof-of-concept and skipped.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backends/transforms/test/test_to_contiguous_channels_last_pass.py Outdated
@pytest.mark.skip(
reason="Proof of concept - currently no permute-view passes implemented."
)
@common.parametrize("case", cases_channels_last, xfail=xfails)
Comment thread backends/transforms/test/test_to_contiguous_channels_last_pass.py Outdated
Comment thread backends/transforms/test/test_to_contiguous_channels_last_pass.py
Comment thread backends/transforms/test/test_to_contiguous_channels_last_pass.py
class MaxPool2dDilatedModule(torch.nn.Module):
def __init__(self):
super().__init__()
self.pool = torch.nn.MaxPool2d(kernel_size=3, stride=1, padding=1, dilation=2)
Signed-off-by: Adrian Lundell <adrian.lundell@arm.com>
Change-Id: Ibc5f48266d5015c0859be05d8eada92a84a682d5
@oscarandersson8218 oscarandersson8218 added the help wanted Extra attention is needed label Jun 22, 2026
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. help wanted Extra attention is needed 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.

4 participants