Skip to content

Add channels_last edge-op dialect (conv, avg_pool2d, permute_copy)#20559

Draft
rascani wants to merge 1 commit into
pytorch:mainfrom
rascani:channels-last-dialect
Draft

Add channels_last edge-op dialect (conv, avg_pool2d, permute_copy)#20559
rascani wants to merge 1 commit into
pytorch:mainfrom
rascani:channels-last-dialect

Conversation

@rascani

@rascani rascani commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

First vertical slice of the common memory-layout handling infra (RFC #19299): a backend-agnostic channels_last operator dialect whose ops interpret their activations as (N, H, W, C) contiguous with a fixed dim-order. Kernels wrap the existing aten ops with permutes, since efficiency is a non-goal at this layer; later passes (the #20094 conversion and #20098 fusion) make channels-last regions explicit and fuse the permutes away. Runtime C++ kernels, the conversion pass, and the remaining ops are deferred to follow-ups.

Part of #20093.

Test plan

pytest backends/transforms/test/test_channels_last_ops.py

First vertical slice of the common memory-layout handling infra (RFC pytorch#19299):
a backend-agnostic channels_last operator dialect whose ops interpret their
activations as (N, H, W, C) contiguous with a fixed dim-order. Kernels wrap the
existing aten ops with permutes, since efficiency is a non-goal at this layer;
later passes (the pytorch#20094 conversion and pytorch#20098 fusion) make channels-last
regions explicit and fuse the permutes away. Runtime C++ kernels, the conversion
pass, and the remaining ops are deferred to follow-ups.

Part of pytorch#20093.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pytorch-bot

pytorch-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 2 New Failures, 1 Unrelated Failure, 1 Unclassified Failure

As of commit 019d0f4 with merge base 92e6a4c (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

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 26, 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.

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant