Skip to content

[Triton/Gluon] Add gluon support for MXFP4 and MXFP8 quant kernel in gfx1250 - #4894

Merged
NimitPtl merged 87 commits into
mainfrom
quant_mxfp8_gfx950_1250_v2
Oct 7, 2026
Merged

NimitPtl merged 87 commits into
mainfrom
quant_mxfp8_gfx950_1250_v2

Conversation

@NimitPtl

@NimitPtl NimitPtl commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Using gluon instead of triton for performance improvement

Technical Details

Current implementation of quantization in triton has a software emulation of the same.
Utilize the hardware implementation in gluon to speed up the process.
The layout heuristic has been modified to better suite the shapes we need to process.
Implement pre-fetch for certain layouts in gluon.
Changes are all related to gluon. Triton remain same as before.

Test Plan

Test suite as well as benchmark script for speed of quant kernel. Test script for verifying accuracy.

Test Result

Focusing on MoE layers for GPTOSS and DSR1

Gluon gives positive numbers compared to triton.

MXFP8: Triton (portable) vs Gluon (gfx1250, fixed + retuned)

N M Triton GB/s Triton us Gluon GB/s Gluon us Speedup
1024 8 7.8 3.2 11.7 2.1 1.50x
1024 32 47.8 2.1 43.7 2.3 0.91x
1024 256 344.8 2.3 325.2 2.4 0.94x
1024 2048 2197.3 2.9 2154.6 3.0 0.98x
1024 8192 4933.4 5.2 5173.6 4.9 1.05x
1024 16384 6296.2 8.1 7839.8 6.5 1.25x
geomean 1.09x
3072 8 19.9 3.7 34.5 2.2 1.73x
3072 32 137.0 2.2 126.3 2.4 0.92x
3072 256 933.5 2.6 892.1 2.7 0.96x
3072 2048 5181.0 3.7 4358.9 4.4 0.84x
3072 8192 8918.9 8.6 8656.2 8.8 0.97x
3072 16384 10661.7 14.3 10373.1 14.7 0.97x
geomean 1.03x
7168 8 59.9 2.9 77.8 2.2 1.30x
7168 32 286.7 2.4 278.2 2.5 0.97x
7168 256 2017.1 2.8 1913.2 2.9 0.95x
7168 2048 8286.1 5.4 7440.1 6.0 0.90x
7168 8192 11744.8 15.2 10979.9 16.2 0.93x
7168 16384 13787.8 25.8 10522.4 33.8 0.76x
geomean 0.96x
overall geomean 1.02x

MXFP4: Triton (portable) vs Gluon (gfx1250)

N M Triton GB/s Triton us Gluon GB/s Gluon us Speedup
1024 8 6.3 3.3 10.7 1.9 1.71x
1024 32 21.8 3.8 38.9 2.1 1.79x
1024 256 241.8 2.7 287.5 2.3 1.19x
1024 2048 1519.8 3.5 1643.8 3.2 1.08x
1024 8192 3528.9 6.0 4945.0 4.3 1.40x
1024 16384 4197.6 10.1 7165.0 5.9 1.71x
geomean 1.45x
3072 8 24.2 2.6 29.3 2.1 1.21x
3072 32 96.4 2.6 108.9 2.3 1.13x
3072 256 432.5 4.6 785.6 2.5 1.82x
3072 2048 2480.1 6.4 4240.8 3.8 1.71x
3072 8192 4540.8 14.0 8239.2 7.7 1.81x
3072 16384 5109.4 24.9 9959.1 12.8 1.95x
geomean 1.57x
7168 8 57.7 2.5 67.4 2.2 1.17x
7168 32 218.2 2.7 245.8 2.4 1.13x
7168 256 958.2 4.8 1492.9 3.1 1.56x
7168 2048 3686.4 10.1 6950.8 5.3 1.89x
7168 8192 5281.1 28.1 10247.5 14.5 1.94x
7168 16384 5594.3 53.1 11514.0 25.8 2.06x
geomean 1.58x
overall geomean 1.53x

Submission Checklist

NimitPtl and others added 23 commits July 24, 2026 20:18
Added pre fetch
slight modification in bench script
…push-hw-cvt

# Conflicts:
#	aiter/ops/triton/_gluon_kernels/gfx950/quant/quant.py
#	aiter/ops/triton/quant/quant.py
#	op_tests/op_benchmarks/triton/bench_quant_mxfp4.py
…ler team, now successfully uses the correct instruction
@NimitPtl
NimitPtl requested a review from a team August 21, 2026 02:20
@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
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 4894 --add-label <label>

PR title tags:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf] and op tags like [MLA] are left untouched. Add the no-auto-title label to opt this PR out of title tagging.

@github-actions github-actions Bot changed the title Add MXFP4/MXFP8 gfx950/gfx1250 gluon quant kernels [Triton/Gluon] Add MXFP4/MXFP8 gfx950/gfx1250 gluon quant kernels Aug 21, 2026
@Boss2002n
Boss2002n requested a balanced review from Copilot August 21, 2026 04:42

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.

Pull request overview

Adds architecture-specific Gluon MXFP4 quantization paths for gfx950/gfx1250 and expands quantization benchmarking.

Changes:

  • Adds gfx950 and gfx1250 Gluon MXFP4 kernels.
  • Dispatches MXFP4 quantization by architecture and adjusts tiling.
  • Adds MXFP8 benchmarking and updates MXFP4 benchmarks.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
op_tests/op_benchmarks/triton/bench_quant_mxfp8.py Adds MXFP8 benchmark coverage.
op_tests/op_benchmarks/triton/bench_quant_mxfp4.py Updates shapes and CUDA-graph timing.
aiter/ops/triton/quant/quant.py Adds architecture dispatch and retunes launches.
aiter/ops/triton/_triton_kernels/quant/quant.py Defers FP32 conversion until quantization.
aiter/ops/triton/_gluon_kernels/gfx950/quant/quant.py Adds the gfx950 Gluon MXFP4 kernel.
aiter/ops/triton/_gluon_kernels/gfx1250/quant/quant.py Adds the gfx1250 TDM/LDS MXFP4 kernel.

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

Comment thread aiter/ops/triton/quant/quant.py Resolved
Comment thread aiter/ops/triton/quant/quant.py Resolved
Comment thread aiter/ops/triton/quant/quant.py Resolved
NimitPtl and others added 13 commits September 30, 2026 19:56
…e mid-M configs

- Drop the Python BLOCK_SIZE_M/N overrides in dynamic_mxfp4_quant and
  dynamic_mxfp8_quant; launch configs now come only from the JSON tables.
- Tune the 33<=M<=1024 buckets (more, smaller CTAs) for MXFP4 and MXFP8.
- Compute e8m0 scale bias in int32 before narrowing to uint8.
Replace lookup_tuned_config with lookup_config(table, axes, **values) and
drop the "schema" key from the gfx950 mxfp4/mxfp8 JSON tables.
…only

- Re-tune per-bucket block/warp/buffer configs via the dispatch path with
  cold inputs (old config kept as a candidate); mxfp4 +10.6%, mxfp8 +5.4%
  geomean vs previous gluon configs.
- Move the former in-code shape rules (small M / small N tile sizes) into
  the JSON buckets so the JSON is the single source of block sizes.
- mxfp4: JSON is used only by the gfx1250 gluon launch; the Triton
  fallback is main's original heuristics again.
- mxfp4: fix compile failures for M<=8 at N>1024 and M<=4 (wide BLOCK_SIZE_N
  at tiny BLOCK_SIZE_M) by using BLOCK_SIZE_N=128 tiles there.
- Shorten comments/docstrings across the touched files.
…gfx950_1250_v2

Resolve conflicts:
- quant/quant.py: chain gfx950 Gluon, gfx1250 Gluon and Triton fallback in
  dynamic_mxfp4_quant and dynamic_mxfp8_quant (each arch reads only its own
  config JSON).
- config_utils.py: keep the shortened docstrings.
- bench_quant_mxfp4_fp8.py: time with run_perftest(quant_fn, x) so inputs
  rotate past L2 (no cache reuse between iterations).
- test_quant_mxfp{4,8}.py: take the trimmed shape lists.
# Conflicts:
#	aiter/ops/triton/_gluon_kernels/gfx950/quant/quant.py
#	aiter/ops/triton/quant/quant.py
#	aiter/ops/triton/utils/config_utils.py
#	op_tests/op_benchmarks/triton/bench_quant_mxfp4_fp8.py
#	op_tests/triton_tests/quant/test_quant_mxfp4.py
#	op_tests/triton_tests/quant/test_quant_mxfp8.py
cagrikymk
cagrikymk previously approved these changes Oct 6, 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!

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