You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[executorch][cuda] Add an implicit-GEMM template for dense triton::convolution - #25086
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.
meta-claBot
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
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.meta-exported
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack (oldest at bottom):
Dense convolutions have no
triton::convolutiontemplate, 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) andigemm_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.pyruns 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!