Repository navigation
MiniMax-M3: allow shared-experts fusion on ROCm gfx942 and newer - #36576
Conversation
e7d3452 to
af3101e
Compare
|
Tested this on gfx942 and it does enable fusion as intended, but it causes a Environment
SymptomWith fusion enabled, the model cannot terminate an agent loop. It re-issues the same
3/3 runs identical. Prompt asks for three tools in order, then a summary; unfused it does With a more complex tool schema (array-of-number + optional params) the arguments also Reproduction
IsolationThe kernel config was a possible confound, so it was controlled for.
Three passing states are all fusion-off; both failing states are fusion-on, including one What still passes with fusion onWorth stating, because it is why this is easy to miss: single-turn generation looks Possibly related — shape mismatch in routed-experts captureIndependently, enabling
Happy to helpWe can re-test a revised patch on this hardware quickly and report back. The perf case is |
af3101e to
751185e
Compare
Lifts the CUDA-only guard on shared-experts fusion so ROCm can use it, gated at gfx942. minimax_m3_vl.py carries the same gate because the served MXFP8 checkpoint is the VL variant (model_type minimax_m3_vl) -- patching only one of the two files is a silent no-op. Deliberately does NOT include the shared-expert alternate-stream overlap that was originally bundled with this change. The alternate stream is only created when shared-experts fusion is disabled, so the two are mutually exclusive: with fusion enabled the overlap is dead code. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
get_device_capability on ROCm reports the parsed gfx number, so the (9, 4) tuple compare also admitted RDNA (gfx11xx reports (11, 0)); use is_gfx942_supported / is_gfx95_supported instead, which also avoids initializing the device context in the classmethod. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
751185e to
0d84a54
Compare
sgl-project#36557 landed `_is_gfx95_supported = _is_hip and is_gfx95_supported()`. Took main's guarded form and gave the new gfx942 constant the same shape, so both arch probes short-circuit off HIP identically instead of one guarding and one not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ated on gfx942 fusion enables but regresses multi-turn tool calling: the model re-issues identical tool calls to the turn cap and tool arguments degrade turn over turn, reproducible 3/3 with the MoE kernel config controlled for. Single-turn generation and NIAH pass, so a perplexity gate would not catch it. Narrow the gate to what was tested rather than ship the regression; gfx942 can be re-added once the cause is found. Reported by @skimanwhite on sgl-project#36576. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Pushed b3f0401 on top of the main merge: on the aiter path |
9ec3184 to
df11461
Compare
…aths On aiter, _post_process_topk_ids appends the fused shared expert itself, so asking the JIT gate for it as well wrote the shared id into two columns and dropped one routed expert (MiniMax-M3 on ROCm: 3 routed instead of 4, GSM8K-500 0.81 vs 0.88). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MATMHzpi6K7N2zkpo7mZLc
df11461 to
b3f0401
Compare
MiniMax-M3: allow shared-experts fusion on ROCm gfx942 and newer
shared_experts_fusion_disable_reasoncurrently refuses on any non-CUDA device, so ROCm never gets shared-experts fusion even where the hardware supports it. This lifts that guard and gates it at gfx942 instead.minimax_m3_vl.pycarries the identical gate.MiniMaxM3SparseForCausalLMandMiniMaxM3SparseForConditionalGenerationare separateEntryClasses with separateshared_experts_fusion_disable_reasonclassmethods, and the served MiniMax-M3-MXFP8 checkpoint is the VL variant (model_type: minimax_m3_vl, perconfigs/minimax_vl.py) — so patching only one file would be a silent no-op on the model people actually run.Measurement status — stated plainly
This PR has no benchmark or accuracy numbers of its own, and I am not claiming any.
The earlier combined change (this gate + the alternate-stream overlap + a
prefill_attention_backend=aiterserving default) measured +46.6%..+55.4% output throughput on 8x MI350X. That number belongs to the bundle, not to this PR, and decomposing it showed the input-throughput share came entirely from the serving default, not from either code change.More importantly: in every run measured, the server reported
shared_experts_fusion=Falseon both sides — the fusion this PR enables never actually engaged, because it also requires the model config and serving flags to request it. So the throughput effect of this gate specifically is unmeasured.What this PR is, therefore, is an enablement gate: it removes a platform restriction that has no reason to exist on gfx942+. It should be reviewed on that basis, and someone with a configuration that genuinely turns fusion on should measure it before it is treated as a performance change.
The serving-defaults and cookbook half is a separate change and is not part of this PR.
CI States
Latest PR Test (Base): ❌ Run #35153622399
Latest PR Test (Extra): ❌ Run #35153622200
Latest PR Test (AMD ROCm 10): ❌ Run #35153622232