Skip to content

[Triton/Gluon] [Config] MoE and MLA configs for gfx1101, gfx1150 and gfx1151: sparse_mla_dsv4_train, sonicmoe - #6158

Merged
Boss2002n merged 7 commits into
ROCm:mainfrom
Ragua1:sparse-mla-dsv4-config-gfx1101
Nov 3, 2026
Merged

Boss2002n merged 7 commits into
ROCm:mainfrom
Ragua1:sparse-mla-dsv4-config-gfx1101

Conversation

@Ragua1

@Ragua1 Ragua1 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Two Triton entry points have no table for gfx1101, gfx1150 or gfx1151 on main:

  • sparse_mla_dsv4_train runs with the in-code fallback (_FWD_FALLBACK, _BWD_FALLBACK).
  • sonicmoe raises FileNotFoundError: SonicMoE has no BF16 Triton config for architecture <arch>.

This PR adds the two tables for gfx1101 (Radeon RX 7800 XT) and gfx1150 (Radeon 890M), each measured on its card, and copies the gfx1150 tables to gfx1151. Data only; no kernel, loader or test code is changed. Every value is written out in each architecture's file; nothing is read from another architecture at run time.

Technical Details

file under aiter/ops/triton/configs/<arch>/triton/ gfx1101 gfx1150
attention/sparse_mla_dsv4_train/DEFAULT.json tuned on gfx1101, fwd and bwd tuned on gfx1150, fwd and bwd
moe/sonicmoe_bf16/DEFAULT.json the gfx942 values; an 80-candidate search of the grouped-GEMM kernels did not beat them. Only _comment differs from gfx942 the same; the search on gfx1150 did not beat them either

gfx1151 gets the gfx1150 files; only the sonicmoe _comment differs. gfx1150 and gfx1151 are the same RDNA 3.5 generation, and unified_attention already reads gfx1151 tables for gfx1150 (_ARCH_ALIAS in unified_attention_utils.py). The gfx1151 copies are not measured: no gfx1151 hardware is available here.

sparse_mla_dsv4_train:

kernel fallback (today) gfx1101 gfx1150, gfx1151
_sparse_mla_fwd_kernel BLOCK_H 32, BLOCK_K 32, 4 warps, 2 stages BLOCK_H 64, BLOCK_K 16, 8 warps, 1 stage BLOCK_H 16, BLOCK_K 16, 8 warps, 1 stage
_bwd_kernels BLOCK_H 16, BLOCK_K 32, 4 warps BLOCK_H 16, BLOCK_K 16, 4 warps same as gfx1101; no other candidate was faster on gfx1150

For sonicmoe the search covered the medium and large buckets of _grouped_gemm_kernel and _grouped_gemm_dw_kernel. The other entries (small buckets, token_gather_sum_kernel, db2_and_ds_kernel) are the gfx942 values, checked by the tests below but not searched.

Test Plan

gfx1101 and gfx1150, Windows 11, TheRock ROCm 10.2 (torch 2.15.0a0+rocm10.2.0a20260926, HIP 7.17), Triton 3.8.0, aiter main @ 1eb7de55.

  • Correctness: test_sparse_mla_dsv4_train.py (all 18 cases) and test_sonicmoe.py (all 25 cases), without and with the tables, on both cards.
  • Timing: each entry point through its public function, the candidate tables against the reference (fallback or gfx942 values) on upstream's test shapes and DeepSeek-V2-Lite/V4-like shapes that fit in 16 GiB. Each arm is checked against the test's reference in the same process. A 10-round search, then the winner re-measured in 5 fresh processes, one round each with the arms in the same process. On gfx1150 the full candidate grid was screened first, and the best four, the gfx1101 values and the reference were compared in 10 interleaved rounds.

Test Result

Correctness, the same on gfx1101 and on gfx1150:

test without the tables with the tables
test_sparse_mla_dsv4_train.py 18/18 passed (fallback) 18/18 passed
test_sonicmoe.py 1 passed, 23 failed (FileNotFoundError, no BF16 config), 1 skipped 24 passed, 1 skipped (fnuz blockwise FP8 is gfx942-only)

sparse_mla_dsv4_train on gfx1101, ratio = fallback time / this PR's time per process; min / median / max over 5 processes:

kernel shape (N, H, D, N_kv, topk) fallback ms this PR ms ratio min / median / max
fwd 256, 64, 512, 320, 128 1.255 0.793 1.575 / 1.585 / 1.601
fwd 1024, 64, 512, 4096, 512 11.493 5.897 1.929 / 1.949 / 1.959
bwd 128, 8, 512, 160, 64 1.905 1.451 1.254 / 1.258 / 1.364
bwd 512, 64, 512, 2048, 512 40.018 20.692 1.929 / 1.937 / 1.948

sparse_mla_dsv4_train on gfx1150 (Radeon 890M, an iGPU whose timings move with load, so the ratios come from 10 interleaved rounds). Ratio = fallback time / this PR's time per round; min / median / max over 10 rounds, best and worst trimmed:

kernel shape (N, H, D, N_kv, topk) fallback ms this PR ms ratio min / median / max
fwd 256, 64, 512, 320, 128 27.944 5.844 3.059 / 3.704 / 5.336
fwd 1024, 64, 512, 4096, 512 388.634 132.574 2.695 / 2.977 / 3.323
bwd 128, 8, 512, 160, 64 9.787 7.075 1.232 / 1.384 / 1.541
bwd 512, 64, 512, 2048, 512 915.528 529.856 1.697 / 1.717 / 1.736

The gfx1101 forward values run on gfx1150 too, but the gfx1150 values are 1.342 and 1.187 times faster than them on the two shapes. On gfx1150 sonicmoe behaves as on gfx1101: no candidate beat the gfx942 entry on every shape, so it is kept.

Only gfx1101 and gfx1150 were measured. The gfx1151 files are copies of gfx1150, not measured; the values are not proposed for any other architecture.

@Ragua1
Ragua1 requested a review from a team October 5, 2026 18:37
@github-actions github-actions Bot changed the title [Triton] [Config] sparse_mla_dsv4_train: add gfx1101 (RDNA3) config [Triton/Gluon] [Config] sparse_mla_dsv4_train: add gfx1101 (RDNA3) config Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

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
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 6158 --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.

The values are the gfx942 entries, written out in the gfx1101 files; a
search on gfx1101 did not beat them on every measured shape.

Signed-off-by: Martin Domanský <[email protected]>
@Ragua1 Ragua1 changed the title [Triton/Gluon] [Config] sparse_mla_dsv4_train: add gfx1101 (RDNA3) config [Triton/Gluon] [Config] MoE and MLA configs for gfx1101 (RDNA3): sparse_mla_dsv4_train, moe_gemm_mxfp8, sonicmoe Oct 5, 2026
@Boss2002n
Boss2002n requested a balanced review from Copilot October 5, 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

The description covers an unrelated operation, and the PR combines three independently validated tuning concerns.

Review effort: Balanced
Findings: 2 Low severity

Open (2)
What changed in this PR

Adds gfx1101 Triton configurations for sparse MLA and two MoE kernel families.

Changes:

  • Adds sparse MLA forward/backward tuning.
  • Adds MXFP8 MoE GEMM and SonicMoE configurations.
File Description
.../​sonicmoe_bf16/​DEFAULT.json Adds gfx1101 SonicMoE settings.
.../​mxfp8_fnuz/​DEFAULT.json Adds gfx1101 MXFP8 GEMM tiles.
.../​sparse_mla_dsv4_train/​DEFAULT.json Adds gfx1101 MLA training tiles.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

sparse_mla_dsv4_train is tuned on gfx1150 (Radeon 890M): the forward
kernel takes BLOCK_H 16, BLOCK_K 16 and 8 warps, the backward kernel the
gfx1101 values, as no other candidate was faster. moe_gemm_mxfp8 and
sonicmoe carry the gfx942 entries; a search on gfx1150 did not beat them
on every measured shape.

The gfx1151 files are copies of gfx1150 (same RDNA 3.5 generation); only
the sonicmoe _comment differs. They are not measured: no gfx1151
hardware was available.

Signed-off-by: Martin Domanský <[email protected]>
@Ragua1 Ragua1 changed the title [Triton/Gluon] [Config] MoE and MLA configs for gfx1101 (RDNA3): sparse_mla_dsv4_train, moe_gemm_mxfp8, sonicmoe [Triton/Gluon] [Config] MoE and MLA configs for gfx1101, gfx1150 and gfx1151: sparse_mla_dsv4_train, moe_gemm_mxfp8, sonicmoe Oct 6, 2026
@Ragua1

Ragua1 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

The description was replaced by the text of an unrelated draft by mistake; it now covers the files in this PR. A second commit adds the gfx1150 tables, measured on a Radeon 890M, and copies them to gfx1151.

On splitting: all three are data-only config tables for the Triton backend, with no kernel, loader or test change, and each is validated separately in the description. If the maintainers prefer one PR per config family, I will split it.

@cagrikymk

Copy link
Copy Markdown
Contributor

@Ragua1 Can you verify each added config compiles correctly for given arch? You can do targeted compilation if you dont have the HW. I wanna make sure we are not introducing a config that cant compile.

moe_gemm_mxfp8 was removed in ROCm#6035, and nothing on main reads
configs/<arch>/triton/moe/mxfp8_fnuz any more, so these three tables
would have no reader.

Signed-off-by: Martin Domanský <[email protected]>
@Ragua1

Ragua1 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@Ragua1 Can you verify each added config compiles correctly for given arch? You can do targeted compilation if you dont have the HW. I wanna make sure we are not introducing a config that cant compile.

Yes, every added config compiles for its arch. Verified on main @ e8bdaf88 with this PR's tables. Besides the tables as shipped, test_sonicmoe.py was rerun once per distinct entry with that entry forced onto every bucket, so entries the test shapes never select are compiled and checked too. For gfx1150 and gfx1151 the tests ran on gfx1101 with that arch's tables, and every kernel was also compiled for that target (not executed).

arch how test_sparse_mla_dsv4_train.py test_sonicmoe.py, 5 runs compile errors
gfx1101 on hardware 18/18 24 passed, 1 skipped (gfx942-only) 0
gfx1150 targeted compilation 18/18 24 passed, 1 skipped (gfx942-only) 0 of 545
gfx1151 targeted compilation 18/18 24 passed, 1 skipped (gfx942-only) 0 of 545

The gfx1151 files are a copy of gfx1150, not tuned on gfx1151 hardware. They can stay so the entry points work on gfx1151, or be dropped and left to a separate PR. Please state which you prefer.

moe_gemm_mxfp8 was removed in #6035 and nothing on main reads mxfp8_fnuz any more, so the three mxfp8_fnuz files are removed from this PR. They can follow separately if that entry point returns.

@Ragua1 Ragua1 changed the title [Triton/Gluon] [Config] MoE and MLA configs for gfx1101, gfx1150 and gfx1151: sparse_mla_dsv4_train, moe_gemm_mxfp8, sonicmoe [Triton/Gluon] [Config] MoE and MLA configs for gfx1101, gfx1150 and gfx1151: sparse_mla_dsv4_train, sonicmoe Oct 15, 2026
@azaidy
azaidy requested a balanced review from Copilot October 21, 2026 18:15

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.

🔵 Needs a closer look

The unmeasured gfx1151 configurations require target-hardware validation and human review of the seeding-policy exception.

1 open issue
2 resolved since last review

Review effort: Balanced

Review of 2026-10-21 on ROCm#6158: the _comment fields in the gfx1101 and
gfx1150 sonicmoe_bf16 tables name the architecture only.
cagrikymk
cagrikymk previously approved these changes Oct 23, 2026
azaidy
azaidy previously requested changes Oct 23, 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!

Review of 2026-10-23 on ROCm#6158 (azaidy): no comments in config files.
Drops the _comment key from the gfx1101, gfx1150 and gfx1151
sonicmoe_bf16 tables. Values unchanged.
@aiter-bot

Copy link
Copy Markdown

NOT READY FOR HUMAN REVIEW

PR Self-Review

Revision 645c977d5a11 · 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.

@Boss2002n
Boss2002n merged commit cfeb0dc into ROCm:main Nov 3, 2026
59 checks passed
@Ragua1
Ragua1 deleted the sparse-mla-dsv4-config-gfx1101 branch November 3, 2026 20:36
shantipriya-amd pushed a commit to shantipriya-amd/aiter that referenced this pull request Nov 18, 2026
…gfx1151: sparse_mla_dsv4_train, sonicmoe (ROCm#6158)

* Add sparse_mla_dsv4_train Triton config for gfx1101

Signed-off-by: Martin Domanský <[email protected]>

* Add moe_gemm_mxfp8 and sonicmoe Triton configs for gfx1101

The values are the gfx942 entries, written out in the gfx1101 files; a
search on gfx1101 did not beat them on every measured shape.

Signed-off-by: Martin Domanský <[email protected]>

* Add MoE and MLA Triton configs for gfx1150 and gfx1151

sparse_mla_dsv4_train is tuned on gfx1150 (Radeon 890M): the forward
kernel takes BLOCK_H 16, BLOCK_K 16 and 8 warps, the backward kernel the
gfx1101 values, as no other candidate was faster. moe_gemm_mxfp8 and
sonicmoe carry the gfx942 entries; a search on gfx1150 did not beat them
on every measured shape.

The gfx1151 files are copies of gfx1150 (same RDNA 3.5 generation); only
the sonicmoe _comment differs. They are not measured: no gfx1151
hardware was available.

Signed-off-by: Martin Domanský <[email protected]>

* Drop the mxfp8_fnuz configs for gfx1101, gfx1150 and gfx1151

moe_gemm_mxfp8 was removed in ROCm#6035, and nothing on main reads
configs/<arch>/triton/moe/mxfp8_fnuz any more, so these three tables
would have no reader.

Signed-off-by: Martin Domanský <[email protected]>

* Drop the model names from the sonicmoe config comments

Review of 2026-10-21 on ROCm#6158: the _comment fields in the gfx1101 and
gfx1150 sonicmoe_bf16 tables name the architecture only.

* Remove the _comment fields from the sonicmoe config tables

Review of 2026-10-23 on ROCm#6158 (azaidy): no comments in config files.
Drops the _comment key from the gfx1101, gfx1150 and gfx1151
sonicmoe_bf16 tables. Values unchanged.

---------

Signed-off-by: Martin Domanský <[email protected]>
klin-amd added a commit that referenced this pull request Nov 30, 2026
configs/gfx1100/triton/attention/sparse_mla_dsv4_train/DEFAULT.json: the
forward tile (16 x 16, 2 warps, 1 stage) and the backward tile (16 x 16,
2 warps), measured on a Radeon PRO W7900D over the benchmark's DSV4 shapes
and the shapes of #6158. gfx1100 runs this op with the in-code fallbacks
today; the file is 3.6x to 7.6x faster forward and 1.1x to 1.9x backward
on every measured shape.

Signed-off-by: Lin, KuanTing <[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.

6 participants