Skip to content

[Triton/Gluon] Fix MXFP4 and MXFP8 fallback for older Triton - #6181

Merged
azaidy merged 3 commits into
mainfrom
vinayak/fix-6176
Oct 6, 2026
Merged

azaidy merged 3 commits into
mainfrom
vinayak/fix-6176

Conversation

@vgokhale

@vgokhale vgokhale commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

scaled_downcast is 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.

@github-actions

github-actions Bot commented Oct 6, 2026

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 (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
multigpu Aiter multi-GPU tests on the 8-GPU runner
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 6181 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

@vgokhale
vgokhale marked this pull request as ready for review October 6, 2026 18:07
@vgokhale
vgokhale requested a review from a team October 6, 2026 18:07
@github-actions github-actions Bot changed the title Fix MXFP4 and MXFP8 fallback for older Triton [Triton/Gluon] Fix MXFP4 and MXFP8 fallback for older Triton Oct 6, 2026
@vgokhale
vgokhale requested a review from NimitPtl October 6, 2026 18:08

@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.

  1. 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.

  1. 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.

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.

Copilot review overview

🟡 Changes recommended

The public docstrings do not document the newly added Gluon prerequisite.

Review effort: Balanced
Findings: 1 Low severity

Open (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_downcast capability 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.

Comment thread aiter/ops/triton/quant/quant.py Resolved

@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.

[Triton/Gluon] dynamic_mxfp4_quant defaults to Gluon kernel using gl.amd.cdna4.scaled_downcast, breaks on older Triton (Kimi-K2.5 MXFP4 sglang CI)

3 participants