[AMD] support qlen>1 for aiter gluon path for Kimi K3 - #37601
Conversation
1157397 to
df4ada8
Compare
|
re-trigger ci due to Error: A major update has landed on `main`. All PRs must rebase onto the latest `main` before CI will run.
Error: Required base commit: `a5f07b1241fc` (your PR is `diverged` relative to this commit). |
|
NV and CPU test are passed. https://github.com/sgl-project/sglang/actions/runs/33998322033/job/101393878232?pr=37601 |
|
HIP/AITER gated |
|
Why was base-a failure https://github.com/sgl-project/sglang/actions/runs/34074956295/job/101599269921#step:15:1084 ignored here? |
|
Hi @mmangkad This base-a failure comes from stale unittest test/registered/attention/test_mla_gluon_h12_fp8.py introduced by #34647 which is renamed and replaced by test/registered/attention/test_aiter_gluon_h12_fp8.py ( but then rename behaviour tracking is lost after several rebasing to main. It was reverted by 511e75f Merge remote-tracking branch 'sgl/main' into gluon_dspark. This is unexpected. Thanks for dropping it #38259 |
…RK graph-capture fix, add measured cell numbers The mi350x/mi355x cells pinned lmsysorg/sglang-rocm:v0.5.18-rocm720-mi35x-20260903, which predates sgl-project#37601 (GroupCoordinator.broadcast -> PyNccl on HIP). On that image the DSPARK overlay aborts HIP graph capture at the DSpark draft TP sync, and the cell as generated also OOMs on the first 8k prefill chunk at --mem-fraction-static 0.85. Neither reproduces on v0.5.19-rocm720-mi35x-20260910: the unmodified cell captures the DSpark graphs and runs the cookbook 8192->1024 speed shape at c1/c16/c64 with zero scheduler exceptions on 8x MI350X. - kimi-k3.jsx, Kimi-K3.mdx: move the mi350x/mi355x image pin to 20260910 - kimi-k3-benchmarks.jsx: measured mi350x Unified/Balanced rows (mxfp4, spec dspark and none)
…RK graph-capture fix, add measured cell numbers The mi350x/mi355x cells pinned lmsysorg/sglang-rocm:v0.5.18-rocm720-mi35x-20260903, which predates sgl-project#37601 (GroupCoordinator.broadcast -> PyNccl on HIP). On that image the DSPARK overlay aborts HIP graph capture at the DSpark draft TP sync, and the cell as generated also OOMs on the first 8k prefill chunk at --mem-fraction-static 0.85. Neither reproduces on v0.5.19-rocm720-mi35x-20260910: the unmodified cell captures the DSpark graphs and runs the cookbook 8192->1024 speed shape at c1/c16/c64 with zero scheduler exceptions on 8x MI350X. - kimi-k3.jsx, Kimi-K3.mdx: move the mi350x/mi355x image pin to 20260910 - kimi-k3-benchmarks.jsx: measured mi350x Unified/Balanced rows (mxfp4, spec dspark and none)
…RK graph-capture fix, add measured cell numbers The mi350x/mi355x cells pinned lmsysorg/sglang-rocm:v0.5.18-rocm720-mi35x-20260903, which predates sgl-project#37601 (GroupCoordinator.broadcast -> PyNccl on HIP). On that image the DSPARK overlay aborts HIP graph capture at the DSpark draft TP sync, and the cell as generated also OOMs on the first 8k prefill chunk at --mem-fraction-static 0.85. Neither reproduces on v0.5.19-rocm720-mi35x-20260910: the unmodified cell captures the DSpark graphs and runs the cookbook 8192->1024 speed shape at c1/c16/c64 with zero scheduler exceptions on 8x MI350X. - kimi-k3.jsx, Kimi-K3.mdx: move the mi350x/mi355x image pin to 20260910 - kimi-k3-benchmarks.jsx: measured mi350x Unified/Balanced rows (mxfp4, spec dspark and none)
Motivation
This patch is to add qlen>1 support for aiter gluon path. #34647 only support qlen=1, for other cases, it will fall back to mla asm ps. If you specify the following configs,
SGLANG_AITER_HONOR_EXPLICIT_MEM_FRACTION=1 \ SGLANG_USE_AITER=1 \ SGLANG_AITER_K3_OPT=1 \ AITER_FLYDSL_FORCE=1 \ AITER_SITUV2_A8W4=1 \ SGLANG_AITER_MLA_GLUON=1 \ python3 -m sglang.launch_server --model-path /data-models/Kimi-K3 --trust-remote-code \ --tp-size 8 \ --prefill-attention-backend aiter \ --decode-attention-backend aiter \ --dtype bfloat16 \ --kv-cache-dtype fp8_e4m3 \ --cuda-graph-max-bs-decode 32 \ --max-mamba-cache-size 160 \ --mem-fraction-static 0.85 \ --reasoning-parser kimi_k3 \ --tool-call-parser kimi_k3 \ --speculative-algorithm DSPARK \ --speculative-draft-model-path /data-models/RadixArk-Kimi-K3-DSpark \ --speculative-dspark-block-size 7 \ --enable-linear-replayssm-spec \ --speculative-attention-mode decodethen will get the server crash:
[AITER] /sgl-workspace/aiter/aiter_meta/csrc/py_itfs_cu/asm_mla.cu:193 get_heuristic_kernel_mla: cannot get heuristic kernel! q_type:bf16 kv_type:fp8 gqa:16 ps:0 prefill:0 causal:1 qseqlen:8 lse:0 cprr:0 Fatal Python error: AbortedModifications
layers/attention/aiter_mla_gluon.py—mla_gluon_decode()introducesqlento decide whether q_nope and q_pe needs to be viewedlayers/attention/aiter_backend.py— removemax_q_len == 1gate to allow qlen >1 path being activated for dsparkdistributed/parallel_state.py— DSPARK's in-graph sampler use broadcast inside a CUDA graph, which is crashed by using torch api during cuda graph capture. Change it to pynccl.test/registered/attention/test_aiter_gluon_h12_fp8.py— renamed fromtest_mla_gluon_h12_fp8.pyto make the name more clear and rewritten (17 cases, mocked, no kernel invoked)Accuracy Tests
python benchmark/gsm8k/bench_sglang.py --num-shots 5 --num-questions 1300 --parallel 64 --port 8100
Accuracy: 0.953
Invalid: 0.001
Latency: 100.714 s
Output throughput: 1296.612 token/s
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #34074956295
Latest PR Test (Extra): ❌ Run #34074956107
Latest PR Test (AMD ROCm 7.2): ⏳ Run #34074956212