Skip to content

[Config] Tune seven gfx1250 K3 TP1 DSpark rows - #8672

Open
ZLkanyo009 wants to merge 2 commits into
ROCm:mainfrom
ZLkanyo009:tune/kimi-k3-tp1-dspark-nine-20261125
Open

ZLkanyo009 wants to merge 2 commits into
ROCm:mainfrom
ZLkanyo009:tune/kimi-k3-tp1-dspark-nine-20261125

Conversation

@ZLkanyo009

@ZLkanyo009 ZLkanyo009 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Tune seven Kimi K3 TP1 DSpark MXFP8 model-table rows on gfx1250/CU256. The final change is one CSV file: six additions and the existing q_b M256 replacement, with blank measurement cells and all unrelated rows preserved. It adds no kernel implementation or runtime guard.

Operator M N K Kernel ID
down 64 7168 14336 130
down 256 7168 14336 1112
gate_up 64 28672 7168 132
gate_up 128 28672 7168 1112
o_proj 64 7168 8192 130
o_proj 256 7168 8192 1112
q_b 256 12288 1536 210

The pinned preparation parent is main d0b5acd3fba19f07b2db33851e1517cc72bbb557. These IDs and exact names already exist in its 1,231-entry catalog; the underfilled compute-tile guard from merged #8566 is present. The separate q_b M128 expanded-catalog candidate remains excluded pending #8246. The dev integration #8635 is a separate track; this PR has not been rebased onto newer main.

One proposed gate_up M256 row was removed after paired main measurements found a regression at its lower bucket boundary. The row was selected for every M129-256. At M129 it replaced the native compute WMMA 128x256x128 cluster 2x4 with cluster 1x4: 25.853 to 31.363 us, a 20.75% paired latency increase; one independent confirmation measured 25.719 to 31.501 us, a 22.69% increase. Both runs passed the stated numerical checks. The original M256 point showed a 5.37% reduction with maximum A/A drift 2.75%; that potential benefit is also deferred so the entire M129-256 range keeps its native fallback.

Follow-up e64036cbc624f6d4052ad41d6d6e331dff5c3fab deletes exactly that one row from measured candidate 36f572cc1eb0170f290bd2a9afcb40111b16a495. Two isolated no-device native CPU processes verified all 8,948 source files per arm, the complete 4,215/4,221-key parent/corrected default merges, and 142 shapes per arm. Every integer M129-256 now selects the identical parent fallback; M128/M257 and the seven retained rows preserve their previous selections. Both processes exited 0 and their exact containers were removed. This validates the configuration restoration; it is not a fresh GPU or performance run of the follow-up commit. The runtime files are unchanged.

Public GPU correctness was validated on the preceding main candidate 36f572cc1eb0170f290bd2a9afcb40111b16a495: 48 dtype cases, 96 allocating/out forms and 192 complete-output eager/NaN-poisoned graph checks across BF16 and FP16 outputs. Inputs and weights were FP8 E4M3 with E8M0 scales. With rtol=atol 0.01 and allowed mismatch fraction <=5%, maxima were 1.043701171875% for BF16 and 0.9930499188311688% for FP16. These are nonzero tolerance mismatches, not bit-exact equality. The fixed native1120 image, FlyDSL 0.5.3, gfx1250/CU256 and NUMA balancing 0 were used; all 14 exact GPU containers exited 0 and were removed. These historical GPU checks retain that commit attribution. The restored M129/M256 parent-selected complete backends also passed the full-output BF16 checks in the paired measurements; no complete public BF16/FP16 matrix was rerun after deleting the row.

The retained selections have the following paired main evidence, collected on 36f572cc1eb0170f290bd2a9afcb40111b16a495 before the one-row deletion. Their CSV entries and runtime implementation are unchanged in the follow-up. Both arms execute complete explicit backends in the same candidate-source process; separate native CPU default lookups bind the choices of pinned parent d0b5acd3fba19f07b2db33851e1517cc72bbb557 and the candidate. This is a same-source complete-backend comparison, not two branch executions, public-default dispatch timing or model/E2E timing.

Operator M / N / K Parent-selected backend, us Candidate-selected backend, us Paired reduction Max A/A drift
down 33 / 7168 / 14336 201.926 34.166 83.11% 0.49%
down 64 / 7168 / 14336 199.048 34.599 82.61% 0.27%
down 129 / 7168 / 14336 41.538 32.365 22.14% 0.43%
down 256 / 7168 / 14336 48.381 25.969 46.35% 0.60%
gate_up 33 / 28672 / 7168 104.947 19.669 81.20% 0.49%
gate_up 64 / 28672 / 7168 104.948 20.088 80.69% 0.31%
gate_up 128 / 28672 / 7168 23.932 20.802 12.68% 1.51%
o_proj 33 / 7168 / 8192 115.207 20.847 81.89% 0.21%
o_proj 64 / 7168 / 8192 114.800 21.262 81.49% 0.26%
o_proj 129 / 7168 / 8192 24.299 18.545 23.69% 0.54%
o_proj 256 / 7168 / 8192 27.825 16.044 42.37% 0.48%
q_b 129 / 12288 / 1536 5.951 5.625 5.42% 0.75%
q_b 256 / 12288 / 1536 6.051 5.637 6.55% 3.57%

