Skip to content

[Fix] Route asymmetric-KV models to fa4 on SM100 and pin MiMoV2 FP8 MoE to flashinfer_trtllm - #32818

Merged
hnyls2002 merged 2 commits into
mainfrom
lsyin/asym-kv-attn-dispatch
Jul 29, 2026
Merged

hnyls2002 merged 2 commits into
mainfrom
lsyin/asym-kv-attn-dispatch

Conversation

@hnyls2002

@hnyls2002 hnyls2002 commented Jul 29, 2026 •

Copy link
Copy Markdown
Collaborator

MiMo-V2.5 cannot be deployed on SM100/SM103 with default flags (#31243). The SM100 auto-dispatch picks trtllm_mha, whose paged-KV kernel requires equal K/V row widths, but MiMoV2 has asymmetric KV (head_dim 192, v_head_dim 128), so decode CUDA-graph capture aborts with Check failed: key_cache.size(i) == value_cache.size(i) (37074 vs. 24716). The reporter had to fall back to triton with CUDA graphs disabled.

Three changes:

  1. ModelConfig.has_asymmetric_kv — new property (head_dim != v_head_dim or swa_head_dim != swa_v_head_dim). A property rather than an __init__ field because the MLA special-casing further down still rewrites v_head_dim.
  2. _get_default_attn_backend — on SM100, asymmetric-KV MHA models now resolve to fa4, which carries v_head_dim through, instead of trtllm_mha. This is a capability check, not a model special case; MLA models are asymmetric by construction but resolve through the separate MLA branch and are unaffected.
  3. _mimo_v2_overrides — on SM100 with an FP8 checkpoint and moe_runner_backend still auto, pin flashinfer_trtllm. Left on auto the MoE falls through to the triton fused-MoE runner (auto only selects DeepGEMM when the a2a backend is DeepEP / Mooncake / NIXL). Gated on fp8 because the FP4 checkpoints run through flashinfer_mxfp4 instead.

Also updates the cookbook, whose base-variant Blackwell recipe emitted neither flag while the Pro recipe emitted both.

Measured on MiMo-V2.5 (310B) TP=4, bs=1 decode, --speculative-algorithm EAGLE --speculative-num-steps 3 --speculative-eagle-topk 1 --speculative-num-draft-tokens 4 --enable-multi-layer-eagle:

MoE runner tok/s accept_length
triton (previous auto result) 315.7 2.88
flashinfer_trtllm 353.0 2.94

+11.8% output throughput (~+9.6% after discounting the 2.1% higher accept length).

Verification: a launch command carrying no backend flags at all now resolves to attention_backend='fa4', moe_runner_backend='flashinfer_trtllm', page_size=128 and serves correctly, with generated tokens identical to passing both flags explicitly. test_model_overrides.py 67 passed.


CI States

Latest PR Test (Base): ❌ Run #30495495475
Latest PR Test (Extra): ❌ Run #30495495333

@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.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 29, 2026
@mintlify

mintlify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
lmsysorg 🟢 Ready View Preview Jul 29, 2026, 10:13 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
lmsysorg 🟡 Building – Jul 29, 2026, 10:11 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@hnyls2002

Copy link
Copy Markdown
Collaborator Author

/rerun-test test_model_overrides.py test_model_config_shapes.py test/registered/models_e2e/test_mimo_v2.py test/registered/models_e2e/test_mimo_v2_flash.py

@github-actions

github-actions Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test_model_overrides.py test_model_config_shapes.py test/registered/models_e2e/test_mimo_v2.py test/registered/models_e2e/test_mimo_v2_flash.py:

🚀 ubuntu-latest (2 tests): ✅ View workflow run

cd test/ && python3 registered/unit/test_model_overrides.py
cd test/ && python3 registered/unit/configs/test_model_config_shapes.py

🚀 8-gpu-h200 (2 tests): ✅ View workflow run

cd test/ && python3 registered/models_e2e/test_mimo_v2.py
cd test/ && python3 registered/models_e2e/test_mimo_v2_flash.py

@hnyls2002
hnyls2002 merged commit e5c46ff into main Jul 29, 2026
107 of 123 checks passed
@hnyls2002
hnyls2002 deleted the lsyin/asym-kv-attn-dispatch branch July 29, 2026 23:37
saturn-acc pushed a commit to saturn-acc/sglang that referenced this pull request Aug 16, 2026
Atituiset pushed a commit to Atituiset/sglang that referenced this pull request Sep 10, 2026

This branch was successfully deployed

1 active deployment
staging - docs_new — 69706a6d Deployed Jul 29, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant