Repository navigation
[Perf] [AMD] Qwen3.8: AITER FlyDSL hc_mix for Qwen3.8 hyper-connections on gfx950 - #41880
Conversation
The lint job runs `pre-commit run --all-files`; isort and ruff-format failed on the files added/touched by this PR. Formatting only, no behavior change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Split hc_combine is a gate + apply pair: it gives small-M rows more CTAs than the one-CTA-per-row fused kernel, but costs a second dispatch. On gfx950 Qwen decode both halves sit at the ~4.2us launch floor, so the pair spends 8.3us on work the fused kernel does in one launch. Keep the split on elsewhere, where launches are cheaper and the split was tuned. Co-Authored-By: Claude <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
ROCm/aiter#5993 - was merged |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…hc-mix-flydsl # Conflicts: # python/sglang/srt/layers/hyperconnection.py # test/registered/kernels/ops/gemm/test_hc_mix_flydsl.py
…lang into pr/hc-mix-flydsl # Conflicts: # python/sglang/srt/layers/hyperconnection.py
This comment has been minimized.
This comment has been minimized.
|
Fixed, lint(just update branch), my code have guards to check, aiter kernel. |
|
Remove |
|
Hi, @amd-nprotaso I am a bit confused because the description does not seem to match the diff. Could we update the description to match the diff? Thanks. |
Yes. I removed ENV variables, to not increase number of parameters of sglang run, will modify PR description |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1am9trash
left a comment
There was a problem hiding this comment.
LGTM. The comments resolved.
Only impact amd code path.
The seam is validated on MI355X (gfx950) only, and the default AMD CI suite runs on MI300. Gate it with is_gfx95_supported(), as sgl-project#41880 gates its FlyDSL path on gfx950. Move the test to the MI35x suite and skip it on other GPUs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns on gfx950 (sgl-project#41880) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Thomas Wang <thomawan@amd.com>
Depends on ROCm/aiter. Without that AITER build this PR changes nothing: the path is gated on
aiter.ops.flydsl.hc_mixbeing importable.Motivation
GatedResidual's input mix is a low-rank gate over the[M, 4·2560]hyper-state. It runs in every Qwen3.8 decode step, and at decode sizes (M ≤ 16) it is bound by reading the weights.On gfx950, AITER's FlyDSL
hc_mixis 1.7–2.4x faster than the persistent Tritonfused_hc_mixSGLang uses today.Modifications
python/sglang/srt/layers/hc_mix_flydsl.py(new)flydsl_hc_mix_supported(...)accepts a call only when all of these hold:The checks are ordered so NVIDIA and disabled paths never import FlyDSL.
weight_cache_key(...)gives the packed-weight cache a key from the weights' data pointer and version.python/sglang/srt/layers/hyperconnection.pyGatedResidualtries FlyDSLhc_mixbeforefused_hc_mix.pack_hc_weights, cached on the layer, and repacked only if the weight key changes.Benchmark and tests
benchmark/kernels/bench_hc_mix_flydsl.pycompares FlyDSL, persistent Triton andtorch.compile. It uses CUDA-graph replay with rotating weights, so the weights are cold in L2.test/registered/kernels/ops/hyperconnection/test_hc_mix_flydsl.pyis registered in the AMDstage-b-test-1-gpu-small-amdsuite. It checks:GatedResidualdispatches to FlyDSL and matches the reference (atol=4e-3);Accuracy Tests
The FlyDSL output matches the float64 reference within
atol=4e-3, rtol=1e-2, in both the AITER op test and this PR's dispatch test.Speed Tests and Profiling
Command:
python benchmark/kernels/bench_hc_mix_flydsl.py --rows 1 2 4 8 16 --weights 64Setup: MI355X (gfx950), torch 2.11.0+rocm7.2. Time is the per-call median of CUDA-graph replays.
fused_hc_mix(µs)CI States
Latest PR Test (Base): ✅ Run #40173502184
Latest PR Test (Extra): ❌ Run #40173502156
Latest PR Test (AMD ROCm 10): ❌ Run #40173502206