Skip to content

[executorch][cuda] Route 3-input-channel window and kernel-equals-stride convolutions to the implicit-GEMM template - #25087

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

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

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

On convolutions with 3 input channels, Inductor's Triton conv template spends most of each channel block on empty lanes. The implicit-GEMM template walks the 3 channels without them, but no call is routed to it.

worth_routing now takes 3-channel calls whose (kernel, stride, symmetric padding) is in ROUTED_FAMILIES: 3x3, 5x5 and 7x7 windows with stride 1, 2 or 4 and padding 0 or half the kernel, 2-D convolutions with kernel == stride from 2 to 32, and 3-D ones with kernel == stride (1,4,4), (2,14,14) and (2,16,16). It bounds batch, extent, input pixels, output pixels, output channels and output elements, and requires a dense NCHW or channels-last input, a contiguous weight, and tensor cores for fp16, bf16 and TF32. Everything else, 1x1 convolutions included, keeps the regular lowering with a recorded reason. benchmarks/conv/benchmark_implicit_gemm.py measures boundary_calls(), every family geometry at every corner of these limits: all 224 are significantly faster than Inductor on an A100 in fp32, fp16, bf16 and TF32, with NCHW and channels-last inputs. The benchmark also has shapes and envelope suites.

test_conv_routing.py derives its range tests from boundary_calls(): every corner routed, one step past each limit and unbenchmarked layouts kept. test_conv_implicit_gemm.py lowers routed models and runs them against eager.

This diff was authored with Claude Code.

Differential Revision: D129645242

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/25087

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

⏳ 1 Pending, 1 Unrelated Failure

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

[ghstack-poisoned]
@Gasoonjia
Gasoonjia deployed to upload-benchmark-results November 15, 2026 15:51 — with GitHub Actions Active

This branch was successfully deployed

1 active and 1 inactive deployments
upload-benchmark-results — 32824bb1 Deployed Nov 15, 2026 by Gasoonjia via upload-benchmark-results #22546
cadence — 32824bb1 Deployed Nov 15, 2026 by Gasoonjia via hifi-op-test / hifi4 #38448
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