Skip to content

[Triton/Gluon] gmm: gfx950 large-K/N config with JSON-driven shape dispatch - #5857

Merged
azaidy merged 4 commits into
mainfrom
gfx950-tuned-gmm
Oct 1, 2026
Merged

azaidy merged 4 commits into
mainfrom
gfx950-tuned-gmm

Conversation

@NimitPtl

@NimitPtl NimitPtl commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds a gfx950 "large_kn" gmm config (8 warps) and an optional per-arch "dispatch" rule list in the gmm config JSON. get_config() returns the first rule whose min_K / min_N / min_rows_per_group all match, otherwise "default". Thresholds live only in JSON; arches without "dispatch" are unchanged.

gfx950 rule: K >= 4096, N >= 4096, >= 256 rows per group. Measured on MI355X (fp16, CUDA-graph timing): 1.18-1.26x on matching shapes; configs that looked faster elsewhere lost 3-13% on small-K or <= 128 rows/group, which the rule excludes (all 70+ validated shapes under the rule are >= 0.98x).

test_gmm: 118 passed.

Motivation

Technical Details

Test Plan

The additional test does not trigger kernel runs on GPU. It is to validate if the correct config is triggered for a given shape. This was added based on co-pilot recommendations.

Test Result

gmm — fp16 (TFLOPS)

M total K N Groups Rows/group Group sizes Config selected Before After Speedup
65536 4096 4096 16 4096 equal large_kn 905 1065 1.18x
49152 1408 2048 64 768 equal default (unchanged) 728 727 1.00x
49152 1408 2048 64 768 uneven default (unchanged) 602 602 1.00x
32768 6144 16384 8 4096 equal large_kn 935 1134 1.21x
32768 6144 16384 8 4096 uneven large_kn 826 1041 1.26x
16384 7168 4096 32 512 uneven large_kn 615 745 1.21x
Geomean (all) 757 862 1.14x
Geomean (large_kn shapes) 1.21x

Submission Checklist

Adds a gfx950 "large_kn" gmm config (8 warps) and an optional per-arch
"dispatch" rule list in the gmm config JSON. get_config() returns the first
rule whose min_K / min_N / min_rows_per_group all match, otherwise "default".
Thresholds live only in JSON; arches without "dispatch" are unchanged.

gfx950 rule: K >= 4096, N >= 4096, >= 256 rows per group. Measured on MI355X
(fp16, CUDA-graph timing): 1.18-1.26x on matching shapes; configs that looked
faster elsewhere lost 3-13% on small-K or <= 128 rows/group, which the rule
excludes (all 70+ validated shapes under the rule are >= 0.98x).

test_gmm: 118 passed.
@NimitPtl
NimitPtl requested a review from a team September 25, 2026 19:53
@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 5857 --add-label <label>

One backend per PR:
A PR changes one kernel backend ([Triton/Gluon], [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 opt this PR out.

@github-actions github-actions Bot changed the title [Triton] gmm: gfx950 large-K/N config with JSON-driven shape dispatch [Triton/Gluon] gmm: gfx950 large-K/N config with JSON-driven shape dispatch Sep 25, 2026
@Boss2002n
Boss2002n requested a lite review from Copilot September 25, 2026 21:33

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

Correct group-size dispatch, add direct selection tests, and update the documented configuration-loading guidance.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds gfx950 GMM shape-based dispatch for an optimized large_kn configuration.

Changes:

  • Adds the 8-warp large_kn config and JSON thresholds.
  • Selects the first matching dispatch rule, falling back to default.
  • Preserves behavior for architectures without dispatch rules.

Review findings:

  • Moderate (2 votes): Dispatch uses M / G instead of the actual minimum group size.
  • Moderate (4 votes): Direct dispatch-selection tests are missing.
  • Nits (2, 1, and 1 votes): Update README/instruction documentation and align selection with the documented config-loader layer.
File Summary
aiter/​ops/​triton/​configs/​gfx950/​triton/​gmm/​gmm/​DEFAULT.json Adds the large_kn configuration and dispatch thresholds.
aiter/​ops/​triton/​_triton_kernels/​gmm.py Implements JSON-driven shape dispatch for GMM configurations.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread aiter/ops/triton/_triton_kernels/gmm.py Resolved
Comment thread aiter/ops/triton/_triton_kernels/gmm.py Resolved
Comment thread aiter/ops/triton/_triton_kernels/gmm.py Resolved
@azaidy azaidy self-assigned this Sep 28, 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 282b311 into main Oct 1, 2026
72 checks passed
@azaidy
azaidy deleted the gfx950-tuned-gmm branch October 1, 2026 21:44
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