Conversation
valarLip
reviewed
Jun 3, 2026
| flat_cache = kv_cache.view(-1, self.kv_lora_rank + self.qk_rope_head_dim) | ||
| # ``kv_indices`` is a reusable workspace; only the current k/v output | ||
| # length is valid for this call. | ||
| valid_indices = kv_indices[: k_out.shape[0]].to(torch.long) |
Contributor
Author
There was a problem hiding this comment.
…
have deleted it....
… v2 model Support DeepSeek FP4 qknorm fusion and scoped input RMSNorm quant fusion through fused RMSNorm+MXFP4 kernels while preserving cached KV fallback handling, GEMM scale layouts, and mixed-quant/MTP model stability.
Route SGLang FP4 qknorm quant through the same activation scale layout and q_b_proj backend dispatch as native ATOM to avoid precision loss when the non-shuffle Triton GEMM path is disabled.
Use the extended gather_kv_b_proj path for cached MLA prefill so FP4 weights no longer fall back to Python gather/projection.
Limit the newly enabled non-Triton FP4 input RMSNorm quant path to DeepSeek V2/V3 models so wrapper models keep their existing Triton-gated behavior.
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.
Motivation
Enable DeepSeek V2 FP4 input_rmsnorm_quant and qknorm_quant fusion in ATOM across both Triton and non-Triton GEMM paths. This reduces separate RMSNorm + quant kernel launches while keeping FP4 activation scale layouts and cached KV projection paths correct.
Technical Details
Test Plan
server:
client:
Test Result
For preshuffle FP4 gemm kernel:

For non-preshuffle FP4 gemm kernel:

export ATOM_USE_FP4_NON_SHUFFLE_TRITON_GEMM=1
Accuracy:
Submission Checklist