Repository navigation
[CK] [bug fix] Fix wrong cktile 2stages moe_gemm1_heuristic_dispatcher dispatch in case a template is not built, add template specialization for (Swiglu, HasBias=false, split_k=1) - #6022
Conversation
moe_gemm1_heuristic_dispatcher dispatch in case a template is not built, add template specialization for (Swiglu, HasBias=false, split_k=1)moe_gemm1_heuristic_dispatcher dispatch in case a template is not built, add template specialization for (Swiglu, HasBias=false, split_k=1)
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
|
Note: I'll add test on vLLM side to assert |
| a_types, c_dtypes, act_types, is_split_k_l, (False, True) | ||
| ): | ||
| has_bias = act_type == "swiglu" | ||
| if act_type != "swiglu" and has_bias: |
There was a problem hiding this comment.
[P1] Please keep the existing SiLU+bias path working. This condition still skips generating the (Silu, has_bias=true) specialization, while the new primary-template check turns that existing path into a hard failure. The exact-head MI35X run reproduces it in op_tests/test_moe_2stage.py with activation=0, has_bias=1, split_k_gt_1=0: https://github.com/ROCm/aiter/actions/runs/36763567340/job/110085522039. Please generate the required specialization (including GEMM2), or change the caller contract so a supported SiLU+bias invocation cannot reach this dispatcher, and add regression coverage for that combination.
|
@aiter-bot review |
ROCm/aiter PR #6022 — [CK] [bug fix] Fix wrong cktile 2stages
|
|
No activity for 15 days, so this is now labelled |
Motivation
https://huggingface.co/amd/MiniMax-M3-MXFP4 served with
AITER_MXFP4_BF16MOE backend in vLLM yields wrong results when usinggate_mode=GateMode.INTERLEAVE, which it does by default: https://github.com/vllm-project/vllm/blob/aba01ef1f73d5bf24952c8f7d61febc509bbfefc/vllm/model_executor/layers/fused_moe/experts/rocm_aiter_moe.py#L400Cause is AITER cktile producing wrong outputs in this case, details below.
Technical Details
This dispatches into:
aiter/aiter/fused_moe.py
Lines 3568 to 3584 in 48b1365
that uses
split_k=1,activation == ActivationType.Swiglu.Additionally, Minimax does not use bias, and we wrongfully fall into:
aiter/csrc/ck_tile_gemm_moe_2stages/include/moe_cktile2stages.h
Lines 47 to 57 in 48b1365
as
cktile_moe_gemm1callsmoe_dispatchwith:aiter/csrc/ck_tile_gemm_moe_2stages/moe_cktile2stages.cu
Line 284 in 48b1365
that is
has_bias=False.split_k=1,activation=ActivationType.Swiglu,has_bias=Falsedoes not have a specialization and falls into the default that actually uses silu and thus produces wrong outputs.Note that
MOEMetadata.has_biasis not used here. This seems to have a different meaning.Test Plan
See added test.
I verified that
test_mxfp4_bf16_swiglu_interleaved_matches_separatedis indeed failing onaiter==v0.1.22.post1Test Result
Passing on this branch