Repository navigation
Align aiter quick reduce prefill and old-CA fused all-reduce rmsnorm decode paths - #14
Merged
sammysun0711 merged 2 commits intoAug 10, 2026
Merged
Conversation
apinge
marked this pull request as ready for review
August 8, 2026 10:25
There was a problem hiding this comment.
Pull request overview
This PR restores/aligns AITER-based reduce optimizations with the referenced older Qwen3.5 branch, targeting faster prefill all-reduce (via quick-reduce/cuda communicator) and decode-time fused all-reduce + RMSNorm paths.
Changes:
- Switch Qwen3.5 MLP preparation to a new communicator path that can fuse TP all-reduce + RMSNorm before the MLP when eligible.
- Add FP8 “pre-quantized input” plumbing to reuse existing FP8 views/scales in linear paths.
- Add/restore multiple all-reduce fast paths and toggles (AITER CudaCommunicator for prefill-like forwards, old-CA selection, and first-hit logging).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/sglang/srt/models/qwen3_5.py | Routes MLP prep through a norm-fusion-capable communicator method. |
| python/sglang/srt/models/qwen2_moe.py | Ensures gate computations use the BF16 view when hidden states may be a tuple. |
| python/sglang/srt/layers/quantization/fp8.py | Detects tuple inputs carrying BF16/FP8/scale views and forwards pre-quantized metadata. |
| python/sglang/srt/layers/quantization/fp8_utils.py | Adds pre_quantized fast path to reuse FP8 inputs in FP8 linear. |
| python/sglang/srt/layers/layernorm.py | Adds env toggle for old/new CA selection and fixes use_attn_tp_group wiring. |
| python/sglang/srt/layers/communicator.py | Introduces MLP norm-fusion path and refactors AITER fusion gating/logging. |
| python/sglang/srt/distributed/parallel_state.py | Adds prefill-scoped AITER cuda comm AR path and extends fused AR+RMSNorm(±Quant) plumbing. |
| python/sglang/srt/distributed/device_communicators/quick_all_reduce.py | Adds initialization and first-hit logging for QuickAllReduce. |
| python/sglang/srt/distributed/communication_op.py | Extends fused AR+RMSNorm API to carry use_old_ca and adds quant variant wrapper. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
sammysun0711
approved these changes
Aug 9, 2026
sammysun0711
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, leave minor comments for environment variables, need to be clarified.
…_FUSED_MLP_QUANT Signed-off-by: apinge <[email protected]>
5 tasks
5 tasks
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
Align the current branch with the old Qwen3.5_v0.5.9 branch by restoring the reduce optimizations from PR zejunchen-zejun#267 and PR zejunchen-zejun#277: aiter quick reduce for prefill, and old-CA fused all-reduce + rmsnorm for
decode.
The goal of this PR is to align with our legacy branch. Please note that while the legacy code includes the sglang in-tree QR implementation (enabled by
ROCM_QUICK_REDUCE_QUANTIZATION), it is not actually utilized in our specific scenario.Specifically, in
python/sglang/srt/distributed/parallel_state.py, the settingoutplace_all_reduce_method = "qr"refers to this in-tree QR. However, our setup relies on the aiter-based QR (enabled byAITER_QUICK_REDUCE_QUANTIZATION), whereoutplace_all_reduce_methodis set toaiter_cuda_comm.Additionally,
tensor_model_parallel_fused_allreduce_rmsnorm_quantis not used during the decode phase, even though the corresponding code was imported. Our scenario only utilizestensor_model_parallel_fused_allreduce_rmsnorm.Modifications
Accuracy Tests
Speed Tests and Profiling
Before
Prefill
Decode
After
Prefill
Decode
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci