Skip to content

[Triton/Gluon] [CI] Configs per CU count: <arch>/<cu_num>cu/ trees - #7105

Merged
azaidy merged 4 commits into
mainfrom
satya/gemm_config_cu_dir
Oct 29, 2026
Merged

azaidy merged 4 commits into
mainfrom
satya/gemm_config_cu_dir

Conversation

@Boss2002n

@Boss2002n Boss2002n commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

A gfx1250 config tuned on one partition size is not right for another size, and the config tree keys on the arch only. This PR adds a config tree per CU count for every config family and leaves the default tree as it is.

@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 (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 7105 --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.

@Boss2002n Boss2002n changed the title [Triton/Gluon] [Config] GEMM configs per CU count: <arch>/<cu_num>cu/ trees [Triton/Gluon] [Config] Configs per CU count: <arch>/<cu_num>cu/ trees Oct 28, 2026
@Boss2002n
Boss2002n marked this pull request as ready for review October 28, 2026 20:15
@Boss2002n
Boss2002n requested review from a team and a balanced review from Copilot October 28, 2026 20:15
@github-actions github-actions Bot changed the title [Triton/Gluon] [Config] Configs per CU count: <arch>/<cu_num>cu/ trees [Triton/Gluon] [CI] Configs per CU count: <arch>/<cu_num>cu/ trees Oct 28, 2026

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.

🟡 Changes recommended

CU-tree handling can select or install incorrect configs due to a probe race, cross-tree baseline reuse, and incomplete loader isolation, while targeted tests are missing.

5 open issues
What changed in this PR

This PR adds CU-count-specific config trees so Triton and Gluon operations can use settings tuned for different GPU partition sizes while preserving the existing plain-tree fallback.

Changes:

  • Add CU-aware config resolution and GEMM loader parameters.
  • Add --cu-dir tuning support, CU-tagged results, and resume checks.
  • Update CI test selection and document the new config layout.
File Description
aiter/​ops/​triton/​utils/​tuned_config_utils.py Use the shared CU-aware resolver.
aiter/​ops/​triton/​utils/​gemm_config_utils.py Pass CU scope through GEMM config loading.
aiter/​ops/​triton/​utils/​config_utils.py Detect CU count and select config trees.
aiter/​ops/​triton/​utils/​_triton/​tuning/​write_best_configs.py Filter results by CU count and install into the selected tree.
aiter/​ops/​triton/​utils/​_triton/​tuning/​verify_configs.py Display the device CU count during verification.
aiter/​ops/​triton/​utils/​_triton/​tuning/​sweep_configs.py Forward CU scope and check resume compatibility.
aiter/​ops/​triton/​utils/​_triton/​tuning/​space.py Build tuning spaces from the selected tree.
aiter/​ops/​triton/​utils/​_triton/​tuning/​README.md Document CU-specific tuning and resume behavior.
aiter/​ops/​triton/​utils/​_triton/​tuning/​kernels.py Resolve baselines, seeds, and bounds by tree scope.
aiter/​ops/​triton/​utils/​_triton/​tuning/​harness.py Record CU metadata and benchmark scoped baselines.
aiter/​ops/​triton/​utils/​_triton/​tuning/​AGENTS.md Update tuning contracts and validation instructions.
aiter/​ops/​triton/​utils/​_triton/​tuning/​_utils.py Filter recorded candidates by CU count.
aiter/​ops/​triton/​README.md Introduce the CU-specific config layout.
aiter/​ops/​triton/​configs/​AGENTS.md Define CU-tree selection and isolation rules.
.github/​scripts/​select_triton_tests.py Recognize CU-tree paths in test selection.
.github/​instructions/​aiter-ops-triton.instructions.md Align review guidance with CU-tree conventions.

Review effort: Balanced

Comment thread aiter/ops/triton/configs/AGENTS.md Resolved
Comment thread aiter/ops/triton/utils/config_utils.py Resolved
Comment thread aiter/ops/triton/utils/config_utils.py Resolved
Comment thread aiter/ops/triton/utils/config_utils.py Resolved
@zufayu
zufayu requested review from a team and Dewei-Wang-sh October 29, 2026 01:02
@Boss2002n Boss2002n assigned Boss2002n and unassigned Dewei-Wang-sh Oct 29, 2026

@azaidy azaidy 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!

@azaidy
azaidy merged commit 42c319b into main Oct 29, 2026
115 of 125 checks passed
@azaidy
azaidy deleted the satya/gemm_config_cu_dir branch October 29, 2026 03:33
azaidy pushed a commit that referenced this pull request Oct 29, 2026
…6573)

* [Triton/Gluon] [Config] gfx1250 Gluon GEMM configs for Kimi-K2 TP8

Kimi-K2 at TP8 has dense bf16 GEMM shapes and MLA-absorb batched GEMM
shapes with no gfx1250 Gluon config, so they run on DEFAULT.json:

- gemm_a16w16 (N, K): q_b (1536, 1536), kv_b (2048, 512), shared expert
  down (7168, 256), o_proj (7168, 1024), and the layer-0 dense MLP
  (4608, 7168) and (7168, 2304).
- batched_gemm_a16w16 B=8: absorb q (N=512, K=128) and absorb v
  (N=128, K=512), 8 heads per GPU at TP8.

Each M bucket was picked by CUDA-graph timing on MI455X over the configs
already shipped for gfx1250 in neighbouring buckets; buckets with no
faster candidate keep the DEFAULT.json config.

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Retune the Kimi-K2 TP8 gfx1250 configs over the full search space

Retune the eight Kimi-K2 TP8 shapes of this PR with sweep_configs.py
(--backend gluon) over the full gfx1250 Gluon search space, one sweep
per M bucket from 1 to 128, on MI450 in DPX mode (96 CUs per partition):

- every entry now carries waves_per_eu, as DEFAULT.json does;
- the files are DEFAULT_FALLBACK, so the buckets from 256 to 4096 come
  from DEFAULT.json; M_LEQ_8192 keeps the first version's config, with
  the waves_per_eu the wrapper used for it (0).

Cold-L2 CUDA-graph time against DEFAULT.json (main has no file for these
shapes), M = 4 / 16 / 64:

  q_b      (1536, 1536)  1.04 / 1.01 / 1.10x
  o_proj   (7168, 1024)  1.59 / 1.34 / 1.86x
  sh_down  (7168,  256)  1.90 / 1.53 / 1.11x
  l0_gu    (4608, 7168)  1.30 / 1.21 / 1.48x
  l0_down  (7168, 2304)  1.59 / 1.57 / 1.71x
  kv_b     (2048,  512)  1.02 / 1.03 / 1.03x
  bmm_q    B=8 (512, 128)  1.46 / 1.37 / 2.36x
  bmm_v    B=8 (128, 512)  1.25 / 1.28 / 1.25x

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Retune the gfx1250 qa_kva, router and shared-expert gate_up configs for Kimi-K2 TP8

Kimi-K2 TP8 also runs three shapes that already have gfx1250 Gluon files
(from the DeepSeek-R1 and router configs): fused_qkv_a_proj_with_mqa
(N=2112, K=7168), the MoE router (N=384, K=7168) and the shared-expert
gate_up (N=512, K=7168). Retune their M buckets from 1 to 128 the same
way, keeping every larger bucket; the kept buckets get the waves_per_eu
the wrapper used for them (0).

Cold-L2 CUDA-graph time against the current files, M = 4 / 16 / 64:

  qa_kva   (2112, 7168)  1.56 / 1.81 / 1.50x
  router   ( 384, 7168)  1.09 / 1.17 / 1.06x
  sh_gu    ( 512, 7168)  1.10 / 1.25 / 1.67x

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Move the new Kimi-K2 Gluon GEMM configs to gfx1250/96cu/

