Repository navigation
[Triton/Gluon] [gfx1151] Enable unshuffled MXFP4 GEMM - #5470
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags & labels: |
There was a problem hiding this comment.
🟡 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_configdirectly 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_kerneland monkeypatches its.runmethod. 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.
Boss2002n
left a comment
There was a problem hiding this comment.
LGTM! Lets get the CI passing :)
Enable only unshuffled Triton
gemm_afp4wfp4on 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=1024specialized 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
ab968511cannot run any of these shapes: required gfx1151DEFAULT.jsonis missing. There is therefore no upstream latency or speedup ratio. The previous-PR column compares00a5005with this narrowed patch.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 --checkpassed; verify PASS 3/3. No additional tests or benchmark files are included in this PR.