Skip to content

[executorch][cuda] Converted convolutions follow the output layout the graph recorded - #25088

Open
Gasoonjia wants to merge 2 commits into
gh/Gasoonjia/114/basefrom
gh/Gasoonjia/114/head
Open

Gasoonjia wants to merge 2 commits into
gh/Gasoonjia/114/basefrom
gh/Gasoonjia/114/head

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

torch.export runs with cuDNN off and records a contiguous output for convolutions with a channels-last input, while ATen's CUDA convolution returns channels-last. The router refused calls whose recorded layout differed from ATen's, which excluded every channels-last-input convolution exported on CUDA.

triton::convolution takes an optional trailing output_strides. The fake implementation and the real allocation both get the output layout from out_shape_and_stride, which returns these strides when given and rejects non-dense ones. The router passes the node's recorded strides and refuses only non-dense ones, with the reason. worth_routing admits only measured (input, weight, output) memory-format combinations. Channels-last input with contiguous output is added where it was measured significantly faster than Inductor followed by contiguous(): the implicit GEMM at the 224 boundary corners in four precisions (895 of 896 significant), and the direct stencil from 12544 input elements (all 190 measured cases). The benchmarks gain this layout (--layout cl_to_nchw, --suite layouts).

test_conv_binding.py covers explicit strides, the dense check and the fake op; test_conv_routing.py routes CUDA-exported channels-last calls with the recorded strides and checks dense, non-dense and resized layouts and both templates' layout gates; the template tests write every dense output order.

This diff was authored with Claude Code.

Differential Revision: D129779886

NOTE FOR REVIEWERS: This PR has internal Meta-specific changes or comments, please review them on Phabricator!

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

❌ 1 New Failure, 1 Pending, 1 Unrelated Failure

As of commit 8d3e042 with merge base dea39f0 (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.

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

@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 Nov 14, 2026
@Gasoonjia
Gasoonjia deployed to upload-benchmark-results November 14, 2026 10:19 — with GitHub Actions Active
[ghstack-poisoned]
@Gasoonjia
Gasoonjia deployed to upload-benchmark-results November 15, 2026 14:55 — with GitHub Actions Active

This branch was successfully deployed

1 active and 1 inactive deployments
upload-benchmark-results — 8d3e042e Deployed Nov 15, 2026 by Gasoonjia via upload-benchmark-results #22540
cadence — 8d3e042e Deployed Nov 15, 2026 by Gasoonjia via hifi-op-test / hifi4 #38442
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant