Skip to content

[Triton/Gluon] DSR1 GEMM tuning - #5867

Merged
Boss2002n merged 22 commits into
mainfrom
alizaidy/DSR1-tuning-rebased
Oct 5, 2026
Merged

Boss2002n merged 22 commits into
mainfrom
alizaidy/DSR1-tuning-rebased

Conversation

@azaidy

@azaidy azaidy commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Perf tuning for DSR1 kernels on gfx1250

Kernel Shape Bucket Speedup vs baseline
gemm_a16w16 (router, gluon) N=256 K=7168 M_LEQ_16 4.1–4.8x
gemm_a16w16 (router, gluon) N=256 K=7168 M_LEQ_64 3.5–4.2x
gemm_a16w16 (router, gluon) N=256 K=7168 M_LEQ_512 2.3–2.5x
gemm_a16w16 (router, gluon) N=256 K=7168 M_LEQ_2048 1.40–1.50x
gemm_a16w16 (router, gluon) N=256 K=7168 any 0.99–1.72x
gemm_a8w8 N=2112 K=7168 M_LEQ_512 1.49x
gemm_a8w8 N=7168 K=16384 M_LEQ_512 1.26x
gemm_a8w8 N=7168 K=16384 M_LEQ_2048 1.10x
gemm_a8w8 N=24576 K=1536 M_LEQ_256 1.17x
gemm_a8w8 N=6144 K=1536 M_LEQ_1 1.39x
gemm_a8w8 N=6144 K=1536 M_LEQ_4 1.04x
gemm_a8w8 N=6144 K=1536 M_LEQ_64 1.12x
batched_gemm_a8w8 (B=128) N=512 K=128 M_LEQ_2048 1.06x

Conflict with #5349 (upstream DSR1 tuning) resolved per M bucket from A/B
benchmarks on gfx1250: upstream bucket layout kept, this branch's config used
only in buckets where it measured >=2% faster (L2-flushed do_bench).
Conflict with #5349 (upstream DSR1 tuning) resolved per M bucket from A/B
benchmarks on gfx1250: upstream bucket layout kept, this branch's config used
only in buckets where it measured >=2% faster (L2-flushed do_bench).
@azaidy
azaidy requested review from a team and vgokhale September 26, 2026 00:49
@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 5867 --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 DSR1 GEMM tuning [Triton/Gluon] DSR1 GEMM tuning Sep 26, 2026
@azaidy
azaidy requested a review from Boss2002n September 26, 2026 00:49
@Boss2002n
Boss2002n requested a lite review from Copilot September 26, 2026 01:33

This comment was marked as spam.

Copilot AI lite review requested due to automatic review settings September 30, 2026 21:22

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.

Comment thread aiter/ops/triton/gemm/basic/gemm_a16w16.py
Comment thread aiter/ops/triton/gemm/batched/batched_gemm_a16w8.py
Comment thread op_tests/triton_tests/gemm/batched/test_batched_gemm_a16w8.py
@azaidy
azaidy requested a lite review from Copilot September 30, 2026 21:32

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 AI lite review requested due to automatic review settings October 1, 2026 22:14
* QKV_A, Q_B, O_proj, Moegating tuning

* K,V absorb laeyer tuning

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.

Comment thread aiter/ops/triton/gemm/batched/batched_gemm_a16w8.py
Copilot AI lite review requested due to automatic review settings October 1, 2026 22:22

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 review overview

🟡 Changes recommended

Unresolved kernel safety, configuration schema, API behavior, and numerical-semantics issues remain.

Review effort: Lite
Findings: 5 High severity · 2 Medium severity · 4 Low severity

Open (11)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Retain matrix_instr_nonkdim in the modified GEMM entry

aiter/​ops/​triton/​configs/​gfx1250/​triton/​gemm/​gemm_a8w8/​GEMM-A8W8-N=7168-K=16384.json:103

The retuned Triton GEMM entry removes the required matrix_instr_nonkdim field. Keep this field (16, as in the neighboring entries) in every modified entry; otherwise the config no longer follows the GEMM schema and tuning validation will reject it.

Medium severity Reject Gluon benchmarks with unsupported bias settings

op_tests/​op_benchmarks/​triton/​bench_batched_gemm_a8w8_a_per_token_group_prequant_w_per_batched_tensor_quant.py:209

The help text says Gluon requires --no-bias, but this guard only checks the architecture. Running the advertised command with --backend gluon and the default bias setting reaches batched_gemm_a16w8, which asserts on the bias and aborts instead of producing a benchmark. Reject this argument combination before launching (or automatically disable bias).

Comment thread aiter/ops/triton/gemm/batched/batched_gemm_a16w8.py
Copilot AI lite review requested due to automatic review settings October 1, 2026 22:53

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.

Comment thread aiter/configs/model_configs/dsv3_bf16_tuned_gemm.csv
vgokhale
vgokhale previously approved these changes Oct 2, 2026
Copilot AI lite review requested due to automatic review settings October 2, 2026 15:54

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.

@Boss2002n
Boss2002n requested a review from vgokhale October 2, 2026 19:41
Copilot AI lite review requested due to automatic review settings October 4, 2026 12:07
@Boss2002n
Boss2002n enabled auto-merge (squash) October 4, 2026 12:09

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.

Comment thread aiter/configs/model_configs/dsv3_bf16_tuned_gemm.csv
@Boss2002n
Boss2002n disabled auto-merge October 4, 2026 14:25
@Boss2002n
Boss2002n merged commit 2211f24 into main Oct 5, 2026
@Boss2002n
Boss2002n deleted the alizaidy/DSR1-tuning-rebased branch October 5, 2026 14:46
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