Repository navigation
[Triton/Gluon] Add gluon support for MXFP4 and MXFP8 quant kernel in gfx1250 - #4894
Conversation
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
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
There was a problem hiding this comment.
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.
…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.
…als, original comment)
# 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
…ves_per_eu in JSON, backend tests
…te, add mxfp8 bucket shape
… axes in get_quant_config
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)
MXFP4: Triton (portable) vs Gluon (gfx1250)
Submission Checklist