Repository navigation
fix(moe): keep the triton casts in mxfp8 prefill when triton's ptx is older than 9.2 - #955
Merged
jason-fxz merged 1 commit intoNov 26, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The MXFP8 prefill kernel from #954 takes the inline
cvt.rn.bf16x2.e4m3x2path on every sm_100+ GPU, but that instruction needs PTX ISA 9.2 (ptxas 13.2 or later). Triton writes the PTX version its sm_100+ ptxas supports, and importing flashinfer points that ptxas at the one on PATH whenever it is CUDA 13 or later (flashinfer/triton/__init__.py,_patch_triton_ptxas_blackwell). docs/install.md asks for a CUDA 13 toolkit withnvccon PATH; with 13.0 there, Triton writes.version 9.0, and every MXFP8 expert prefill on sm_120 (RTX 50, RTX PRO 6000) fails in ptxas:This keeps the Triton casts unless the PTX Triton writes for sm_100+ is 9.2 or later. The two paths give the same bits (#954 says so, and the table below checks it), so only the speed differs.
No test is added: with a CUDA 13.0 ptxas the existing
test_mxfp8_moe_matches_dequant_referencecases are the red and green below.Results
RTX PRO 6000 Blackwell Server Edition (sm_120), driver 620.70.06, torch 2.14.1+cu130, Triton 3.8.0, flashinfer 0.6.18.post1, CUDA 13.0.88 toolkit on PATH. "system" is Triton's sm_100+ ptxas as flashinfer leaves it (
/usr/local/cuda/bin/ptxas, 13.0, PTX 9.0); "bundled" setsTRITON_PTXAS_BLACKWELL_PATHto Triton's ownptxas-blackwell(13.3, PTX 9.3).pytest tests/kernels/test_mxfp8_linear.py tests/kernels/test_e4m3_compat.py tests/moe/test_mixed_expert_formats.py tests/moe/test_cpu_moe.py -m "not slow":3cdcc80test_mxfp8_moe_matches_dequant_referencecases andtest_mixed_layers_decode_and_prefill_through_their_poolsfused_experts_mxfp8on Inkling-2-Mini's expert shape (128 experts, top-8, hidden 2304, intermediate 1152), random banks, eager, median of 15 timed runs, us:So where Triton's sm_100+ ptxas is older than 13.2, the MXFP8 expert GEMMs take about 8.5% longer at 2048 and 8192 tokens, instead of failing.
No model reader on main emits MXFP8 experts yet; the first is Inkling-2-Mini in #942. On #942 (
908cf43), with the container's CUDA 13.0 ptxas,LLM("thinkingmachines/Inkling-2-Mini", moe_strategy="fused", max_running_req=2, max_seq_len_override=8192, memory_ratio=0.9, cuda_graph_max_bs=2, moe_collect_stats=True)fails in the warmup prefill with the ptxas error above. With this commit on top of #942's3314730it loads (expert banks: mxfp8 / triton on 4 of 24 MoE layers), and the free-running parity against the transformers reference on four prompts (26 to 3993 tokens, one with an image;LLM("thinkingmachines/Inkling-2-Mini", moe_strategy="fused", max_running_req=2, max_seq_len_override=16384, cuda_graph_max_bs=2)) gives the same per-layer errors, logits and greedy tokens as with Triton's own ptxas. The 3993-token prompt's TTFT is 0.587 s, 0.584 s with Triton's own ptxas in another container. The containers report no CPU model name.Not run on sm_100, and not with a CUDA 13.1 or 13.2 toolkit.