Skip to content

[Perf] DeepSeek-V4.1-Flash TP2 decode: indexer top-k split gate and router GEMM row - #7624

Merged
valarLip merged 1 commit into
ROCm:mainfrom
yhl-amd:hyi/dsv41-tp2-decode-topk-router
Nov 8, 2026
Merged

valarLip merged 1 commit into
ROCm:mainfrom
yhl-amd:hyi/dsv41-tp2-decode-topk-router

Conversation

@yhl-amd

@yhl-amd yhl-amd commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

At DeepSeek-V4.1-Flash TP2 decode with speculative decoding, each step carries several rows a request, so mid-size decode batches already exceed two gates that were set for smaller row counts:

  • The FlyDSL decode top-k gate for stable selection over the widest index planes sends these batches to the one-block radix kernel, which runs each long row on a single CTA and leaves most CUs idle.
  • The gfx950 router GEMM row of the largest decode bucket, which the bigger batches pad to, was not the fastest candidate.

Technical Details

  • aiter/ops/topk.py: _FLYDSL_TOPK_DECODE_GATES for gfx950, stable, widest planes: the split decode top-k now covers twice as many rows. The parts heuristic (topk_per_row_decode_parts) already caps rows x parts at the CU count, so past the new gate the one-block kernel is still chosen.
  • aiter/configs/model_configs/dsv41_bf16_tuned_gemm.csv: re-tuned gfx950 router GEMM row of the largest decode bucket with gemm_a16w16_tune.py, FlyDSL candidates, split-K enabled.
  • No kernel, API or environment-variable change.

Test Plan

  • Top-k: indexer inputs dumped from a live DeepSeek-V4.1-Flash TP2 serving run (packed rows, real scores), the old and new gate through the public top_k_per_row_decode, CUDA graph replay; outputs compared bit for bit.
  • Router GEMM: aiter tuner output for the row, error ratio within the tuner's threshold.
  • End to end: DeepSeek-V4.1-Flash, TP2, DSpark, FP8 KV, agentic-trace serving benchmark, old vs new on the same image, two runs side by side on swapped GPU pairs.

Test Result

  • Top-k: identical indices; the split kernel is faster for the row counts the new gate adds; unchanged elsewhere.
  • Router GEMM: faster than the previous row for the bucket.
  • End to end: interactivity higher in both runs, throughput unchanged.

🤖 Generated with Claude Code

…ate and router GEMM row

- aiter/ops/topk.py: on gfx950, stable selection over the widest index
  planes keeps the split decode top-k for twice as many rows before falling
  back to the one-block radix kernel. Past the old gate that kernel ran each
  long row on a single CTA; the split kernel stays faster until rows x parts
  exceeds the CU count, which the existing parts heuristic already bounds.
- dsv41_bf16_tuned_gemm.csv: re-tuned gfx950 router GEMM row for the largest
  decode bucket, which the bigger decode batches pad to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@yhl-amd
yhl-amd requested a review from a team November 8, 2026 11:28
@github-actions github-actions Bot changed the title [Config] [Perf] DeepSeek-V4.1-Flash TP2 decode: indexer top-k split gate and router GEMM row [Perf] DeepSeek-V4.1-Flash TP2 decode: indexer top-k split gate and router GEMM row Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter op tests (gfx942 + gfx950)
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the gfx1201 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7624 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 1c99cf53b9af · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. Which exact workload keys consume these configuration changes, and what evidence shows that unrelated shapes keep their previous selection?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — missing ### Reviewed revision in the PR description
  • FAIL — missing ### Behavior and intent in the PR description
  • FAIL — missing ### Validation and unverified scope in the PR description
  • FAIL — missing ### PR-specific question in the PR description
  • FAIL — missing ### Changed op tests in the PR description
  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA
  • FAIL — Behavior and intent has no substantive answer
  • FAIL — Validation and unverified scope has no substantive answer
  • FAIL — PR-specific question has no substantive answer

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@valarLip
valarLip merged commit d356386 into ROCm:main Nov 8, 2026
AndreasKaratzas added a commit to AndreasKaratzas/aiter that referenced this pull request Nov 8, 2026
Resolve aiter/configs/model_configs/dsv41_bf16_tuned_gemm.csv after ROCm#7624.
The gfx950 128x384x5120 row changed on both sides. Take the row from main.
With the fp32 partial reduction of this branch, its tile is exact and
deterministic, and it is faster than the row of this branch.

Co-authored-by: Claude <[email protected]>
Signed-off-by: Andreas Karatzas <[email protected]>
ruanjm pushed a commit that referenced this pull request Nov 10, 2026
…ate and router GEMM row (#7624)

- aiter/ops/topk.py: on gfx950, stable selection over the widest index
  planes keeps the split decode top-k for twice as many rows before falling
  back to the one-block radix kernel. Past the old gate that kernel ran each
  long row on a single CTA; the split kernel stays faster until rows x parts
  exceeds the CU count, which the existing parts heuristic already bounds.
- dsv41_bf16_tuned_gemm.csv: re-tuned gfx950 router GEMM row for the largest
  decode bucket, which the bigger decode batches pad to.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants