Repository navigation
[Perf] [AMD] dsv4: FP4 indexer on aiter's row-group kernel for decode and target-verify (5/8) - #44006
Merged
HaiShaw merged 10 commits intoOct 16, 2026
Merged
Conversation
…ly scoring (sgl-project#43073) Squashed from sgl-project#43073 (head 60abf99). Conflict resolved against main 8afe107: deepseek_v4_backend_hip_radix.py import list keeps both _prefill_graph_max_seq_len (main sgl-project#42570) and _as_int_list (this PR).
…up kernel SGLANG_HIP_DSV4_C4_INDEXER_ROWGROUP=1 (default off) moves the DeepSeek-V4 C4 indexer's DECODE and DSpark TARGET_VERIFY scoring onto aiter's row-group FP4 MQA logits kernel (sgl-project#6145), through the sgl-project#43073 wrapper (rowgroup_paged_mqa_logits): * the backend builds the row-group decode workspace in the graph for decode (one row a request) and for a target-verify of >= C4_ROWGROUP_MIN_VERIFY_ROWS (64) rows (a request's draft rows one sequence, sharing each key load); such a verify skips the prefill schedule refresh. Smaller verifies, and verifies whose logits outgrow the prefill budget, keep the prefill kernel. * the block table is padded to one width for the server's life (rowgroup_table_columns over max(context_len, req_to_token width)), so the kernel compiles one variant per row grouping. * the indexer scores such a verify step like decode: one launch, unchunked. * a row-group workspace left stale by DP padding is rebuilt per row on the same table width instead of falling back to the schedule kernels. * off when the installed aiter has no row-group kernel (warning). The C4 index-K pool is unchanged: (pages, 1, 4, 64, 16) payload + (pages, 1, 4, 64) scale is aiter's page-64 row-group layout byte for byte. Tests: test_fp4_indexer_hip.py gains DSv4 decode / verify shapes (4 and 7 rows, ragged contexts, poisoned logits tail) against the schedule kernels, the FP4 reference and the top-k v2 (1024) selection, plus stale-workspace and in-graph replay cases. bench_dsv4_c4_indexer_rowgroup_hip.py measures the kernels and the per-step totals.
The row-group FP4 MQA logits kernel needs aiter >= ROCm/aiter#6145. - SGLANG_HIP_DSV41_INDEX_K_PAGE8 now falls back to the page-64 index-K pool with a warning when the installed aiter lacks it (it raised ImportError mid-serving before); the C4 decode/verify switch already checked. - test_fp4_indexer_hip.py: the row-group / page8 tests skip on such aiter.
…project#6145 SGLANG_HIP_FP4_INDEXER_ROWGROUP defaults on for HIP, so V4.1 low-ratio decode built row-group workspaces and raised ImportError on an aiter without the row-group kernel (e.g. the current e7d2453f pin). It now falls back to the schedule kernels with a warning there.
kkHuang-amd
requested review from
BBuf,
DarkSharpness,
Fridge003,
HaiShaw,
HydraQYH,
Qiaolin-Yu,
Ying1123,
alphabetc1,
celve,
hanming-lu,
hebiao064,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann,
yizhang2077 and
yuan-luo
as code owners
October 13, 2026 07:44
5 tasks
…stub backend test_dsv4_hip_bcg_metadata.py builds DeepseekV4HipRadixBackend with object.__new__ and sets the attributes init_forward_metadata_in_graph reads; it now also sets _fp4_c4_rowgroup_columns (None: row-group C4 indexer off).
This was referenced Oct 16, 2026
5 tasks
This was referenced Oct 18, 2026
4 of 5 tasks
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.
Motivation
The FP4 indexer re-reads each key per query row. aiter's row-group FP4 MQA logits kernel (ROCm/aiter#6145) shares key loads across a request's rows. This uses it for V4.1 low-ratio layers and, opt-in, for the DeepSeek-V4 C4 indexer. Includes #43073 (not merged yet).
Depends on: #43073 (open, included here); ROCm/aiter#6145 (in aiter main, needs the aiter pin bump in #44035).
Modifications
SGLANG_HIP_FP4_INDEXER_ROWGROUP, default on for HIP; page-8 index-K poolSGLANG_HIP_DSV41_INDEX_K_PAGE8, default off).SGLANG_HIP_DSV4_C4_INDEXER_ROWGROUP, default off).Accuracy Tests
GSM8K: main 0.953 -> 0.948 (default), 0.946-0.954 with
SGLANG_HIP_DSV4_C4_INDEXER_ROWGROUP=1(aiter 02575f1c3a).Speed Tests and Profiling
From #43073, DeepSeek-V4.1-Flash TP2, 68000 in / 200 out, total throughput: c1 +0.7%, c4 +1.2%, c16 +2.4%.
C4 rowgroup,
bench_dsv4_c4_indexer_rowgroup_hip.py, indexer time per step over 30 C4 layers incl. workspace, max context 65536: decode bs16 ctx 8K 197 -> 117 us (1.68x), bs64 ctx 64K 621 -> 525 us (1.18x); 4-row verify bs64 ctx 64K 1262 -> 1076 us (1.17x), bs16-32 ctx 8K about 5% slower.Co-authored-by: AMD-yanfeiwang 256076023+AMD-yanfeiwang@users.noreply.github.com
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #38719474783
Latest PR Test (Extra): ❌ Run #38719474489
Latest PR Test (AMD ROCm 10): ❌ Run #38719474736