Skip to content

[Config] gfx1250: grouped-MoE tiles for Kimi-K2 Thinking TP8 - #7456

Merged
zufayu merged 2 commits into
ROCm:mainfrom
mqhc2020:marv/decode_MoE_tuning_gfx1250
Nov 10, 2026
Merged

zufayu merged 2 commits into
ROCm:mainfrom
mqhc2020:marv/decode_MoE_tuning_gfx1250

Conversation

@mqhc2020

@mqhc2020 mqhc2020 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Kimi-K2 Thinking MXFP4 at TP8 on gfx1250 (96-CU partitions) had no tuned grouped-MoE rows, so every
batch size ran the default tile, which is sized for large prefill batches. Decode MoE was the largest
single gap against gfx950 in our profiles.

Changes

Adds one model config file with 12 rows for the Kimi-K2 TP8 MoE shape (FP4 weights and activations):

  • Decode, 1 to 128 tokens: smaller M tiles and a wider stage-2 tile; 1.16x to 1.52x per MoE call.
  • Prefill, 256 to 4096 tokens: 1.05x to 1.15x.
  • 2048 and 8192 tokens keep the default tile, which nothing in the sweep beat by 2% or more.

The file is picked up through the existing model_configs merge. No code changes.

Test Plan

  • Swept stage-1 and stage-2 tiles per token count on the production fused MoE path, against the
    default tile.
  • End to end: SGLang TP8 server with this file, random 8k/1k, concurrency 4 to 64, plus GSM8K
    (1319 questions, 5-shot) on the same server.

Test Result

Total token throughput, 8k/1k (tok/s):

Concurrency Before After Change
4 3775 4211 +11.5%
8 5792 6706 +15.8%
16 8879 8894 +0.2%
32 11943 12435 +4.1%
64 14774 14882 +0.7%

Geomean +6.3%. Median inter-token latency drops 6 to 12% at every concurrency (8.27 to 7.27 ms at
concurrency 4).

GSM8K: 0.933 vs 0.935 before (within noise).

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

Documentation

  • Docstrings updated
  • User guide updated
  • Performance guide updated
  • No documentation change is needed, with the reason stated below

Dependencies

  • No new third-party dependencies added
  • New dependencies are listed and justified below

Breaking Changes

PR Self-Review

Reviewed revision

dd04320

Behavior and intent

Kimi-K2 Thinking MXFP4 at TP8 on gfx1250 had no grouped-MoE row, so every batch used the default tile, which is sized for a large prefill. These 12 rows select a smaller stage-1 tile and a wider stage-2 tile for the TP8 shape. Decode tokens 1, 2, 4, 8, 16, 32, 64, and 128 are 1.16x to 1.52x per MoE call against that default (4 tokens: 48.65 µs to 31.91 µs). Prefill tokens 256, 512, 1024, and 4096 are 1.05x to 1.15x. Tokens 2048 and 8192 stay on the default tile; nothing in the sweep beat it by 2%.

Validation and unverified scope

Tile sweep on the production fused MoE path, gfx1250, 96 CUs per partition (MI450 DPX, ROCm 10.1). The us column is that measurement. End to end: SGLang TP8, --attention-backend aiter, random 8k/1k and 1k/1k, concurrency 4 to 64, plus GSM8K 1319 questions 5-shot on the same server. Results are the table above. Not run: MI250X, MI300X, expert-parallel, or a gfx1250 that reports 256 CUs. Standard PR CI does not build gfx1250, so these rows are not executed there.

PR-specific question

The rows are consumed only when every key matches: gfx=gfx1250, cu_num=96 (or any CU count, via the existing fallback, because no other row has this shape), token in {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 4096} after the usual power-of-two pad, model_dim=7168, inter_dim=256, expert=384, topk=8, ActivationType.Silu, bf16 activations, torch.float4_e2m1fn_x2 weights and activations, QuantType.per_1x32, ep_fused blank so both the plain and EP-scatter paths can use the tile. Expert-parallel lookup uses topk=-1 and a sharded expert count, so it does not hit these rows. A merge against current main finds zero duplicate shape keys, so every other model's row stays the one it selects today.

Changed op tests

None.

@github-actions

github-actions Bot commented Nov 4, 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 7456 --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

aiter-bot commented Nov 4, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision dd04320fd3fc · 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 — validation answer must name a command, result, or evidence link

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

@mqhc2020
mqhc2020 marked this pull request as ready for review November 6, 2026 12:41
@mqhc2020
mqhc2020 requested a review from a team November 6, 2026 12:41
@github-actions github-actions Bot changed the title [FlyDSL] [Config] gfx1250: grouped-MoE tiles for Kimi-K2 Thinking TP8 [Config] gfx1250: grouped-MoE tiles for Kimi-K2 Thinking TP8 Nov 6, 2026
@github-actions github-actions Bot added the Config label Nov 6, 2026
@zufayu
zufayu self-requested a review November 7, 2026 06:49
@zufayu zufayu self-assigned this Nov 7, 2026
@zufayu
zufayu merged commit ca0a00b into ROCm:main Nov 10, 2026
@mqhc2020
mqhc2020 deleted the marv/decode_MoE_tuning_gfx1250 branch November 11, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants