Add channels_last edge-op dialect (conv, avg_pool2d, permute_copy)#20559
Conversation
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>
🔗 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 FailureAs of commit 019d0f4 with merge base 92e6a4c ( 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. |
This PR needs a
|
AdrianLundell
left a comment
There was a problem hiding this comment.
Nice and clean, thanks!
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