Repository navigation
[Feat] attention: Add the MSA-v1 sparse backend and NVFP4 KV pool - #46141
Conversation
This comment has been minimized.
This comment has been minimized.
|
/rerun-test --changed |
|
🚀 🚀 🚀 |
Co-authored-by: zhongyu <[email protected]> Co-authored-by: Denji-kk <[email protected]> Co-authored-by: Thanhhao <[email protected]> Co-authored-by: Hao Phan <[email protected]> Co-authored-by: Shuwen Wang <[email protected]> Co-authored-by: Qiaolin Yu <[email protected]> Co-authored-by: Yuhao Yang <[email protected]>
Co-authored-by: Chunan Zeng <[email protected]>
Co-authored-by: Chunan Zeng <[email protected]> Co-authored-by: zhongyu <[email protected]> Co-authored-by: Denji-kk <[email protected]> Co-authored-by: Qiaolin Yu <[email protected]>
Co-authored-by: Chunan Zeng <[email protected]> Co-authored-by: Denji-kk <[email protected]>
Co-authored-by: zhongyu <[email protected]> Co-authored-by: Thanhhao <[email protected]> Co-authored-by: Hao Phan <[email protected]> Co-authored-by: Denji-kk <[email protected]> Co-authored-by: Shuwen Wang <[email protected]> Co-authored-by: Qiaolin Yu <[email protected]>
517ba40 to
6f80024
Compare
|
/rerun-test --changed |
|
🚀 🚀 🚀 |
# Conflicts: # python/sglang/srt/layers/layer_boundary/fusions/custom_all_reduce_fusion.py # test/registered/unit/layer_boundary/test_custom_all_reduce_fusion.py
|
/rerun-test registered/kernels/ops/attention/test_minimax_m31_msa_plan.py registered/kernels/ops/attention/test_minimax_m31_page_row_views.py registered/kernels/ops/attention/test_minimax_qknorm_rope.py registered/kernels/ops/attention/test_msa_v1_decode_plan.py registered/kernels/ops/kvcache/test_minimax_m31_nvfp4.py registered/unit/layers/attention/test_minimax_sparse_nvfp4_idle.py registered/unit/model_executor/test_pool_configurator.py registered/unit/model_executor/test_hisparse_pool_configurator.py registered/unit/model_executor/test_kv_canary_headroom.py registered/unit/mem_cache/test_kv_cache_configurator_draft_gate.py registered/unit/mem_cache/test_hisparse_max_token_pool_size.py registered/unit/mem_cache/test_dsa_pool_host_unit.py registered/unit/mem_cache/test_asymmetric_mha_pool_host_unit.py registered/kernels/ops/kvcache/test_hicache_strided_device_rows.py registered/unit/test_split_attention_backend_decisions.py registered/unit/layers/test_radix_attention_padded_extend.py registered/kernels/ops/attention/test_minimax_m3_qk_norm_rope.py registered/kernels/ops/attention/test_minimax_sparse_fp8_attn_gemm.py registered/kernels/ops/attention/test_minimax_sparse_gqa.py |
|
🚀 🚀 🚀 🚀 ⛔ |
…stry msa_plan.py's capability probe reads envs.SGLANG_DISABLE_MSA_V1_Q8KV4, but the name was never registered in sglang/srt/environ.py, and Envs has no __getattr__, so the read raises AttributeError. The probe runs inside MiniMaxSparseNvfp4AttnBackend.__init__, so constructing the backend (sgl-project#46141, two days old) crashes before the FP8 fallback can be selected. The existing unit test constructs the backend via __new__ and never runs __init__, which is why this did not fail in review. Register the field next to SGLANG_DISABLE_MSA, and add a registry completeness test to test_environ.py that collects every envs.<NAME> read made through bindings of sglang.srt.environ.envs (plain or aliased) and fails if any has no registration, so the next unregistered reference fails in CPU CI instead of at backend construction.
…mily + S-EXT1 + riders + S-RACE + LLGUARD/ENVREG), S-EXT1 and S-RACE items CLOSED, entry-256's raw-env deviation and LL-vs-PCIe-IPC collision warning both marked CLOSED with the BOOT_DELTA (h') needle in landing terms, sgl-project#35617 left as the sole FAM-A7 survivor, sgl-project#44732 re-pointed to the operator's merge-sgl-project#5 answer, and the KV-ROUTE DECISION RECORD added (HOLD NVFP4-KV until armed PCIe-IPC is measured post-merge; preferred-if-ever sequence merge -> sgl-project#43356-delta -> sgl-project#46452 NOT sgl-project#43240 -> optional sgl-project#43471 -> fork BUILD-A QSA FP4 reads (template sgl-project#38724) -> BUILD-B L3 scale sidecar -> one GPU window; sgl-project#46141 template, sgl-project#44462 NEXT, MXFP4 declined, entry-247 re-sync watch-string modelopt_e4m3_k32)
Summary
The MSA-v1 sparse attention backend on the NVFP4 KV pool for MiniMax-M3.1: main KV and index K stored as NVFP4 page rows, Q8KV4 decode indexer with an FP8 fallback, MSA-v1 prefill, and pool sizing. It also adds an FP8 Q epilogue to the grouped QK-norm/RoPE kernel.
Changes to existing code
minimax_m3_nvfp4KV stack.minimax_m3_nvfp4.allocate_attention_outputssizes the sparse output by the V dtype (bf16 when V is FP8) instead of the Q dtype, so an FP8 Q from the QK-norm epilogue does not make the output FP8. Only MiniMax-M3 reaches the sparse branch.PageRowBufferInfoin the device pool info union.Verification
Cut byte-for-byte from #45925 (MiniMax-M3.1-Flash support) at 10e655a.
CI States
Latest PR Test (Base): 🚫 Run #40194769653
Latest PR Test (Extra): 🚫 Run #40194769621
Latest PR Test (AMD ROCm 10): ❌ Run #40194769625