* [Triton/Gluon] [Config] Keep the CU-agnostic gfx1250 GEMM configs, put the 96-CU retunes in 96cu/

The fused_qkv_a (2112, 7168), router (384, 7168) and shared expert gate_up
(512, 7168) retunes move to configs/gfx1250/96cu/; the CU-agnostic files
are back to their main contents.

* [Triton/Gluon] [Config] Keep main's configs where the 96-CU retune is not faster

The 96-CU copies of the N=2112, 384 and 512 (K=7168) files take the "any"
bucket (M > 8192) from the CU-agnostic file again, with waves_per_eu 0,
instead of DEFAULT.json's.

q_b (N=1536, K=1536) M_LEQ_1, M_LEQ_4 and M_LEQ_16 and shared expert down
(N=7168, K=256) M_LEQ_64 go back to the DEFAULT.json entries main uses: in
tgemm.mm on MI450 (DPX, 96 CUs) the retuned ones were 4-11% slower.

* [Triton/Gluon] [Config] Add DEFAULT.json to the gfx1250 96-CU Gluon GEMM trees

#7105 reads a <cu_num>cu/ tree only when it has a DEFAULT.json, so
without one the ten Kimi-K2 files in 96cu/gluon/gemm/gemm_a16w16 and
96cu/gluon/gemm/batched_gemm_a16w16 are never read.

Both DEFAULT.json files are byte-identical copies of the ones in
gfx1250/gluon/gemm/, as configs/AGENTS.md asks for a new tree.

Signed-off-by: Yang, JiaRong <[email protected]>

---------

Signed-off-by: Yang, JiaRong <[email protected]>
solinzby1 pushed a commit that referenced this pull request Nov 2, 2026
…6573)

* [Triton/Gluon] [Config] gfx1250 Gluon GEMM configs for Kimi-K2 TP8

Kimi-K2 at TP8 has dense bf16 GEMM shapes and MLA-absorb batched GEMM
shapes with no gfx1250 Gluon config, so they run on DEFAULT.json:

- gemm_a16w16 (N, K): q_b (1536, 1536), kv_b (2048, 512), shared expert
  down (7168, 256), o_proj (7168, 1024), and the layer-0 dense MLP
  (4608, 7168) and (7168, 2304).
- batched_gemm_a16w16 B=8: absorb q (N=512, K=128) and absorb v
  (N=128, K=512), 8 heads per GPU at TP8.

Each M bucket was picked by CUDA-graph timing on MI455X over the configs
already shipped for gfx1250 in neighbouring buckets; buckets with no
faster candidate keep the DEFAULT.json config.

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Retune the Kimi-K2 TP8 gfx1250 configs over the full search space

Retune the eight Kimi-K2 TP8 shapes of this PR with sweep_configs.py
(--backend gluon) over the full gfx1250 Gluon search space, one sweep
per M bucket from 1 to 128, on MI450 in DPX mode (96 CUs per partition):

- every entry now carries waves_per_eu, as DEFAULT.json does;
- the files are DEFAULT_FALLBACK, so the buckets from 256 to 4096 come
  from DEFAULT.json; M_LEQ_8192 keeps the first version's config, with
  the waves_per_eu the wrapper used for it (0).

Cold-L2 CUDA-graph time against DEFAULT.json (main has no file for these
shapes), M = 4 / 16 / 64:

  q_b      (1536, 1536)  1.04 / 1.01 / 1.10x
  o_proj   (7168, 1024)  1.59 / 1.34 / 1.86x
  sh_down  (7168,  256)  1.90 / 1.53 / 1.11x
  l0_gu    (4608, 7168)  1.30 / 1.21 / 1.48x
  l0_down  (7168, 2304)  1.59 / 1.57 / 1.71x
  kv_b     (2048,  512)  1.02 / 1.03 / 1.03x
  bmm_q    B=8 (512, 128)  1.46 / 1.37 / 2.36x
  bmm_v    B=8 (128, 512)  1.25 / 1.28 / 1.25x

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Retune the gfx1250 qa_kva, router and shared-expert gate_up configs for Kimi-K2 TP8

Kimi-K2 TP8 also runs three shapes that already have gfx1250 Gluon files
(from the DeepSeek-R1 and router configs): fused_qkv_a_proj_with_mqa
(N=2112, K=7168), the MoE router (N=384, K=7168) and the shared-expert
gate_up (N=512, K=7168). Retune their M buckets from 1 to 128 the same
way, keeping every larger bucket; the kept buckets get the waves_per_eu
the wrapper used for them (0).

Cold-L2 CUDA-graph time against the current files, M = 4 / 16 / 64:

  qa_kva   (2112, 7168)  1.56 / 1.81 / 1.50x
  router   ( 384, 7168)  1.09 / 1.17 / 1.06x
  sh_gu    ( 512, 7168)  1.10 / 1.25 / 1.67x

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Move the new Kimi-K2 Gluon GEMM configs to gfx1250/96cu/

* [Triton/Gluon] [Config] Keep the CU-agnostic gfx1250 GEMM configs, put the 96-CU retunes in 96cu/

The fused_qkv_a (2112, 7168), router (384, 7168) and shared expert gate_up
(512, 7168) retunes move to configs/gfx1250/96cu/; the CU-agnostic files
are back to their main contents.

* [Triton/Gluon] [Config] Keep main's configs where the 96-CU retune is not faster

The 96-CU copies of the N=2112, 384 and 512 (K=7168) files take the "any"
bucket (M > 8192) from the CU-agnostic file again, with waves_per_eu 0,
instead of DEFAULT.json's.

q_b (N=1536, K=1536) M_LEQ_1, M_LEQ_4 and M_LEQ_16 and shared expert down
(N=7168, K=256) M_LEQ_64 go back to the DEFAULT.json entries main uses: in
tgemm.mm on MI450 (DPX, 96 CUs) the retuned ones were 4-11% slower.

* [Triton/Gluon] [Config] Add DEFAULT.json to the gfx1250 96-CU Gluon GEMM trees

#7105 reads a <cu_num>cu/ tree only when it has a DEFAULT.json, so
without one the ten Kimi-K2 files in 96cu/gluon/gemm/gemm_a16w16 and
96cu/gluon/gemm/batched_gemm_a16w16 are never read.

Both DEFAULT.json files are byte-identical copies of the ones in
gfx1250/gluon/gemm/, as configs/AGENTS.md asks for a new tree.

Signed-off-by: Yang, JiaRong <[email protected]>

---------

Signed-off-by: Yang, JiaRong <[email protected]>
shantipriya-amd pushed a commit to shantipriya-amd/aiter that referenced this pull request Nov 18, 2026
shantipriya-amd pushed a commit to shantipriya-amd/aiter that referenced this pull request Nov 18, 2026
…OCm#6573)

* [Triton/Gluon] [Config] gfx1250 Gluon GEMM configs for Kimi-K2 TP8

Kimi-K2 at TP8 has dense bf16 GEMM shapes and MLA-absorb batched GEMM
shapes with no gfx1250 Gluon config, so they run on DEFAULT.json:

- gemm_a16w16 (N, K): q_b (1536, 1536), kv_b (2048, 512), shared expert
  down (7168, 256), o_proj (7168, 1024), and the layer-0 dense MLP
  (4608, 7168) and (7168, 2304).
- batched_gemm_a16w16 B=8: absorb q (N=512, K=128) and absorb v
  (N=128, K=512), 8 heads per GPU at TP8.

Each M bucket was picked by CUDA-graph timing on MI455X over the configs
already shipped for gfx1250 in neighbouring buckets; buckets with no
faster candidate keep the DEFAULT.json config.

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Retune the Kimi-K2 TP8 gfx1250 configs over the full search space

