Repository navigation
[Triton/Gluon] Fix MXFP4 and MXFP8 fallback for older Triton - #6181
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
azaidy
left a comment
There was a problem hiding this comment.
- The probe runs on every quant call
_has_scaled_downcast() is called at quant.py:318 and quant.py:530. It is a per-call from ... import plus three getattr. You could add @functools.lru_cache(maxsize=1) to _has_scaled_downcast.
- The import inside the probe is unguarded. [verified]
quant.py:50 does from triton.experimental.gluon import language as gl with no try. On a Triton with no triton.experimental.gluon module at all, this raises ImportError and the fallback does not happen.
Wrap the import in the same try/except and return False.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The public docstrings do not document the newly added Gluon prerequisite.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds runtime feature detection so older Triton 3.8 builds fall back to Triton quantization kernels when Gluon’s scaled_downcast is unavailable.
Changes:
- Adds a cached
scaled_downcastcapability probe. - Gates MXFP4/MXFP8 Gluon dispatch on that capability.
| File | Description |
|---|---|
aiter/ops/triton/quant/quant.py |
Adds capability-aware quantization backend selection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

scaled_downcastis not available on triton3.8 release (it is available on upstream triton that is considered 3.8 still). Considering 3.8 is pretty new, we need to support it.