Skip to content

feat: Support nvidia/MiniMax-M3-NVFP4 - #31989

Merged
kpham-sgl merged 2 commits into
sgl-project:mainfrom
trevor-m:m3-fp4
Jul 30, 2026
Merged

kpham-sgl merged 2 commits into
sgl-project:mainfrom
trevor-m:m3-fp4

Conversation

@trevor-m

@trevor-m trevor-m commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

Fixes #31827

Similar to nvidia/DeepSeek-V4-NVFP4, nvidia/MiniMax-M3-NVFP4 is a hybrid quantized model with only certain layers in NVFP4. This time the MoE routed experts are in NVFP4 and other layers in MXFP8. We didn't handle the MXFP8 layers properly.

Example command:

sglang serve --model-path nvidia/MiniMax-M3-NVFP4 --trust-remote-code --tp 8 --context-length 2048 --mem-fraction-static 0.79

Modifications

  • Use flashinfer_trtllm_routed as the default moe runner backend for MiniMax-M3-NVFP4
  • Support gemm1_alpha and gemm1_beta for flashinfer trtllm moe
  • Support MXFP8 layers in "modelopt_mixed" mixed precision models
  • Since the shared experts and routed experts use different precisions, disable shared expert fusion
  • Map "block_sparse_moe" -> "mlp" prefix
  • Add test for weight loading changes

Accuracy Tests

sglang serve --model-path nvidia/MiniMax-M3-NVFP4 --trust-remote-code --tp 8 --context-length 2048 --mem-fraction-static 0.79
python3 benchmark/gsm8k/bench_sglang.py --num-shots 8 --num-questions 1209 --parallel 1209 --platinum
Accuracy: 0.925
Invalid: 0.000
Latency: 64.975 s
Output throughput: 1762.121 token/s

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): ❌ Run #30497847724
Latest PR Test (Extra): ❌ Run #30497847531

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@b8zhong

b8zhong commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

/rerun-test test/registered/unit/model_loader/test_modelopt_loader.py

@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test/registered/unit/model_loader/test_modelopt_loader.py:

🚀 1-gpu-5090 (1 test): ✅ View workflow run

cd test/ && python3 registered/unit/model_loader/test_modelopt_loader.py

@trevor-m trevor-m changed the title fewat: Support nvidia/MiniMax-M3-NVFP4 feat: Support nvidia/MiniMax-M3-NVFP4 Jul 22, 2026
@trevor-m

Copy link
Copy Markdown
Collaborator Author

@b8zhong Thanks for reviewing, can this be merged?

@nvpohanh nvpohanh added the bug Something isn't working label Jul 29, 2026
@nvpohanh

Copy link
Copy Markdown
Collaborator

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Jul 29, 2026
@trevor-m
trevor-m requested a review from mmangkad as a code owner July 29, 2026 22:56
@kpham-sgl

Copy link
Copy Markdown
Collaborator

/rerun-failed-ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working quant LLM Quantization run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MiniMax-M3 NVFP4 fails to load: fused MoE falls back to UnquantizedFusedMoEMethod (6144 vs 3072) and MXFP8 linear scales are dropped

4 participants