Skip to content

[ROCm]Enable AITER MoE backend for MiniMax-M3-MXFP4 - #46419

Merged
vllm-bot merged 11 commits into
vllm-project:mainfrom
qli88:qiang_minimax_mxfp4_aiter
Jun 26, 2026
Merged

vllm-bot merged 11 commits into
vllm-project:mainfrom
qli88:qiang_minimax_mxfp4_aiter

Conversation

@qli88

@qli88 qli88 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

[ROCm][feature] Enable MiniMax-M3-MXFP4 with AITER MoE

This feature requires AITER version bump (latest version).

Accuracy test:

  1. vLLM server start: VLLM_ROCM_USE_AITER=1 VLLM_ROCM_USE_AITER_MOE=1 VLLM_USE_BREAKABLE_CUDAGRAPH=0 vllm serve /data/amd-MiniMax-M3-MXFP4/ --block-size 128 -tp 8 --attention-backend TRITON_ATTN --tool-call-parser minimax_m3 --enable-auto-tool-choice --reasoning-parser minimax_m3 --moe-backend aiter
  2. gsm8k:
    lm_eval
    --model local-chat-completions
    --model_args "model=/data/amd-MiniMax-M3-MXFP4/,base_url=http://127.0.0.1:8000/v1/chat/completions,num_concurrent=32,max_gen_toks=16384"
    --tasks gsm8k
    --num_fewshot 5
    --batch_size 1
    --apply_chat_template
    --fewshot_as_multiturn
Tasks Version Filter n-shot Metric Value Stderr
gsm8k 3 flexible-extract 5 exact_match 0.9401 ± 0.0065
strict-match 5 exact_match 0.9409 ± 0.0065

@mergify mergify Bot added the rocm Related to AMD ROCm label Jun 22, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Jun 22, 2026
@@ -305,6 +305,7 @@ def __init__(
top_k=config.num_experts_per_tok,
hidden_size=config.hidden_size,
intermediate_size=config.intermediate_size,
intermediate_pad=0,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this special case necessary for minimax?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid 'pad-skipping' accuracy issue in this version of AITER. I will submit an issue on AITER side and after it is resolved, I will remove this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qli88 hidden_pad is not used at all. Let's not include it. Just introduce intermediate_pad will do.

@Fangzhou-Ai

Copy link
Copy Markdown
Collaborator

Do we have any perf gain regarding this PR?

@qli88
qli88 force-pushed the qiang_minimax_mxfp4_aiter branch from 343d686 to 8922e38 Compare June 22, 2026 22:29
@Fangzhou-Ai

Fangzhou-Ai commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Update my perf result on 8 MI355X
ISL/OSL 8k1k conc=4

============ Serving Benchmark Result ============
Successful requests:                     40        
Benchmark duration (s):                  86.71     
Total input tokens:                      294213    
Total generated tokens:                  36805     
Request throughput (req/s):              0.46      
Output token throughput (tok/s):         424.44    
Total Token throughput (tok/s):          3817.31   
---------------Time to First Token----------------
Mean TTFT (ms):                          274.54    
Median TTFT (ms):                        256.45    
P90 TTFT (ms):                           272.89    
P99 TTFT (ms):                           603.19    
P99.9 TTFT (ms):                         677.08    
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          8.92      
Median TPOT (ms):                        8.97      
P90 TPOT (ms):                           9.11      
P99 TPOT (ms):                           9.15      
P99.9 TPOT (ms):                         9.16      
---------------Inter-token Latency----------------
Mean ITL (ms):                           8.92      
Median ITL (ms):                         8.34      
P90 ITL (ms):                            8.39      
P99 ITL (ms):                            8.51      
P99.9 ITL (ms):                          226.08    
----------------End-to-end Latency----------------
Mean E2EL (ms):                          8468.78   
Median E2EL (ms):                        8354.85   
P90 E2EL (ms):                           9269.13   
P99 E2EL (ms):                           9645.25   
P99.9 E2EL (ms):                         9683.83   
==================================================

@Fangzhou-Ai

Fangzhou-Ai commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This PR is NOT ready to merge @tjtanaa until aiter version is bumped to v0.1.15.post3

hidden_dim_unpadded: int | None = None
# Defaults to intermediate_size_per_partition if not specified.
intermediate_size_per_partition_unpadded: int | None = None
# Model specific override

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this padding and unpadding logic. How different is this padding frome the existing field?
@qli88

@BowenBao I remember AMD added this arguments for GPTOSS and is not used by other platform. So will need an explanation about the need to add more arguments.

CC @dllehr-amd

@BowenBao BowenBao Jun 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik the "xxx_unpadded" args was genuine and not GPTOSS only. Padding is essential to cover any model with shape not divisible by group size / tp size. It wasn't AMD specific as well.

That said this is good point, the pad value can be calculated from hidden_dim - hidden_dim_unpadded, so seems redundant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to provide a model specific padding size to override "hidden_dim - hidden_dim_unpadded". This very case is to circumvent an AITER issue which will cause accuracy issue when performing pad-skipping calculations. I will create an issue on AITER side and will revisit this after that issue gets resolved.

@Rohan138 Rohan138 Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI for NV the padding is handled by the FI kernels, see: #30647; AITER handles padding for some backends (FlyDSL and Triton) but not CK/CKTile, would be nice to have all of it handled by AITER and remove the AMD-specific padding bits from vLLM

Comment thread vllm/model_executor/layers/fused_moe/experts/rocm_aiter_moe.py Outdated
@fxmarty-amd

Copy link
Copy Markdown
Contributor

Along with EMULATION backend, the AITER MXFP4 MOE backend is the only correct one to run https://huggingface.co/amd/MiniMax-M3-MXFP4, so this PR is quite important.

The current backend TRITON_UNFUSED does not apply activation QDQ, so it does not really apply config.json that requests activation quantization. It could be supported in the future (maybe in #46491)

@tjtanaa tjtanaa added the ready ONLY add when PR is ready to merge/full CI is needed label Jun 24, 2026
Comment thread vllm/model_executor/layers/fused_moe/layer.py Outdated
# `rocm_aiter_ops.shuffle_weight_a16w4` in `oracle/mxfp4.py`,
# which always sets `is_guinterleave=True`.
# Hence, we pass in GateMode.INTERLEAVE to match the weight shuffling.
from aiter.ops.flydsl.moe_common import GateMode

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR can only be merged after we upgrade AITER. current AITER v0.1.13.post1 does not have this import path. It will fail.

Comment thread vllm/model_executor/layers/fused_moe/config.py Outdated

@tjtanaa tjtanaa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only merged once aiter version is upgraded

@mergify mergify Bot added documentation Improvements or additions to documentation ci/build deepseek Related to DeepSeek models frontend rust multi-modality Related to multi-modality (#4194) mistral Related to Mistral models new-model Requests to new models performance Performance-related issues qwen Related to Qwen models gpt-oss Related to GPT-OSS models labels Jun 26, 2026
@mergify mergify Bot added nvidia intel-gpu Related to Intel GPU labels Jun 26, 2026
@mergify

mergify Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @qli88.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build cpu Related to CPU backends deepseek Related to DeepSeek models documentation Improvements or additions to documentation frontend gpt-oss Related to GPT-OSS models intel-gpu Related to Intel GPU kv-connector mistral Related to Mistral models multi-modality Related to multi-modality (#4194) new-model Requests to new models nvidia performance Performance-related issues qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm rust speculative-decoding structured-output tool-calling v1

Projects

Status: Done
Status: Done
Status: Done
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants