Add support for fused Q Up-Proj GEMM/RoPE/Quant. - #3303
Merged
Conversation
Contributor
Greptile SummaryThe PR introduces a Blackwell-targeted fused MLA Q up-projection, RoPE, and MXFP8 quantization path and integrates its pre-quantized output with fused attention.
Confidence Score: 5/5The PR appears safe to merge based on the eligible follow-up findings available in this review. No blocking failure remains. Important Files Changed
Sequence DiagramsequenceDiagram
participant Model
participant Fusion as Fused MLA Q Up-Proj
participant Quant as MXFP8 Layout Preparation
participant DPA as DotProductAttention
participant cuDNN as cuDNN Fused Attention
Model->>Fusion: Q-LORA activation, weight, cos, sin
Fusion->>Fusion: GEMM + per-head RoPE + MXFP8 quantization
Fusion-->>Quant: Quantized Q and saved activation
Model->>Quant: K and V
Quant->>Quant: Quantize and transpose/swizzle scales
Quant->>DPA: Pre-quantized Q, K, V
DPA->>cuDNN: MXFP8 fused-attention request
cuDNN-->>DPA: Attention output
DPA-->>Model: Output and backward gradients
Reviews (11): Last reviewed commit: "Merge branch 'main' into qrope_fusion" | 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.
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 |
Collaborator
|
/te-ci pytorch |
mxfp8_quantize_fast_path. Signed-off-by: Chase Block <cblock@nvidia.com>
Signed-off-by: Chase Block <cblock@nvidia.com>
chaseblock
force-pushed
the
qrope_fusion
branch
from
August 5, 2026 19:09
e529067 to
417d233
Compare
Signed-off-by: Chase Block <cblock@nvidia.com>
chaseblock
force-pushed
the
qrope_fusion
branch
from
August 5, 2026 19:49
a4178fd to
dc89f01
Compare
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>
for more information, see https://pre-commit.ci
These tests really belong in Megatron. Signed-off-by: Chase Block <cblock@nvidia.com>
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: