Repository navigation
[PyTorch] Fuse NVFP4 global scales and GEMM alpha in the grouped MLP - #3756
Open
sraman-rgb wants to merge 2 commits into
Open
sraman-rgb wants to merge 2 commits into
sraman-rgb wants to merge 2 commits into
Conversation
Compute both operands' per-group NVFP4 global scales and their product (or its square root for dGLU) in one Triton launch instead of several eager elementwise kernels. Bit-identical to the eager ops; falls back to them for unsupported inputs. Signed-off-by: Siddhartha Raman S <sraman@nvidia.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
[Medium impact] The PR appears safe to merge; no actionable defects were found. SummaryFuses NVFP4 operand scales and optional GEMM alpha into one Triton launch for the grouped MLP.
Reviews (2) · Last reviewed commit: "Merge upstream main into sraman/nvfp4-fu..." · Reviewed by Greptile |
grouped_mlp.py was restructured upstream (canonical cuDNN layouts, cuBLAS NVFP4-UE5M3, which removed the UE5M3 grouped-GEMM workaround, BF16 fused grouped MLP). Take upstream's file and re-apply this PR's change on it: _nvfp4_global_scale_pair at the three remaining operand-pair sites (wgrad global scales, FC1 alpha, FC2 dSReLU/dGLU alpha). Signed-off-by: Siddhartha Raman S <sraman@nvidia.com>
This branch has not been deployed
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.
Compute both operands' per-group NVFP4 global scales and their product (or its square root for dGLU) in one Triton launch instead of several eager elementwise kernels. Bit-identical to the eager ops; falls back to them for unsupported inputs.
Description
Please include a brief summary of the changes, relevant motivation and context.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: