Skip to content

[executorch][cuda] Add an implicit-GEMM template for dense triton::convolution - #25086

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

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

Conversation

@Gasoonjia

@Gasoonjia Gasoonjia commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

Dense convolutions have no triton::convolution template, so calls Inductor cannot compile have nowhere to go, and convolutions on which Inductor's template wastes work, such as 3-channel inputs whose channel blocks are mostly empty, cannot be improved.

This diff adds an implicit-GEMM template for dense (groups 1) 2-D and 3-D forward convolutions. One kernel is written for (D, H, W), lower ranks being unit dims; shapes and geometry are constexpr, so bounds checks the geometry cannot fail compile away. K is walked per kernel tap in blocks of input channels from 16 channels, and as one flat (channel, tap) index below that, which wastes no lanes on 3-channel inputs. Two schedules are timed at compile time: igemm_ffma (FP32 FMA, portable) and igemm_tc (tensor cores for fp16/bf16, TF32 for fp32; sm_80). conv_allows_tf32() follows the TF32 setting of Inductor's conv templates, so a convolution keeps its precision whether it is routed or not. No call is routed yet.

test_conv_implicit_gemm.py runs every schedule, K order and config against an FP64 reference over representative geometries, dtypes, layouts, biases, sliced inputs and a 2^31-element input, and checks the capability and TF32 gates of the tensor-core schedule.

This diff was authored with Claude Code.

Differential Revision: D129645280

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

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

✅ You can merge normally! (2 Unrelated Failures)

As of commit 4ce2697 with merge base dea39f0 (image):

BROKEN TRUNK - The following jobs 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.

@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
@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 12:17 — with GitHub Actions Active

This branch was successfully deployed

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