Repository navigation
[executorch][cuda] Do not offer AOTInductor convolution choices it cannot call - #25268
Conversation
…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
🔗 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 FailureAs of commit 68c5ea9 with merge base 164233d ( 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. |
This PR needs a
|
This PR was created by the merge bot to help merge the original PR into the main branch.
ghstack PR number: #25236 by @Gasoonjia
^ Please use this as the source of truth for the PR details, comments, and reviews
ghstack PR base: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/119/base
ghstack PR head: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/119/head
Merge bot PR base: https://github.com/pytorch/executorch/tree/main
Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/Gasoonjia/119/orig
Differential Revision: D130038817
@diff-train-skip-merge