Skip to content

[Triton/Gluon] [gfx1151] Enable unshuffled MXFP4 GEMM - #5470

Merged
Boss2002n merged 9 commits into
ROCm:mainfrom
JeremiahM37:gfx1151-triton-mxfp4
Sep 25, 2026
Merged

Boss2002n merged 9 commits into
ROCm:mainfrom
JeremiahM37:gfx1151-triton-mxfp4

Conversation

@JeremiahM37

@JeremiahM37 JeremiahM37 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Enable only unshuffled Triton gemm_afp4wfp4 on gfx1151, with default configs. Keep the global FP4 capability flag unchanged so other FP4 paths remain gated.

Adapted from patch 9 in my strix-halo-sglang repo.

Removed the added tests and the N=129, K=1024 specialized config as requested. That shape was a synthetic tail/split-K regression case, not a model dimension. The test file now matches upstream; validation stays outside the PR.

Benchmark on Radeon 8060S / gfx1151, Torch 2.11.0+ROCm7.13, Triton 3.6.0, BF16 output, preallocated inputs/output. Shared input generator; five repetitions of triton.testing.do_bench(warmup=100, rep=300, return_mode="median"), reporting the median in milliseconds. Compilation and reference checks excluded from timing. Each result passed comparison with the shared PyTorch reference.

Upstream base ab968511 cannot run any of these shapes: required gfx1151 DEFAULT.json is missing. There is therefore no upstream latency or speedup ratio. The previous-PR column compares 00a5005 with this narrowed patch.

M,N,K Previous PR (ms) This patch (ms)
1,256,512 0.01198 0.01198
16,256,256 0.00906 0.00906
1024,1024,1024 0.26818 0.26939
128,7168,4608 1.09036 1.08896
17,129,1024 0.01387 0.02134

The first four shapes come from the existing shared test list. The last row is the removed synthetic case, shown only to quantify removing its split-K config; it now uses defaults. These are isolated GEMM measurements, not full-model performance claims.

Validation of the narrowed patch: 223 local gfx1151 regression tests passed; Black, Ruff and git diff --check passed; verify PASS 3/3. No additional tests or benchmark files are included in this PR.

@JeremiahM37
JeremiahM37 requested a review from a team September 11, 2026 23:45
@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 5470 --add-label <label>

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][gfx1151] Enable unshuffled MXFP4 GEMM [Triton/Gluon] [gfx1151] Enable unshuffled MXFP4 GEMM Sep 11, 2026
@Boss2002n
Boss2002n requested a lite review from Copilot September 12, 2026 01: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.

🟡 Changes recommended

Test configuration and private-interface usage must be corrected before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Enables unshuffled Triton MXFP4 GEMM on gfx1151 with dedicated tuning and regression coverage while preserving other FP4 gating.

Changes:

  • Enables the gfx1151 Triton path.
  • Adds gfx1151 GEMM tuning defaults.
  • Adds numerical, split-K, graph, stride, dtype, and resource tests.
File summaries
File Summary
op_tests/triton_tests/gemm/basic/test_gemm_afp4wfp4_gfx1151.py Adds gfx1151 regression tests. Requires moving split-K tuning into config-backed resolution and avoiding private configuration and kernel interfaces.
aiter/ops/triton/gemm/basic/gemm_afp4wfp4.py Enables the gfx1151 Triton path.
aiter/ops/triton/configs/gfx1151/triton/gemm/gemm_afp4wfp4/DEFAULT.json Defines gfx1151 tuning defaults.
Review details

Suppressed comments (2)

op_tests/triton_tests/gemm/basic/test_gemm_afp4wfp4_gfx1151.py:8

  • [verified] This new test imports _get_config directly from _triton_kernels, but that module is an internal implementation and tests should exercise the public wrapper/config path. As written, the test is coupled to a private helper and bypasses the interface users rely on. Author must obtain the configuration through the shared GEMM config loader or an existing public test helper instead.
from aiter.ops.triton._triton_kernels.gemm.basic.gemm_afp4wfp4 import _get_config

op_tests/triton_tests/gemm/basic/test_gemm_afp4wfp4_gfx1151.py:89

  • [verified] This test reaches into the wrapper's private _triton_gemm_afp4wfp4_kernel and monkeypatches its .run method. Triton kernels under _triton_kernels/ are internal and are not a stable test-facing API, so an implementation refactor can break this test without changing the public operation; Author must expose a wrapper-level metadata hook or use a supported compilation-inspection path instead of accessing the private kernel object.
    module = importlib.import_module("aiter.ops.triton.gemm.basic.gemm_afp4wfp4")
    kernel = module._triton_gemm_afp4wfp4_kernel
    run = kernel.run
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

@zufayu
zufayu requested review from a team and Dewei-Wang-sh September 14, 2026 01:43
@Boss2002n
Boss2002n removed the request for review from Dewei-Wang-sh September 24, 2026 16:08

@Boss2002n Boss2002n 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! Lets get the CI passing :)

@JeremiahM37

Copy link
Copy Markdown
Contributor Author

On 65c5975, MI35X Standard shards 2 and 6 fail before tests start: pip reports the amd-aiter wheel is invalid. Both logs also show cache-restore timeouts. The gate fails because of those jobs; all eight Triton shards passed. Could these two jobs be rerun?

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

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