Skip to content

[TRITON] MXFP4 Quantization Gluon implementation for gfx950 and gfx1250#4054

Closed
NimitPtl wants to merge 1 commit into
ROCm:quant_gluonfrom
NimitPtl:quant_gluon
Closed

[TRITON] MXFP4 Quantization Gluon implementation for gfx950 and gfx1250#4054
NimitPtl wants to merge 1 commit into
ROCm:quant_gluonfrom
NimitPtl:quant_gluon

Conversation

@NimitPtl

@NimitPtl NimitPtl commented Jul 2, 2026

Copy link
Copy Markdown

Motivation

Using gluon instead of triton for performance improvement

Technical Details

Gluon kernel, with sizes derived from the TTGIR of Triton kernel.

Test Plan

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

Test Result

Marginal improvement for gfx950 and around 10% improvement with usage of LDS in gfx1250

Submission Checklist

@NimitPtl NimitPtl marked this pull request as ready for review July 6, 2026 19:31
@NimitPtl NimitPtl self-assigned this Jul 6, 2026
@NimitPtl NimitPtl force-pushed the quant_gluon branch 3 times, most recently from 206dfc7 to afa241b Compare July 6, 2026 20:54
@cagrikymk cagrikymk changed the title Gluon implementation for gfx950 and gfx1250 [TRITON] MXFP4 Quantization Gluon implementation for gfx950 and gfx1250 Jul 7, 2026
@cagrikymk

Copy link
Copy Markdown
Contributor

@NimitPtl The target for this PR is https://github.com/ROCm/aiter/tree/quant_gluon branch, is that on purpose or you want to merge to main?

from aiter.ops.triton.gluon.quant_mxfp4 import _dynamic_mxfp4_quant_kernel_gluon
from aiter.ops.triton.gluon.quant_mxfp4 import _dynamic_mxfp4_quant_kernel_gluon_950
from aiter.ops.triton.gluon.quant_mxfp4 import _dynamic_mxfp4_quant_kernel_gluon_1250
from aiter.jit.utils.chip_info import get_gfx

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.

- "even" (default): `even_round` in `quark.torch.quantization.utils`.
- etc.
use_gluon: Whether to use Gluon kernel (default: True). Only available on MI350 (gfx950).
use_gluon: Whether to use Gluon kernel (default: True). Only available on (gfx950/1250).

@rahulbatra85 rahulbatra85 Jul 9, 2026

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.

I think we should use a standardized approach across all kernels and op wrappers. Right now this is all over the place.

My suggestion is that we should add a backend field to each op which can take values "triton", "gluon", or None(default).

if backend is None:
  call the best performing kernel we know of for this op on this arch whether gluon or triton. This is hardcoded by the kernel/op developer or whoever tunes the kernel later on.
elif backend == "gluon":
   call the gluon kernel if available on that arch(some helper in the https://github.com/ROCm/aiter/blob/main/aiter/ops/triton/utils/_triton/arch_info.py) . Otherwise, issue a warning and fall back to Triton kernel
else:
   call the Triton kernel(assumption is there is always a Triton kernel for an op, I think that's a reasonable one to make.)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/ROCm/aiter/pull/2994/changes
this is the base change. This choses triton/gluon based on the user preference.
let me know if this is a satisfactory approach.

@rahulbatra85

Copy link
Copy Markdown
Contributor

Can you post the benchmark numbers as well for both gfx950 and gfx1250?

@NimitPtl

NimitPtl commented Jul 9, 2026

Copy link
Copy Markdown
Author

Can you post the benchmark numbers as well for both gfx950 and gfx1250?

have posted the same in Test Result in description.

@NimitPtl

NimitPtl commented Jul 9, 2026

Copy link
Copy Markdown
Author

@NimitPtl The target for this PR is https://github.com/ROCm/aiter/tree/quant_gluon branch, is that on purpose or you want to merge to main?

I think it should be main, however while creating the PR, the older patch was pushed before the repository changes went into affect.
https://github.com/ROCm/aiter/pull/2994/changes is the base change on which the current change is based on. Ultimately both should go into main.

@NimitPtl

Copy link
Copy Markdown
Author

closing the moving this to #4193
consolidate changes and resolve repo permission issues.

@NimitPtl NimitPtl closed this Jul 10, 2026
@NimitPtl NimitPtl deleted the quant_gluon branch July 10, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants