Skip to content

[Config] [Tuning] Fill remaining Kimi-K3 bf16 GEMM shapes - #5139

Merged
zufayu merged 4 commits into
mainfrom
tune/kimi-k3-bf16-fill
Sep 1, 2026
Merged

zufayu merged 4 commits into
mainfrom
tune/kimi-k3-bf16-fill

Conversation

@XiaobingSuper

Copy link
Copy Markdown
Contributor

Follow-up to #5124.

#5124 tuned 51 new bf16 shapes, but --compare --update_improved only writes rows that beat the default by --min_improvement_pct (3%), so only 20 landed. The tuner had selected a best backend for all 51 — the remaining 31 were ties, not losses (the tuner's own profile CSV showed its winner ahead of the default by 0.4–1.9% while the compare benchmark flipped the sign by a comparable margin).

Every other shape group in these configs has near-full coverage (gfx950 old-shape coverage in this file is 127/137; the a8w8 half of #5124 is 85/85), so 20/51 was inconsistent.

Method: A/B each of the 31 shapes against default dispatch via gemm_a16w16_tune.py --run_config, single gfx950, 3 rounds of 100 iters after 20 warmup. Kept the 26 whose median and best-of-3 are both within 1% of default or better; dropped the 5 that measured slower.

Result: +26 rows, no existing row modified or removed (verified key-wise on [gfx,cu_num,M,N,K,bias,dtype,outdtype,scaleAB,bpreshuffle]). Largest gains at N=20480 K=7168 small M, +12~16% over default.

op_tests/tuning_tests/test_config_shape_collision.py and test_csv_validation.py: 30 passed, 37 subtests.

🤖 Generated with Claude Code

PR #5124 tuned 51 new bf16 shapes but --update_improved only wrote the
20 that beat the default by the 3% threshold, leaving the rest to fall
back to default dispatch. The tuner had picked a best backend for all
51; the other 31 were ties rather than losses.

A/B those 31 against default dispatch on a single gfx950, 3 rounds of
100 iters after 20 warmup, and add the 26 that are not slower:

  N=896   K=7168   M=1024,4096,16384,32768
  N=7168  K=35840  M=1,2,4,8,32,48,256,1024,2048,16384,32768
  N=20480 K=7168   M=1,2,8,32,64,128,256,512,1024,4096,4096

Largest gains are at N=20480 K=7168 small M (+12~16% over default).
5 shapes measured slower than default and are left untuned.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@XiaobingSuper
XiaobingSuper requested review from a team and a lite review from Copilot August 31, 2026 06:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

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; main branch always runs both MI35X and MI300X
multigpu 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: GPT-OSS-120B, DeepSeek-R1-0528, Kimi-K2.5
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 5139 --add-label <label>

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 opt this PR out.

@github-actions github-actions Bot changed the title [Tuning] Fill remaining Kimi-K3 bf16 GEMM shapes [Config] [Tuning] Fill remaining Kimi-K3 bf16 GEMM shapes Aug 31, 2026
Copilot AI review requested due to automatic review settings August 31, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The new shapes from #5124 and this PR were appended at the tail, so each
(N, K) group ended up split across several places in the file. Gather
the rows of every group this round touched into one contiguous block
sorted by M, at the position where the group first appears.

Row contents are unchanged - reordering only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@XiaobingSuper
XiaobingSuper force-pushed the tune/kimi-k3-bf16-fill branch from c37cdd7 to d18788e Compare August 31, 2026 07:40
Copilot AI review requested due to automatic review settings August 31, 2026 07:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

For M=16/128/512 at N=7168 K=35840 the tuner's best candidate is torch,
which is also what default dispatch runs, so the A/B measured the same
kernel on both sides and the sub-1% deltas were noise. Record them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 31, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

M=8192 at N=896 K=7168 and M=48 at N=20480 K=7168 measured 2.2% and 3.9%
slower with the tuner's pick (triton / flydsl) than with default
dispatch, so record what default already runs - torch - rather than a
slower kernel. Completes the 51 new shapes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 31, 2026 07:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@XiaobingSuper
XiaobingSuper requested a review from zufayu August 31, 2026 13:16
@zufayu
zufayu merged commit c3dd936 into main Sep 1, 2026
52 of 55 checks passed
@zufayu
zufayu deleted the tune/kimi-k3-bf16-fill branch September 1, 2026 02:48
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