[ROCm]Enable AITER MoE backend for MiniMax-M3-MXFP4 - #46419
Conversation
| @@ -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, | |||
There was a problem hiding this comment.
why is this special case necessary for minimax?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@qli88 hidden_pad is not used at all. Let's not include it. Just introduce intermediate_pad will do.
|
Do we have any perf gain regarding this PR? |
343d686 to
8922e38
Compare
|
Update my perf result on 8 MI355X |
|
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
Along with The current backend |
| # `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 |
There was a problem hiding this comment.
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.
tjtanaa
left a comment
There was a problem hiding this comment.
LGTM. Only merged once aiter version is upgraded
2ad27c8 to
600ef70
Compare
|
This pull request has merge conflicts that must be resolved before it can be |
Signed-off-by: Qiang Li <qiang.li2@amd.com>
[ROCm][feature] Enable MiniMax-M3-MXFP4 with AITER MoE
This feature requires AITER version bump (latest version).
Accuracy test:
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