[PyTorch] Enable e5m3 fused GEMM kernels from cuDNN - #2
Merged
timmoon10 merged 6 commits intoAug 13, 2026
Merged
Conversation
Signed-off-by: Kaining Zhong <kainingz@nvidia.com>
Signed-off-by: Kaining Zhong <kainingz@nvidia.com>
Signed-off-by: Kaining Zhong <kainingz@nvidia.com>
Signed-off-by: Kaining Zhong <kainingz@nvidia.com>
NVFP4-UE5M3 grouped GEMM falls back to dense GEMMs. Generalize usage of wgrad kernel and use when tensors sizes are not 256-aligned. Fix inconsistent m,n,k GEMM notation. Remove ue5m3 hacks in op fuser tests. Add ue5m3 to grouped MLP tests. Signed-off-by: Tim Moon <tmoon@nvidia.com>
timmoon10
merged commit Aug 13, 2026
343c4bd
into
timmoon10:nvfp4-ue5m3-prototype
5 of 11 checks passed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Route NVFP4 with e5m3 SF GEMM to cuDNN. Only applied to basic linear and fused grouped linear for now
TODO:
grouped_gemm_quant_wrapper_sm100doesn't support accumulation, so I have to turn off withcfg.model.gradient_accumulation_fusion.kv_a_proj_with_mqadue to cuDNN-FE'sgrouped_gemm_quant_wrapper_sm100requiring M to be divisible by 256. Maybe I can also try to usegrouped_gemm_wgrad_wrapper_sm100instead which doesn't require divisibilityThe numeric seems wrong when I train DeepSeek V3. I'm still debugging it
Fixes # (issue)
Type of change
Changes
general_gemmnow goes to cuDNN-FE'sgrouped_gemm_quant_wrapper_sm100when NVFP4 with e5m3 SFgrouped_mlp.pyuses cuDNN-FE's Rubin kernels when NVFP4 with e5m3 SF_cast_master_weights_to_nvfp4_2dotherwise quantization will default to e4m3 and emits wrong resultChecklist: