Repository navigation
[Bugfix][MoE] Fix MiniMax-M3.1 NVFP4 experts failing to load on Hopper - #64932
Open
ischencheng wants to merge 1 commit into
Open
ischencheng wants to merge 1 commit into
ischencheng wants to merge 1 commit into
Conversation
MiniMax-M3.1's NVFP4 experts always declare a per-token FC1 scheme. On SM90 the auto selection puts Humming first, and Humming runs these weights as W4A16, so make_nvfp4_moe_kernel raised "Per-token NVFP4 activation scales are not supported by HUMMING" at load. Treat Humming like Marlin when its quant config has no activation dtype. Add an SM90 test that builds the experts through ModelOptMxFp8Config with the per-token QAT key on Humming and Marlin and checks them against a dequantized reference, and run it in an H100 CI step. The recipe's Hopper strategy now pins --moe-backend marlin like its serve command, and the Hopper notes say the experts run as W4A16 on Humming when no MoE backend is given. Signed-off-by: Chen Cheng <85005591+ischencheng@users.noreply.github.com>
ischencheng
requested review from
Harry-Chen,
bnellnm,
khluu,
mgoin,
pavanimajety,
wzhao18 and
zyongye
as code owners
October 31, 2026 23:27
Contributor
This branch was successfully deployed
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.
Overview
MiniMax-M3.1-Flash fails to load on Hopper unless
--moe-backend marlinis passed:Its NVFP4 experts always declare a per-token FC1 scheme (#64111). On SM90 the auto selection puts Humming first (#56997), and Humming runs NVFP4 experts as W4A16 there.
make_nvfp4_moe_kernelalready drops the per-token metadata for Marlin W4A16. This PR does the same for Humming when its quant config has no activation dtype.The recipe's Hopper serve command pins
--moe-backend marlinand already loads. Its Hopper strategy didn't pass that flag, so this PR adds it there, and the Hopper notes now say the experts run as W4A16 on Humming when no MoE backend is given. No open PR or issue covers this.Claims
--moe-backend humming.Validation
New test
tests/kernels/moe/test_minimax_m3_hopper_nvfp4_moe.py, on 1x H100. It builds the experts the way M3.1 does (ModelOptMxFp8Configwith NVFP4 MoE,qat_activation_key=kNvfp4DynamicToken), loads a random NVFP4 checkpoint, and compares the forward against a dequantized reference. It runs in a new H100 CI step.[humming]ValueError: Per-token NVFP4 activation scales are not supported by HUMMING.[marlin]Real weights through
LLMon 1x H200: MiniMax-M3.1-Flash cut to its first 4 layers (3 dense, 1 NVFP4 MoE;hf_overrides={"text_config": {"num_hidden_layers": 4}}, only the 3 shards holding them on disk), TP1, the recipe's Hopper flags, greedy 16 tokens with top-5 logprobs on 4 prompts. Same nightly2b009fcwith main564ac0d's Python on top, the fixed run plus this PR:--moe-backend marlinA 4-layer cut doesn't produce text (both arms repeat one token), so this run checks real-weight loading and that the two W4A16 backends agree.
Decode on the full layer count, 1x H200 with the MiniMax-M3.1-Flash config cut to one TP8 rank's shapes (8 q heads, 1 KV and index head, FFN widths and vocab / 8, all 60 layers and 128 experts, dummy weights) and the recipe's Hopper flags. Both rows run nightly
2b009fcwith main564ac0d's Python on top, the second one plus this PR:--moe-backend marlinDecode is 4K-token prompts, 192 output tokens, greedy. Dummy weights make the outputs meaningless, so these runs only show that the model loads and decodes on each backend.
I haven't run the full checkpoint on Hopper (the recipe uses 8x H200), so there is no accuracy eval for M3.1 here. CI has no small M3.1 checkpoint for an
LLM-level test, so the CI test works at the experts level and the 4-layer real-weight run above is local.Commands
Details
ModelOptMxFp8Configbuilds M3.1's experts with the model'sqat_activation_key(kNvfp4DynamicToken) on every platform, soper_token_activationis set on Hopper too.quant_dtype is Nonewhen it runs A16. For Marlin's NVFP4 config that is the same check asuse_nvfp4_w4a16.nvfp4_per_tokenoverride doesn't reach this code on Hopper.ModelOptNvFp4FusedMoErejects any backend other than FlashInfer TRTLLM first.AI assistance (Claude Code) was used. I reviewed the change and ran the tests above.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.