Add support for fused Q Up-Proj GEMM/RoPE/Quant. - #3303
Open
chaseblock wants to merge 5 commits into
Open
Conversation
Contributor
Greptile SummaryThe PR adds a public fused MLA Q up-projection wrapper and extends fused attention to consume MXFP8 Q/K/V while optionally returning BF16 gradients.
Confidence Score: 5/5The PR appears safe to merge within the scope of this follow-up review. No blocking failure remains in the eligible review scope. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
X["Input activation"] --> U["Fused Q up-projection"]
W["BF16 or MXFP8 weight"] --> U
R["RoPE cos/sin"] --> U
U --> Q["MXFP8 query"]
K["Key"] --> KQ["MXFP8 quantization"]
V["Value"] --> VQ["MXFP8 quantization"]
Q --> S["BHSD scale transpose and GEMM swizzle"]
KQ --> S
VQ --> S
S --> A["cuDNN fused attention"]
A --> O["Attention output"]
A --> B["Optional BF16 Q/K/V gradients"]
Reviews (3): Last reviewed commit: "Adjust comment SBHD/BSHD" | Re-trigger Greptile |
6 tasks
sudhakarsingh27
left a comment
Member
There was a problem hiding this comment.
- Commented feedback inline
- Pls fix DCA here and in the other PR
- Also, I wonder if you've measured perf for
mxfp8_quantize_onlyand its swizzle counterpart. I feel they could be further optimized as I see a lot of for loops.
| "sbhd", | ||
| ), f"mxfp8_quantize_only only supports bshd/sbhd, got {src_format!r}." | ||
| _s_dim = {"bshd": 1, "sbhd": 0} | ||
| _d_dim = {"bshd": 3, "sbhd": 3} |
Member
There was a problem hiding this comment.
do we need a dict for this const
This commit add support for fusing the GEMM in the Q Up Proj step of DeepseekV3 training with the following RoPE and MXFP8 quantization operations. This uses a custom kernel from cudnn_frontend, and supports both 16-bit projection and mxfp8 projection. Signed-off-by: Chase Block <cblock@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Chase Block <cblock@nvidia.com>
for more information, see https://pre-commit.ci
Signed-off-by: Chase Block <cblock@nvidia.com>
chaseblock
force-pushed
the
qrope_fusion
branch
from
August 5, 2026 15:34
fd21ddf to
5f90db7
Compare
chaseblock
added a commit
to chaseblock/Megatron-LM
that referenced
this pull request
Aug 5, 2026
This commit adds support for fusing the q up proj gemm with the following rope and mxfp8 quantization operations. Relies on the TE functionality from NVIDIA/TransformerEngine#3303 Signed-off-by: Chase Block <cblock@nvidia.com>
Contributor
Author
Addressed inline feedback. DCA fixed. I haven't explicitly modeled the perf of these two functions, but they were essentially extracted from the existing |
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.
This PR adds support for fusing the GEMM in the Q Up Proj step of DeepseekV3 training with the following RoPE and MXFP8 quantization operations. This uses a custom kernel from cudnn_frontend, and supports both 16-bit projection and mxfp8 projection.
Type of change
Checklist: