[ROCm][Perf] Optimize DSV4.1 K=512 decode top-k on gfx950 - #56743
Open
Fangzhou-Ai wants to merge 2 commits into
Open
Fangzhou-Ai wants to merge 2 commits into
Fangzhou-Ai wants to merge 2 commits into
Conversation
Fangzhou-Ai
requested review from
AndreasKaratzas,
WoosukKwon,
mgoin,
tjtanaa,
tlrmchlsmth,
yewentao256 and
zyongye
as code owners
September 14, 2026 02:27
Assisted-by: OpenAI Codex Signed-off-by: fai <fangzhouai@gmail.com>
Fangzhou-Ai
force-pushed
the
perf/rocm-dsv41-k512-topk
branch
from
September 14, 2026 02:49
d4e5e71 to
650bd5b
Compare
Member
|
/ci run |
|
✅ Triggered Buildkite CI #88739 for commit |
tjtanaa
reviewed
Sep 14, 2026
tjtanaa
reviewed
Sep 14, 2026
tjtanaa
reviewed
Sep 14, 2026
Assisted-by: OpenAI Codex Signed-off-by: fai <fangzhouai@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.
Purpose
Part of #56506.
DeepSeek-V4.1-Flash uses K=512 for decode indexer top-k, which misses the
existing gfx950 tuning and falls back to the generic 10-split kernel. Add a
ROCm/gfx950-only K=512 path for up to 384 rows and 1M columns. It selects
active splits from device sequence lengths so FULL graph replay remains valid,
reduces masked
-infhistogram contention, and uses a smaller final sort whenpossible. Other architectures, K values, strides, and shapes keep the existing
path.
This PR contains no multistream CSA, scheduler, or queue-management changes.
Results
speculative tokens 1-6, context 10K/50K/100K/200K/500K/1M, compression
ratios 1/2, and dense/masked logits.
Representative CR1 masked decode results from the warm matrix:
2.291x geometric-mean GPU busy-time speedup.
candidate, with no invalid or truncated answers. Both arms passed 10K and
100K token retrieval checks.
change, so this PR makes no serving-speed claim.
Validation
cmake --build dsv41_rocm_bench/topk/pr-cmake-build \ --target _C_stable_libtorch -j16 HIP_VISIBLE_DEVICES=3 GPU_MAX_HW_QUEUES=4 .venv/bin/python -m pytest \ tests/kernels/test_top_k_per_row.py \ -k 'gfx950_long_c4a or gfx950_k512 or aiter_c4a' -v .venv/bin/pre-commit run --files \ csrc/libtorch_stable/sampler.cu \ vllm/v1/attention/ops/rocm_aiter_mla_sparse.py \ tests/kernels/test_top_k_per_row.pyThe build passed, all 27 focused GPU tests passed, and scoped pre-commit passed.
This does not duplicate #54682, which is a MiniMax-M3 Triton selector, #50470,
which dispatches a separate sparse-indexer path to AITER, or #56628, which
optimizes the adjacent candidate mask.
OpenAI Codex assisted with implementation, benchmarks, tests, and analysis.