Channels last more ops#20775
Conversation
Extends the channels_last dialect and DecomposeChannelsLastPass with three more ops from pytorch#20093: adaptive_avg_pool2d, upsample_bilinear2d.vec, and upsample_nearest2d.vec. Each follows the established pattern (permute-wrapped aten op in the dialect; permute + aten op + permute in the decomposition). The decomposition targets aten._adaptive_avg_pool2d (the form to_edge produces) and the upsample .vec overloads, all of which have portable runtime kernels. Part of pytorch#20093. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completes the implementable pytorch#20093 op list. grid_sampler_2d follows the standard permute-wrapper pattern (only the input is channels-last; the grid passes through). max_pool2d_with_indices is multi-output: the dialect op returns (values, indices) and the decomposition permutes both back to NHWC — the indices are flat spatial positions (h*W+w) and so are layout-agnostic. Not added: max_pool2d.default (no portable runtime kernel; edge lowers maxpool to the _with_indices form) and t_copy/transpose_copy (per the issue, these normalize to permute_copy, which is conversion-side rather than new dialect ops). 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/20775
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 1 Cancelled Job, 1 PendingAs of commit 443cfc7 with merge base 8f1abad ( NEW FAILURE - The following job has failed:
CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Summary
Adds the remaining #20093 ops to the channels_last dialect and DecomposeChannelsLastPass:
adaptive_avg_pool2d, upsample_bilinear2d.vec, upsample_nearest2d.vec, max_pool2d_with_indices, and
grid_sampler_2d. Builds on the landed dialect (#20559) and decompose pass (#20615); this
completes the implementable op list.
Each op is a permute-wrapped aten op in the dialect and decomposes to permute_copy → edge.aten.X →
permute_copy for the CPU path. grid_sampler_2d permutes only the activation (grid passes
through); max_pool2d_with_indices is multi-output and permutes both values and indices
(layout-agnostic h*W+w positions).
Excluded per the issue: max_pool2d.default (no runtime kernel) and t_copy/transpose_copy
(normalize to permute_copy, conversion-side).
Part of #20093
Test plan
kernel).
to_executorch → run).