You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
allenai/OLMoE-1B-7B-0924-Instruct loads successfully (with the fix in #119) but crashes on the very first inference request. Every expert forward pass fails immediately (layer 0, expert 0, 1, 2, 3, 4, ... all fail within the same millisecond), and the process falls back to a degraded/errored state.
MODEL_MAPPING_TYPES["olmoe"] in moe_infinity/common/constants.py is set to 4 (MIXTRAL_MOE_DENSE_ACT_DENSE). That expert type tells MoEMLP::ForwardHelper to read the per-expert weight buffer (param_) in gate, down, up order:
Since param_ is populated via model.named_parameters(recurse=True) (module registration order), OLMoE's buffers land in param_ = [gate_proj, up_proj, down_proj]. Interpreted through the Mixtral branch, up_proj and down_proj get swapped, so fused_moe_ffn_into receives down_proj = up_proj tensor (shape [intermediate_size, hidden_size] instead of [hidden_size, intermediate_size]), tripping the H == H_out check at fused_moe_mlp.cu:123 whenever hidden_size != intermediate_size (true for allenai/OLMoE-1B-7B-0924-Instruct: hidden_size=2048, intermediate_size=1024).
Notably, qwen3 — which shares the exact same gate_proj/up_proj/down_proj naming and registration order as OLMoE — is correctly mapped to 5 (DEEPSEEK_MOE_DENSE_ACT_DENSE, the gate, up, down branch) in the same table. This strongly suggests "olmoe": 4 was simply a copy/paste slip and should be 5.
(mirroring "qwen3": 5 right above it). I haven't submitted a PR yet since I don't have a way to test the fused CUDA kernel path in my current environment, but I'm confident in the analysis above from reading the code paths — happy to verify further if useful.
Built on top of Fix OLMoE support and silent model-init failures #119 (which fixes model loading/registration for OLMoE; this issue is a separate runtime bug that only surfaces once the model actually loads and serves a request)
Related
Fix OLMoE support and silent model-init failures #119 — fixes OLMoE loading (architecture registration + silent init failures). This issue is about the inference-time crash that happens after a model loads successfully.
Description
allenai/OLMoE-1B-7B-0924-Instructloads successfully (with the fix in #119) but crashes on the very first inference request. Every expert forward pass fails immediately (layer 0, expert 0, 1, 2, 3, 4, ... all fail within the same millisecond), and the process falls back to a degraded/errored state.(repeats for every expert_idx at layer_idx=0)
Root cause
MODEL_MAPPING_TYPES["olmoe"]inmoe_infinity/common/constants.pyis set to4(MIXTRAL_MOE_DENSE_ACT_DENSE). That expert type tellsMoEMLP::ForwardHelperto read the per-expert weight buffer (param_) ingate, down, uporder:That ordering matches HF Mixtral's own expert module (
w1=gate, w2=down, w3=up):But OLMoE's expert module registers weights in
gate, up, downorder instead:Since
param_is populated viamodel.named_parameters(recurse=True)(module registration order), OLMoE's buffers land inparam_ = [gate_proj, up_proj, down_proj]. Interpreted through the Mixtral branch,up_projanddown_projget swapped, sofused_moe_ffn_intoreceivesdown_proj = up_proj tensor(shape[intermediate_size, hidden_size]instead of[hidden_size, intermediate_size]), tripping theH == H_outcheck atfused_moe_mlp.cu:123wheneverhidden_size != intermediate_size(true forallenai/OLMoE-1B-7B-0924-Instruct:hidden_size=2048,intermediate_size=1024).Notably,
qwen3— which shares the exact samegate_proj/up_proj/down_projnaming and registration order as OLMoE — is correctly mapped to5(DEEPSEEK_MOE_DENSE_ACT_DENSE, thegate, up, downbranch) in the same table. This strongly suggests"olmoe": 4was simply a copy/paste slip and should be5.Suggested fix
(mirroring
"qwen3": 5right above it). I haven't submitted a PR yet since I don't have a way to test the fused CUDA kernel path in my current environment, but I'm confident in the analysis above from reading the code paths — happy to verify further if useful.Environment
allenai/OLMoE-1B-7B-0924-Instruct(64 experts, top-8, hidden_size=2048, intermediate_size=1024, 16 layers)moe_infinity.entrypoints.openai.api_server_v2--device-memory-ratio 0.5 --kv-cache-ratio 0.15 --max-batch-size 8Related