Skip to content

[Config] [Tuning] Add Kimi-K3 gfx950 BF16 decode rows for qkv_a+gate a… - #7515

Merged
nsusanto merged 1 commit into
mainfrom
k3-decode-bf16-qkva-ctxkv-gfx950
Nov 9, 2026
Merged

nsusanto merged 1 commit into
mainfrom
k3-decode-bf16-qkva-ctxkv-gfx950

Conversation

@nsusanto

@nsusanto nsusanto commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

On gfx950, two Kimi-K3 decode GEMMs, qkv_a+gate and context_kv_proj, defaults to hipblast.

  • MLA fused qkv_a + output gate, [M,7168] x [7168,3648] (q_a 1536 + kv_a 576 + gate 1536), 24 calls per decode step.
  • DSpark draft context_kv_proj, [M,7168] x [7168,2880] (5 layers x kv_a 576), 1 call per decode step.

This PR adds 10 gfx950 FlyDSL hgemm rows: M = 8, 16, 32, 64, 128 for each shape.

M 3648x7168 default FlyDSL Δ 2880x7168 default FlyDSL Δ
8 13.45 11.52 -14.3% 12.25 10.05 -18.0%
16 14.03 11.51 -18.0% 13.16 10.29 -21.8%
32 18.02 12.19 -32.4% 17.18 10.96 -36.2%
64 20.98 13.84 -34.0% 19.67 12.25 -37.7%
128 26.71 18.59 -30.4% 23.32 17.02 -27.0%

| Kernel | Before (us) | After (us) | Δ |
|---|---|---|---|---|
| qkv_a+gate 3648x7168: hipBLASLt MT32x64x256 -> FlyDSL t64x128x64x4 | 19.68 | 15.68 | -20.3% |
| context_kv_proj 2880x7168: hipBLASLt MT32x64x256 -> FlyDSL t64x96x128x3 | 19.68 | 12.00 | -39.0% |
| Both GEMMs, 80-step total | 44.9 ms | 31.2 ms | -30.5% |

Test Plan

python3 op_tests/test_gemm_a16w16.py <args for the 10 shapes>

Server command:

VLLM_ROCM_USE_AITER=1 VLLM_ROCM_AITER_MLA_ASM_PADDING=asm VLLM_ROCM_USE_AITER_MOE_SITUV2=1 AITER_BF16_FP8_MOE_BOUND=0 \
AITER_FLYDSL_STAGE2_FP8=1 VLLM_ROCM_QUICK_REDUCE_QUANTIZATION=INT4 VLLM_ROCM_QUICK_REDUCE_MIN_SIZE_BYTES_MB=16 \
HSA_NO_SCRATCH_RECLAIM=1 SAFETENSORS_FAST_GPU=1 VLLM_ROCM_AITER_MLA_DCP_VERIFY=asm VLLM_USE_BREAKABLE_CUDAGRAPH=0 \
vllm serve /data/Kimi-K3 --served-model-name moonshotai/Kimi-K3 --trust-remote-code --tensor-parallel-size 8 \
  --decode-context-parallel-size 8 --dcp-comm-backend a2a --max-num-seqs 24 --max-num-batched-tokens 8192 \
  --kv-cache-dtype fp8 --enable-prefix-caching --attention-config '{"mla_prefill_backend":"ROCM_AITER_FA"}' \
  --speculative-config '{"model":"Inferact/Kimi-K3-DSpark","num_speculative_tokens":4,"method":"dspark","attention_backend":"ROCM_AITER_MLA","kv_cache_dtype":"fp8","draft_sample_method":"probabilistic","rejection_sample_method":"block"}' \
  --compilation-config '{"mode":3,"cudagraph_mode":"FULL_AND_PIECEWISE","max_cudagraph_capture_size":120,"custom_ops":["+fused_rms_norm_gated"]}'

Bench Command:

vllm bench serve --backend openai-chat --model moonshotai/Kimi-K3 --tokenizer /data/Kimi-K3 --trust-remote-code \
  --host localhost --port 8001 --endpoint /v1/chat/completions --dataset-name random \
  --random-input-len 1024 --random-output-len 1024 --random-range-ratio 0 --request-rate=inf --random-prefix-len 0 \
  --ignore-eos --num-prompts 64 --max-concurrency 32 --seed 45

Test Results

qkv_a+gate
before:
image
after:
image

context_kv_proj
before:
image
after:
image

@nsusanto
nsusanto requested a review from a team November 5, 2026 15:33
@github-actions

github-actions Bot commented Nov 5, 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 7515 --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.

@github-actions github-actions Bot changed the title [Config][Tuning] Add Kimi-K3 gfx950 BF16 decode rows for qkv_a+gate a… [Config] [Tuning] Add Kimi-K3 gfx950 BF16 decode rows for qkv_a+gate a… Nov 5, 2026
@github-actions github-actions Bot added the Config label Nov 5, 2026
@aiter-bot

aiter-bot commented Nov 5, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 8e33133dcfeb · 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.

@zufayu
zufayu requested a review from demonsan November 6, 2026 00:53
@nsusanto
nsusanto force-pushed the k3-decode-bf16-qkva-ctxkv-gfx950 branch from b3371e9 to 181ce4e Compare November 6, 2026 07:19
@nsusanto
nsusanto force-pushed the k3-decode-bf16-qkva-ctxkv-gfx950 branch from 181ce4e to 8e33133 Compare November 9, 2026 06:49
@nsusanto
nsusanto merged commit 972836e into main Nov 9, 2026
@nsusanto
nsusanto deleted the k3-decode-bf16-qkva-ctxkv-gfx950 branch November 9, 2026 15:13
ruanjm pushed a commit that referenced this pull request Nov 10, 2026
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.

4 participants