Skip to content

[Fix] MiMo-V2: accept checkpoints with the split attention layout - #40978

Merged
alexnails merged 2 commits into
mainfrom
jiajun/mimo-v2-accept-split-layout
Oct 8, 2026
Merged

alexnails merged 2 commits into
mainfrom
jiajun/mimo-v2-accept-split-layout

Conversation

@guapisolo

@guapisolo guapisolo commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

MiMo-V2 checkpoints with separate q/k/v projections now load.

Symptom & Reproduction

  • Symptom: a MiMo-V2 checkpoint with split q_proj/k_proj/v_proj stops at model-config validation with ValueError: MiMoV2 hf_config has unsupported attention_projection_layout='split'; expected 'fused_qkv' or unset.
  • Reproduction: convert XiaomiMiMo/MiMo-V2.6-Flash-RL to BF16 split q/k/v with no attention_projection_layout in config.json, then run python -m sglang.launch_server --model-path <split checkpoint> --trust-remote-code --tp 4; expected: the server starts; observed: the error above.

Root Cause

  1. MiMoV2Config fills attention_projection_layout="split" when config.json omits it.
  2. get_mimo_v2_fused_qkv_expected_tp_size (model_config.py:122) returns early only for None.
  3. Every value other than fused_qkv then raises ValueError, so split checkpoints never load.

Fix

Treat "split" like an unset layout. Split projections already load through the stacked-params path of MiMoV2ForCausalLM.load_weights (("qkv_proj", "q_proj", "q")), and the fused-qkv TP constraint does not apply to them. fused_qkv checkpoints and unknown values behave as before.

Verification

  • Rebased the two existing commits onto main at c389cbaf99 without conflicts; no new test results are claimed for the rebased head.
  • Historical pre-rebase report: pre-commit on model_config.py passed on the previous head; it has not been rerun on this rebased head.

Historical sglang-miles report (#40977): the same patch loaded and served BF16 split MiMo-V2.6-Flash-RL conversions (4-layer partial and full model) through Miles colocated RL. This does not validate the rebased main head.

  • test/registered/unit/configs/test_model_config.py (CPU) and test/registered/e2e/models/test_mimo_v2_flash.py (8-GPU H200): pending targeted CI runs after publication. Existing tests do not specifically cover the converted MiMo-V2.6 split checkpoint.
  • No unit test added. Required PR CI has not passed on the rebased head.

Review Focus

  • get_mimo_v2_fused_qkv_expected_tp_size: returning None for split must not skip a TP check that split checkpoints need.

Generated with Claude Code


CI States

Latest PR Test (Base): ❌ Run #37603000643
Latest PR Test (Extra): ❌ Run #37603000386
Latest PR Test (AMD ROCm 10): ❌ Run #37603000634

MiMoV2Config fills attention_projection_layout="split" when a checkpoint omits
the field, so every split q/k/v checkpoint was rejected. Split projections load
through the stacked-params path; treat "split" like an unset layout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
guapisolo added a commit that referenced this pull request Sep 29, 2026
ziang-and pushed a commit to zianglih/sglang that referenced this pull request Oct 2, 2026
… graph registration (sgl-project#40648, sgl-project#40978, sgl-project#40979, sgl-project#40980, sgl-project#40977, sgl-project#41972)

Retain colocated training fixes above the release MiMo implementation, including address-stable Marlin reload and mandatory TopK layer IDs. Disable NCCL graph registration for TP LM-head all-to-all and pausable graph pools.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
The `layout in (None, "split")` condition and the ValueError text already
name the accepted layouts; the PR body records why "split" needs no
fused-qkv TP check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@guapisolo
guapisolo force-pushed the jiajun/mimo-v2-accept-split-layout branch from 31360f9 to 15bbf29 Compare October 7, 2026 09:47
@guapisolo

Copy link
Copy Markdown
Collaborator Author

/rerun-test test/registered/unit/configs/test_model_config.py test/registered/e2e/models/test_mimo_v2_flash.py

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🚀 ubuntu-latest (1 test): ✅ View workflow run

cd test/ && python3 registered/unit/configs/test_model_config.py

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

cd test/ && python3 registered/e2e/models/test_mimo_v2_flash.py

@alexnails
alexnails merged commit 9946339 into main Oct 8, 2026
110 of 126 checks passed
@alexnails
alexnails deleted the jiajun/mimo-v2-accept-split-layout branch October 8, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants