[AMD] Add fused all-reduce RMSNorm per-group quant for Qwen3.5 FP8 - #24651
Merged
HaiShaw merged 13 commits intoJul 22, 2026
Merged
Conversation
hubertlu-tw
requested review from
BBuf,
Edwardf0t1,
ch-wan and
yizhang2077
as code owners
May 8, 2026 03:25
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
This was referenced May 9, 2026
5 tasks
This was referenced May 15, 2026
This was referenced Jul 15, 2026
Collaborator
|
@HaiShaw [fused-ar-rms-per-group-quant] metrics={'accuracy': 0.953, 'invalid': 0.01, 'latency': 73.984, 'output_throughput': 2923.251} Qwen3.5-FP8 aiter AR-fusion (MI35x, parallel TP4)
|
Collaborator
|
#30940 merged |
Migrate the legacy parallel-getter calls in _forward_with_allreduce_fusion_quant_per_group to the get_parallel().<dim> read-through API, matching the sibling _forward_with_allreduce_fusion helper. Fixes the parallel-adoption ratchet gate (base-a-test-cpu). No behavior change.
Collaborator
Collaborator
|
cuda PR Test is clean , waiting for the last one AMD PR-Test : https://github.com/sgl-project/sglang/actions/runs/29728384583/job/88794722663?pr=24651 |
Collaborator
|
@HaiShaw |
chuyeh
added a commit
to chuyeh/sglang
that referenced
this pull request
Jul 29, 2026
pr-test-amd-rocm724.yml was branched from pr-test-amd-rocm720.yml before the kernel module reorganization, and being a separate file it does not inherit later template fixes. Carry over the two that diverged: - Point the jit_kernel and multimodal_gen path filters at sglang/kernels and test/registered/kernels (sgl-project#32072, sgl-project#32128). The old jit_kernel paths no longer exist, so those filters could never match and the jobs would be skipped in filtered mode without any error. - Split stage-c-test-large-8-gpu-amd-mi35x across 3 partitions instead of 2, matching sgl-project#24651. The suite grew, and two partitions risk exceeding the 60-minute timeout. Co-authored-by: Cursor <cursoragent@cursor.com>
Zhylkaaa
pushed a commit
to Zhylkaaa/sglang
that referenced
this pull request
Jul 29, 2026
…gl-project#24651) Co-authored-by: jacky.cheng <yichiche@amd.com> Co-authored-by: yctseng0211 <yctseng@amd.com> Co-authored-by: HAI <hixiao@gmail.com>
mqhc2020
added a commit
to mqhc2020/sglang
that referenced
this pull request
Aug 13, 2026
This was referenced Aug 22, 2026
2 tasks
This was referenced Aug 26, 2026
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
…gl-project#24651) Co-authored-by: jacky.cheng <yichiche@amd.com> Co-authored-by: yctseng0211 <yctseng@amd.com> Co-authored-by: HAI <hixiao@gmail.com>
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.


Co-author: @mqhc2020, @yichiche
Motivation
This PR adds a fused aiter path for the Qwen3.5 FP8 attention/GDN input normalization path on AMD. The baseline path around
prepare_attnruns all-reduce, RMSNorm, and per-group activation quant as separate work before the FP8 projection consumes(fp8, scale).The new path lets
LayerCommunicator.prepare_attnrequest fused all-reduce + RMSNorm + per-group FP8 quant. Standard attention receives(fp8, scale)directly forqkv_proj. GDN receives(bf16, fp8, scale)soin_proj_qkvzcan skip its internal activation quant whilein_proj_bastill reads the bf16 activation it needs.The fused-quant path is scoped to ROCm/aiter. The aiter single-kernel dispatch is gated to gfx95 / gfx950-class GPUs through
is_gfx95_supported(), and plain--enable-aiter-allreduce-fusionAR+RMSNorm behavior remains separate. If the fused-quant path is unavailable, callers fall back to fused AR+RMSNorm or the existing generic path.Modifications
quant:
tensor_model_parallel_fused_allreduce_rmsnorm_quant_per_group(...)GroupCoordinator.fused_allreduce_rmsnorm_quant_per_group(...)((fp8, scale), residual)for standard attention.((bf16, fp8, scale), residual)for GDN, where bf16 is required byin_proj_ba.LayerCommunicator.prepare_attnto prefer the fused-quant helper when_sglang_needs_allreduce_fusionis set and the layer opts in withenable_fused_ar_quant=True.keep_bf16=Falseand GDN withkeep_bf16=True.(bf16, fp8, scale)tuple without dequantizing fp8 back to bf16.SGLANG_DISABLE_FUSED_AR_QUANT=1as the operator opt-out for this quantized handoff while keeping the existing AR+RMSNorm fusion eligible.Fallback order:
The single-kernel dispatch is intentionally limited to ROCm + aiter + gfx95.
Accuracy Tests
GSM8K was run on Qwen3.5-397B-A17B-FP8 with TP=8 and
--enable-aiter-allreduce-fusion.python3 benchmark/gsm8k/bench_sglang.py --num-questions 1319 --parallel 1319 --num-shots 5 --port 9000python3 benchmark/gsm8k/bench_sglang.py --num-questions 1319 --parallel 1319 --num-shots 5 --port 9000The fused path is above the 0.94 accuracy gate used for this model.
Speed Tests and Profiling
Server command
SGLANG_USE_AITER=1 SGLANG_USE_AITER_UNIFIED_ATTN=1 \ python3 -m sglang.launch_server \ --model-path Qwen/Qwen3.5-397B-A17B-FP8 \ --trust-remote-code \ --model-loader-extra-config '{"enable_multithread_load": true}' \ --host 0.0.0.0 --port 30001 --tensor-parallel-size 4 \ --attention-backend aiter --kv-cache-dtype fp8_e4m3 --page-size 16 \ --chunked-prefill-size 8192 --mem-fraction-static 0.8 --watchdog-timeout 1200 \ --disable-radix-cache \ --enable-aiter-allreduce-fusionServing benchmark command
Case A: baseline without
--enable-aiter-allreduce-fusionCase B: with
--enable-aiter-allreduce-fusionImprovement formula:
(candidate - baseline) / baseline * 100.(baseline - candidate) / baseline * 100.Kernel-count profile, per decode pass on Qwen3.5-397B-A17B-FP8 / TP=8 with 60
decoder layers:
cross_device_reduce_*stage(plain AR)add_rmsnorm_quant_kernel(RMSNorm+add)dynamic_per_group_scaled_quant_kernelallreduce_fusion_kernel_1stage(AR+RMSNorm)allreduce_fusion_kernel_1stage_per_groupprepare_attnChecklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ✅ Run #29728384591
Latest PR Test (Extra): ❌ Run #29728384518