[fea] Add fp32 RMSNorm output for fused qk group quant#3785
Open
wuhuikx wants to merge 2 commits into
Open
Conversation
Expose the internal fp32 RMSNorm result as an optional output so callers can reuse it for fp32 router projections without an extra cast.
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
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.
Summary
q_out_unquantized_fp32output tofused_qk_rmsnorm_group_quantso callers can reuse the kernel's internal fp32 RMSNorm result.std::nulloptfor the new optional output.Performance
Measured with MiniMax-M3-MXFP4 on ATOM using the same aiter build and only toggling the ATOM router path between baseline bf16 norm +
.float()and optimized fp32 norm output reuse. Workload:ISL=8000,OSL=1000,TP=4,max_num_seqs=32.CON=4: output tok/s395.33 -> 407.61(+3.11%), mean TPOT9.45 -> 9.14 ms(-3.28%)CON=8: output tok/s707.74 -> 745.23(+5.30%), mean TPOT10.32 -> 9.97 ms(-3.39%)CON=16: output tok/s1217.98 -> 1254.47(+3.00%), mean TPOT12.23 -> 11.99 ms(-1.96%)Test plan
python3 -m py_compile aiter/ops/fused_qk_rmsnorm_group_quant.pyfused_qk_rmsnorm_group_quant(..., q_out_unquantized_fp32=...)on CUDA/bf16 input.CON=4,8,16with the above workload.