Each case used FP8 inputs, BF16 output, warm activations and at least 2.2 GB of distinct rotating weight/scale storage. Quantization and reference generation were outside timing. Seven ABBA paired rounds and seven A/A null rounds used GPU events around graphs of complete calls. Latency columns are medians of 14 samples per arm; reductions are medians of seven within-round comparisons. These are descriptive exact-M observations, not a confidence interval, measured cache-cold guarantee or unmeasured bucket-wide speedup. The q_b M256 result has the larger 3.57% maximum A/A drift shown above.

All original 15 timing cases passed 60 complete-output endpoint checks, with maximum mismatch fraction 1.06449537% under the same .01/.01 and <=5% contract. The separate M129 confirmation passed four further checks. These numerical/protocol passes do not waive its measured performance regression, which is why the row is absent from this PR. All original timings, including the removed row and its confirmation, remain retained at their measured commit.

The completed seven-row change is ready for review. No model/E2E improvement or newer-main validation is claimed.

Related: https://github.com/wuhuikx/LLM-Booster/issues/710

Add seven rows for DSpark gate_up, o_proj and down and replace the
q_b M256 selection. All selected IDs and names exist in the main
catalog, and exact shapes pass its kernel_fits_shape checks.

Keep the q_b M128 wide-cluster candidate separate because it requires
the unmerged ROCm#8246 catalog and implementation. Preserve all other
model rows and leave measurement cells blank.

The candidates have paired performance and BF16/FP16 public validation
on the k3-455-dev integration. The distinct main implementation still
requires native public correctness and performance validation.

Refs: wuhuikx/LLM-Booster#710
Signed-off-by: Ling Zhang <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

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

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
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 Radeon R9700 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 8672 --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.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@ZLkanyo009 ZLkanyo009 changed the title [Config][Perf] Tune eight gfx1250 K3 TP1 DSpark MXFP8 GEMM rows [Config] Tune seven gfx1250 K3 TP1 DSpark rows Nov 25, 2026
@ZLkanyo009
ZLkanyo009 marked this pull request as ready for review November 25, 2026 13:44
@ZLkanyo009
ZLkanyo009 requested a review from a team November 25, 2026 13:44
@aiter-bot

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision e64036cbc624 · 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.

@ZLkanyo009

Copy link
Copy Markdown
Contributor Author

Superseded as the review entry for this tuning batch by #8729 (head 0cbdcc3ea501d0cf2c957af7e5c65dea51147add). The consolidated main PR includes this PR's final changes at e64036cbc624f6d4052ad41d6d6e331dff5c3fab and links the original validation and review history. Its CPU composition checks preserve the final configuration choices; the original GPU results keep their measured-source and protocol limits.

Please use the consolidated PR for review of this batch. This source PR remains open for provenance; no merge or closure is performed here, and the two should not be merged independently.

@demonsan

Copy link
Copy Markdown
Contributor

Advisory review with the repo's .claude/skills/review-pr skill, run locally against head e64036cbc. All 8 gates passed and an independent reader refuted each finding before it was kept. [verified] means the finding was checked against the code; [inferred] means it is a question for the author to confirm.

Verdict: ⚠️ NEEDS WORK

  1. ⚠️ [verified] aiter/configs/model_configs/kimik3_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv:295 and lines 305–310 leave us, tflops, bw, and errRatio blank (unlike all 4,522 existing rows in this table family), so duplicate-shape ranking via sort_values("us") in aiter/jit/core.py:665–670 and aiter/ops/gemm_op_a8w8.py:1388–1396 places these NaN rows last and lets any future colliding row with a finite us silently evict them regardless of speed. Author must populate the measured us/tflops/bw/errRatio cells or confirm that blank telemetry cells are intentional for auto-dedup.
  2. 📝 [verified] Author comment marks PR [Config] Tune seven gfx1250 K3 TP1 DSpark rows #8672 superseded by consolidated PR [FlyDSL] [Perf] Consolidate Kimi K3 TP1 GEMM tuning on gfx1250 #8729 (which already includes this head's edits to aiter/configs/model_configs/kimik3_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv) and states the two must not be merged independently, so merging here would duplicate or conflict with [FlyDSL] [Perf] Consolidate Kimi K3 TP1 GEMM tuning on gfx1250 #8729. Question for the author: to close [Config] Tune seven gfx1250 K3 TP1 DSpark rows #8672 and direct review to [FlyDSL] [Perf] Consolidate Kimi K3 TP1 GEMM tuning on gfx1250 #8729.

@demonsan

Copy link
Copy Markdown
Contributor

This PR's rows were folded into #8729 ("Consolidate Kimi K3 TP1 GEMM tuning on gfx1250", still open), as noted in your earlier comment. Please close this PR so the same kimik3_a8w8_blockscale_mxscale_bpreshuffle_tuned_gemm.csv edits are reviewed only once, and carry the fixes from my previous comment over to #8729: fill us / tflops / bw / errRatio for every row, and give per-row speedups from repeated rounds.

@demonsan

demonsan commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@aiter-bot review

@aiter-bot

Copy link
Copy Markdown

aiter-bot — the box reviews one PR at a time and is 31 deep right now (roughly 8.9 h of work ahead).

This request was not queued: a job that waits more than 24 h is cancelled silently, so saying no now is better than losing it later.

Re-comment @aiter-bot review once the queue is shorter.

@demonsan demonsan 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.

LGTM

This branch has not been deployed

No deployments
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