Repository navigation
Conversation
Signed-off-by: Xiake Sun <[email protected]>
Signed-off-by: apinge <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR adjusts the normalization + all-reduce fusion plumbing so AITER fused AR+RMSNorm is only attempted when custom all-reduce is enabled, aligning “fused norm” behavior with the global custom-AR enable/disable switch.
Changes:
- Gate AITER fused AR+RMSNorm behind
is_custom_all_reduce_enabled()in both layernorm fusion and communicator fusion checks. - Refine all-reduce fallback behavior in
layernorm.pyto use the correct TP group (attention vs MoE) when fusion isn’t taken. - Tighten custom-allreduce routing in
parallel_state.py(including addingis_custom_all_reduce_enabled()and preventing fused AR+RMSNorm calls when custom AR is disabled).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/sglang/srt/layers/layernorm.py | Adds custom-AR gating for AITER fused norm and adjusts fallback all-reduce path selection. |
| python/sglang/srt/layers/communicator.py | Centralizes the AITER fused AR+RMSNorm enable check and reuses it in fusion decision points. |
| python/sglang/srt/distributed/parallel_state.py | Adds a global “custom AR enabled” query and ensures custom/fused all-reduce paths are skipped when disabled. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: apinge <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
python/sglang/srt/layers/layernorm.py:203
--enable-aiter-allreduce-fusionstill exists inserver_args.py, but after this change it no longer gates the AITER fused AR+RMSNorm path anywhere (repo-wide grep shows onlyserver_args.pyreferences). This makes the CLI flag effectively a no-op and can confuse users. Either remove/deprecate the flag (and its validation) or reintroduce it as a gate for attempting the AITER fused AR+RMSNorm path.
if (
fused_ar_uses_tp_group
and _AITER_FUSED_NORM_DEFAULT
and is_custom_all_reduce_enabled()
and x.numel() > 0
):
python/sglang/srt/layers/communicator.py:182
_is_aiter_fused_ar_rmsnorm_enabled()currently ignoresget_global_server_args().enable_aiter_allreduce_fusion. Since that CLI option still exists, incorporating it here would make the AITER fused AR+RMSNorm gating consistent across this file and avoid the flag becoming a no-op.
def _is_aiter_fused_ar_rmsnorm_enabled() -> bool:
return _AITER_FUSED_AR_RMSNORM_DEFAULT and is_custom_all_reduce_enabled()
Signed-off-by: apinge <[email protected]>
Signed-off-by: apinge <[email protected]>
Signed-off-by: apinge <[email protected]>
Signed-off-by: apinge <[email protected]>
Signed-off-by: apinge <[email protected]>
|
The last CI run shows worse performance. Even after bumping PR cold raw benchmarkPR warm raw benchmarkBase raw benchmark (with warm) |
Motivation
This PR restores the intended custom all-reduce behavior while keeping
--disable-custom-all-reduceas nccl fallbackpath.
After this change:
--disable-custom-all-reducefall back to ncclAfter this modification, 35B command line as (Note that
export AITER_QUICK_REDUCE_QUANTIZATION=INT6for prefill QR )Modifications
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci