Repository navigation
[Triton/Gluon] [CI] Configs per CU count: <arch>/<cu_num>cu/ trees - #7105
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
There was a problem hiding this comment.
🟡 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-dirtuning 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
…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]>
…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]>
…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]>

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.