Retune the eight Kimi-K2 TP8 shapes of this PR with sweep_configs.py
(--backend gluon) over the full gfx1250 Gluon search space, one sweep
per M bucket from 1 to 128, on MI450 in DPX mode (96 CUs per partition):

- every entry now carries waves_per_eu, as DEFAULT.json does;
- the files are DEFAULT_FALLBACK, so the buckets from 256 to 4096 come
  from DEFAULT.json; M_LEQ_8192 keeps the first version's config, with
  the waves_per_eu the wrapper used for it (0).

Cold-L2 CUDA-graph time against DEFAULT.json (main has no file for these
shapes), M = 4 / 16 / 64:

  q_b      (1536, 1536)  1.04 / 1.01 / 1.10x
  o_proj   (7168, 1024)  1.59 / 1.34 / 1.86x
  sh_down  (7168,  256)  1.90 / 1.53 / 1.11x
  l0_gu    (4608, 7168)  1.30 / 1.21 / 1.48x
  l0_down  (7168, 2304)  1.59 / 1.57 / 1.71x
  kv_b     (2048,  512)  1.02 / 1.03 / 1.03x
  bmm_q    B=8 (512, 128)  1.46 / 1.37 / 2.36x
  bmm_v    B=8 (128, 512)  1.25 / 1.28 / 1.25x

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Retune the gfx1250 qa_kva, router and shared-expert gate_up configs for Kimi-K2 TP8

Kimi-K2 TP8 also runs three shapes that already have gfx1250 Gluon files
(from the DeepSeek-R1 and router configs): fused_qkv_a_proj_with_mqa
(N=2112, K=7168), the MoE router (N=384, K=7168) and the shared-expert
gate_up (N=512, K=7168). Retune their M buckets from 1 to 128 the same
way, keeping every larger bucket; the kept buckets get the waves_per_eu
the wrapper used for them (0).

Cold-L2 CUDA-graph time against the current files, M = 4 / 16 / 64:

  qa_kva   (2112, 7168)  1.56 / 1.81 / 1.50x
  router   ( 384, 7168)  1.09 / 1.17 / 1.06x
  sh_gu    ( 512, 7168)  1.10 / 1.25 / 1.67x

Signed-off-by: Yang, JiaRong <[email protected]>

* [Triton/Gluon] [Config] Move the new Kimi-K2 Gluon GEMM configs to gfx1250/96cu/

* [Triton/Gluon] [Config] Keep the CU-agnostic gfx1250 GEMM configs, put the 96-CU retunes in 96cu/

The fused_qkv_a (2112, 7168), router (384, 7168) and shared expert gate_up
(512, 7168) retunes move to configs/gfx1250/96cu/; the CU-agnostic files
are back to their main contents.

* [Triton/Gluon] [Config] Keep main's configs where the 96-CU retune is not faster

The 96-CU copies of the N=2112, 384 and 512 (K=7168) files take the "any"
bucket (M > 8192) from the CU-agnostic file again, with waves_per_eu 0,
instead of DEFAULT.json's.

q_b (N=1536, K=1536) M_LEQ_1, M_LEQ_4 and M_LEQ_16 and shared expert down
(N=7168, K=256) M_LEQ_64 go back to the DEFAULT.json entries main uses: in
tgemm.mm on MI450 (DPX, 96 CUs) the retuned ones were 4-11% slower.

* [Triton/Gluon] [Config] Add DEFAULT.json to the gfx1250 96-CU Gluon GEMM trees

ROCm#7105 reads a <cu_num>cu/ tree only when it has a DEFAULT.json, so
without one the ten Kimi-K2 files in 96cu/gluon/gemm/gemm_a16w16 and
96cu/gluon/gemm/batched_gemm_a16w16 are never read.

Both DEFAULT.json files are byte-identical copies of the ones in
gfx1250/gluon/gemm/, as configs/AGENTS.md asks for a new tree.

Signed-off-by: Yang, JiaRong <[email protected]>

---------

Signed-off-by: Yang, JiaRong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants