Repository navigation
[AMD][DSV4] feat: enable DSpark with fp8 unified_kv on gfx950 - #38901
Conversation
8fb3620 to
d7fd33f
Compare
Target keeps the fp8 nope + bf16 rope split, but the DSpark draft writers scatter bf16 rows, so the draft pool must not follow the env switch. Gate the layout on spec_algorithm.is_dspark() rather than is_draft_worker, which would also have pushed MTP/EAGLE NextN drafts back to one pool. Size the SWA ring as target fp8 + draft bf16 instead of inflating fp8 by (T+1)/T.
d7fd33f to
2bcdadc
Compare
|
hi @1am9trash , could you pls help to add a run-CI tag for this pr which supports DSpark + fp8 unified_kv? Sincerely thanks! |
|
/tag-and-rerun-ci |
|
@ch-wan @hnyls2002 @ispobock @1am9trash please help review. |
|
Re-validated on MI355X (gfx950, 8 GPUs, ROCm 7.2) after merging main at #40205. That fix is required here: without it every speculative arm dies in Model is DeepSeek-V4-Pro-0813, which bundles the DSpark draft, so no Common base for all four arms: Arms differ only in the tail: DP adds GSM8K, all 1319 questions, 5-shot, parallel 64:
All four came up, answered a completion request, and finished the sweep with zero invalid outputs. For reference, the no-speculation baseline measured while validating #40205 (same model and server flags, speculation off) was 0.9340. Unit tests on the same tree, 135 passed plus 32 subtests. |
|
PR Test Base, and other PR Test Extra look okay. |
Motivation
Follow-up to #37413. Incremental is only 1 commit, 6 files.
In #37413 we added fp8 two-pool unified_kv on gfx950 (
SGLANG_DSV4_UNIFIED_KV_FP8, 640 B/row, ~1.50× KV capacity) and measured it on MTP. We left DSpark as the next SPD path.--speculative-algorithm DSPARKplus the env builds a secondDeepSeekV4TokenToKVPoolfor the draft worker. That constructor used process-wideis_unified_kv_fp8(), and CUDA-graph capture died onkv.dtype == unified_kv.dtype. Same env, DSpark now comes up. Target decode / prefill /target_verifystay on the two-pool. MTP is unchanged.Modifications
AMD / HIP
unified_kv_tritononly. Default off. No change tois_unified_kv_fp8(),DSparkAttention, or the scatter kernel._build_dsv4_kv_poolselects the layout per pool:unified_fp8=is_unified_kv_fp8() and not (is_draft_worker and spec_algorithm.is_dspark()). Target follows the env (640 B two-pool). EAGLE/MTP draft still follows the env._fixed_swa_bytesbudgets the target fp8 ring plus the draft SWA ring at 1024 B/row (one layer for shipped drafts), not(T+1)/T * 640.bytes_per_full_tokenstill multiplies(T+1)/T— conservative; DSpark draft has no C4/C128. MTP inflation is the same as [AMD][DSV4] feat: enable fp8 two-pool unified_kv on gfx950 #37413.What this buys: KV capacity
Same CLI pair, Flash-DSpark, TP=8 DP=8 + dp-attention, gfx950. Differs only in
SGLANG_DSV4_UNIFIED_KV_FP8. Same 1.50× as #37413, on DSpark.Accuracy Tests
GSM8K, all 1319 questions. Flash-DSpark, TP=8 DP=8,
SGLANG_RAGGED_VERIFY_MODE=static, radix cache off. Pair differs only in the fp8 env. Capture including draft verify.Speed Tests and Profiling
Same protocol as #37413: MI355X, Flash-DSpark TP=8 DP=8, radix off,
bench_servingrandom. Pair differs only inSGLANG_DSV4_UNIFIED_KV_FP8.ttt ratiois fp8/bf16. DSpark accept 3.35–4.20, matched across arms.ISL/OSL: 8k / 1k
ISL/OSL: 68k / 200
No new decode kernel. A leftover decode gap is still the aiter reader, same as #37413. The 1.50× is KV capacity.
Reproducing this
MI355X,
SGLANG_HACK_FLASHMLA_BACKEND=unified_kv_triton. fp8 arm addsSGLANG_DSV4_UNIFIED_KV_FP8=1.1. Unit tests : 160 passed.
2. DSpark server — Flash-DSpark, TP=8 DP=8. This is the CLI the GSM8K and serving numbers were taken on. The bf16 arm is the same command without the last export.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ✅ Run #35463746142
Latest PR Test (Extra): ❌ Run #35463746035
Latest PR Test (AMD ROCm 10): ❌ Run #35463746148