FP8 Megablox for batch split#3770
Open
BirdsOfAFthr wants to merge 1 commit intomainfrom
Open
Conversation
Collaborator
|
Note there is more general support in this PR #3736 |
47d4976 to
3da5049
Compare
3da5049 to
5992420
Compare
5992420 to
61a6832
Compare
shuningjin
reviewed
May 1, 2026
Collaborator
There was a problem hiding this comment.
Thanks for GMM FP8 support with careful manual quantization, while bringing back merging gating from PR#3199! Had a comment wrt sharding, and other minor changes.
shuningjin
reviewed
May 1, 2026
| Returns: | ||
| The result of the grouped matrix multiplication. | ||
| """ | ||
| if config.use_qwix_quantization: |
Collaborator
There was a problem hiding this comment.
maybe this condition is clearer?
if config.quantization == "fp8_full":
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
(1) This update enables FP8 Megablox quantization support for DeepSeek batch split configurations.
When quantization is active, the following changes apply:
Kernel Quantization: gmm kernels allow FP8 recipes (defined via the MaxText command line) in both forward and backward passes.
gmmforward: weight is manually quantized to bypass the expcilt sharding error; activation is quantized using qwixgmmbackward: gradients are quantized using qwix.(2) This change also enables merging gating gmm kernels.
In the previous SwiGLU/GLU implementation, the gate-projection and up-projection were processed using two sequential$W_0$ and $W_1$ effectively gives us a 2X increase in that local dimension, restoring arithmetic intensity and hardware utilization.
gmm_fncalls. By concatenating these weights and processing them together, we effectively double the contiguous hidden dimension of the kernel. This is especially critical for FP8 utilizing Expert Parallelism (EP) that shard along the contracting dimension. Because this sharding strategy inherently shrinks the local MLP hidden dimension on each device, the matrix multiplications can become small and bottlenecked by memory bandwidth. MergingTests
Verification: Validated via end-to-end (e2e) perf and convergence benchmarks.
Coverage: Unit tests will be added in a subsequent update.
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.