Skip to content

[MiniMax-M3] optimize sparse vLLM metadata for improved performance of vllm-atom#1342

Merged
zejunchen-zejun merged 4 commits into
mainfrom
lirui/vllm_atom_m3_0624
Jul 6, 2026
Merged

[MiniMax-M3] optimize sparse vLLM metadata for improved performance of vllm-atom#1342
zejunchen-zejun merged 4 commits into
mainfrom
lirui/vllm_atom_m3_0624

Conversation

@lirui927

@lirui927 lirui927 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Motivation

Improve MiniMax-M3 sparse attention performance in the vLLM plugin path by reducing per-step metadata overhead and enabling CUDA Graph capture for the uniform single-token decode path.

Technical Details

  • Marked MinimaxM3SparseAttentionMetadataBuilder as UNIFORM_SINGLE_TOKEN_DECODE instead of disabling CUDA Graph support entirely.
  • Added a decode-only metadata fast path for max_query_len == 1, avoiding decode/prefill splitting and CPU-side max reductions for plain decode batches.
  • Reused preallocated qo_indptr for prefill metadata and replaced exact CPU-side max calculations with existing common metadata upper bounds.
  • Moved MiniMax-M3 sparse block-size validation to builder initialization.
  • Reused page-16 KV cache views between sparse KV/index insertion and sparse attention execution to avoid duplicate view setup.
  • support index cache of vLLM-ATOM

Test Plan

  • Launch MiniMax-M3 vLLM service with ATOM adapters enabled with index cache.
  • Run GSM8K accuracy validation:
    • MIXFP8
    • MIXFP4
    • MIXFP8 + kv_fp8
    • MIXFP4 + kv_fp8
  • Performance Test
MODEL=/shared/data/amd_int/models/MiniMax-M3-MXFP8
export AITER_QUICK_REDUCE_QUANTIZATION=INT4
vllm serve "$MODEL" \
    --dtype auto \
    --load-format auto \
    --host localhost \
    --port 8001 \
    --tensor-parallel-size 4 \
    --gpu-memory-utilization 0.85 \
    --max-model-len 32768 \
    --max-num-batched-tokens 32768 \
    --block-size 128 \
    --no-async-scheduling \
    --kv-cache-dtype fp8 \
    --no-enable-prefix-caching \
    --language-model-only \
    --no-trust-remote-code \
    --hf-overrides '{"use_index_cache": true, "index_topk_freq": 4}' \
    --additional-config '{"online_quant_config": {"global_quant_config": "ptpc_fp8", "exclude_layer": ["lm_head", "model.embed_tokens", "vision_tower", "multi_modal_projector", "patch_merge_mlp", "*block_sparse_moe"]}}' \
    --compilation-config '{"cudagraph_mode": "FULL_AND_PIECEWISE"}' \
    2>&1 | tee log_m3_mxfp8_vllm.log
MODEL=/shared/data/amd_int/models/MiniMax-M3-MXFP4
export AITER_QUICK_REDUCE_QUANTIZATION=INT4
vllm serve "$MODEL" \
    --dtype auto \
    --load-format auto\
    --host localhost \
    --port 8001 \
    --tensor-parallel-size 4 \
    --gpu-memory-utilization 0.85 \
    --max-model-len 32768 \
    --max-num-batched-tokens 32768 \
    --block-size 128 \
    --kv-cache-dtype fp8 \
    --no-enable-prefix-caching \
    --language-model-only \
    --no-trust-remote-code \
    --hf-overrides '{"use_index_cache": true, "index_topk_freq": 4}' \
    --compilation-config '{"cudagraph_mode": "FULL_AND_PIECEWISE"}' \
    2>&1 | tee log_m3_mxfp4_vllm_0625.log

Test Result

GSM8K accuracy

MIXFP4
image

MIXFP4-kv_fp8
image

MIXFP8
image

MIXFP8-kv_fp8
image

Performance

MIXFP4-8192-1024-16
image

Submission Checklist

@XiaobingSuper XiaobingSuper force-pushed the lirui/vllm_atom_m3_0624 branch 3 times, most recently from f9d842b to 35ec283 Compare June 24, 2026 17:52
Comment thread atom/models/minimax_m3.py Outdated
@XiaobingSuper XiaobingSuper force-pushed the lirui/vllm_atom_m3_0624 branch 3 times, most recently from 0644b27 to bc8c975 Compare June 25, 2026 09:03
Comment thread atom/plugin/vllm/attention/layer_mha.py Outdated
@XiaobingSuper XiaobingSuper force-pushed the lirui/vllm_atom_m3_0624 branch from f81cf00 to 39ebb75 Compare June 25, 2026 13:21
@XiaobingSuper XiaobingSuper marked this pull request as draft June 26, 2026 02:47
@zufayu zufayu requested review from ZhangLirong-amd and valarLip and removed request for ZhangLirong-amd June 26, 2026 06:12
@XiaobingSuper XiaobingSuper force-pushed the lirui/vllm_atom_m3_0624 branch 3 times, most recently from af91e65 to c48e269 Compare July 3, 2026 07:48
@lirui927 lirui927 changed the title Enable MiniMax-M3 vLLM plugin path [MiniMax-M3] optimize sparse vLLM metadata Jul 3, 2026
@lirui927 lirui927 changed the title [MiniMax-M3] optimize sparse vLLM metadata [MiniMax-M3] optimize sparse vLLM metadata for improved performance Jul 3, 2026
@lirui927 lirui927 changed the title [MiniMax-M3] optimize sparse vLLM metadata for improved performance [MiniMax-M3] optimize sparse vLLM metadata for improved performance of vllm-atom Jul 3, 2026
lirui927 and others added 2 commits July 3, 2026 15:13
Co-authored-by: Cursor <cursoragent@cursor.com>
Mirror MiniMax-M3 index-cache overrides into text_config and share sparse topk cache across vLLM sparse layers by phase so skip layers reuse the correct refresh result.

Co-authored-by: Cursor <cursoragent@cursor.com>
@XiaobingSuper XiaobingSuper force-pushed the lirui/vllm_atom_m3_0624 branch from c48e269 to 8b31189 Compare July 4, 2026 14:05
@lirui927 lirui927 marked this pull request as ready for review July 6, 2026 02:06
@XiaobingSuper XiaobingSuper self-requested a review July 6, 2026 02:12
XiaobingSuper
XiaobingSuper previously approved these changes Jul 6, 2026
Document the quick-reduce quantization setting needed by the MiniMax-M3 vLLM examples.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread atom/plugin/vllm/attention/metadata.py Outdated
Route pure multi-token decode batches through the MiniMax-M3 sparse decode metadata path so MTP/spec verification preserves decode semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
@zejunchen-zejun zejunchen-zejun merged commit 7c09c2e into main Jul 6, 2026
12 checks passed
@zejunchen-zejun zejunchen-zejun deleted the lirui/vllm_atom_m3_0624 branch July 6, 2026 07:00
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.

7 participants