Repository navigation
[Perf] minimax-sparse: Speed up MiniMax-M3 sparse attention on Hopper - #46135
Conversation
This comment has been minimized.
This comment has been minimized.
|
/rerun-test test/registered/kernels/ops/attention/test_minimax_sparse_flash_with_topk_idx.py test/registered/kernels/ops/attention/test_minimax_sparse_decode_paged_tile.py test/registered/kernels/ops/attention/test_minimax_sparse_fp8_attn_gemm.py test/registered/kernels/ops/attention/test_minimax_decode_topk_page_table.py test/registered/kernels/ops/attention/test_minimax_sparse_gqa.py test/registered/kernels/ops/kvcache/test_minimax_store_kv_index.py |
|
🚀 🚀 |
Co-authored-by: zijiexia <37504505+zijiexia@users.noreply.github.com> Co-authored-by: Chunan Zeng <zcnrex@gmail.com>
6769a84 to
691a025
Compare
|
/rerun-test test/registered/kernels/ops/attention/test_minimax_sparse_flash_with_topk_idx.py test/registered/kernels/ops/attention/test_minimax_sparse_decode_paged_tile.py test/registered/kernels/ops/attention/test_minimax_sparse_fp8_attn_gemm.py test/registered/kernels/ops/attention/test_minimax_decode_topk_page_table.py test/registered/kernels/ops/attention/test_minimax_sparse_gqa.py test/registered/kernels/ops/kvcache/test_minimax_store_kv_index.py |
|
🚀 🚀 |
|
/rerun-test test/registered/kernels/ops/attention/test_minimax_sparse_fp8_attn_gemm.py test/registered/kernels/ops/kvcache/test_minimax_store_kv_index.py test/registered/kernels/benchmark/kvcache/bench_minimax_store_kv_index.py |
|
🚀 🚀 |
|
/run-full-ci |
|
/rerun-failed-ci |
Conflict in minimax_sparse/decode/topk_sparse.py: main (sgl-project#46135) ported the MiniMax sparse kernels off block pointers and replaced the stale block_size autotune key with BLOCK_SIZE_N, which supersedes this branch's key fix, so take main's version of the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main (sgl-project#46135) ported the MiniMax sparse kernels off block pointers, so minimax_sparse no longer needs the shim. Only the FLA kernels use it now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Faster MiniMax-M3 sparse attention on Hopper: Triton decode and prefill kernels with tiled block pointers (Triton >= 3.9), fp16-widened decode for fp8 KV on the paged path, and a fused bf16-to-fp8 cast in the fused K/V/index store.
Changes to existing code
fp8_e4m3KV, the sparse index K cache is stored in fp8 (it was bf16 unless fp8 attention GEMMs were on). Other platforms keep the previous dtype.Verification
test_minimax_sparse_fp8_attn_gemm.py88 passed; the fused store cast is bit-exact againstx.float().clamp(-448, 448).to(torch.float8_e4m3fn).--kv-cache-dtype fp8_e4m3, sgl-eval 0.1.3, this PR vs. fp16 widening disabled:The between-arm per-question divergence and correctness flips are within the run-to-run noise of either arm.
Cut from #45925 (MiniMax-M3.1-Flash support) at 10e655a.
CI States
Latest PR Test (Base): 🚫 Run #40114646995
Latest PR Test (Extra): ✅ Run #40114646930
Latest PR Test (AMD ROCm 10): ❌ Run #40114646909