Skip to content

[executorch][cuda] Do not offer AOTInductor convolution choices it cannot call - #25268

Merged
Gasoonjia merged 1 commit into
mainfrom
gh/Gasoonjia/119/orig
Nov 19, 2026
Merged

Gasoonjia merged 1 commit into
mainfrom
gh/Gasoonjia/119/orig

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

…nnot call

With layout optimization off, which Inductor decides for a graph with few convolutions (fewer than one per 300 nodes), a stride-1 1x1 convolution is lowered as a convolution, and Inductor's autotuning offers `conv1x1_via_mm`: a Python function with no C++ shim. AOTInductor's C++ wrapper cannot emit it, so whenever it is the fastest choice the compile fails in wrapper codegen with "Expected name is not None". A single strict-FP32 512-to-32 1x1 convolution on a 5x512x3x3 input reproduces it. In a full model it appears once enough convolutions are routed to `triton::convolution` that the remaining ones fall below Inductor's threshold.

The CUDA backend gains one more scoped compile patch, like its existing Inductor workarounds: during its AOTI compile, the convolution lowering's autotuning drops extern choices without a C++ kernel or a fallback kernel when the C++ wrapper is in use. Only threads inside the backend's compile get the change, and the patch is removed when the last one leaves. Inductor offering such Python-only choices under the C++ wrapper is filed upstream as pytorch/pytorch#204342; the patch goes once the pinned PyTorch has the fix.

`test_cuda_export.py` checks that the patch drops only those choices and only for the C++ wrapper, and lowers the reproducing 1x1 convolution with layout optimization off, which failed before.

This diff was authored with Claude Code.

Differential Revision: [D130038817](https://our.internmc.facebook.com/intern/diff/D130038817/)

**NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D130038817/)!


ghstack-source-id: 477683756
Pull-Request: #25236
@pytorch-bot

pytorch-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

⏳ 151 Pending, 1 Unrelated Failure

As of commit 68c5ea9 with merge base 164233d (image):

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 19, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
upload-benchmark-results — 68c5ea98 Deployed Nov 19, 2026 by pytorchbot
cadence — 68c5ea98 Deployed Nov 19, 2026 by pytorchbot
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.

2 participants