From 3c9680fd3c6af2d13dd57bc149ba396106d5a4e9 Mon Sep 17 00:00:00 2001 From: Nexesenex <124105151+Nexesenex@users.noreply.github.com> Date: Mon, 15 Jun 2026 14:36:14 +0200 Subject: [PATCH] Fix Minimax M3 crash when -muge merges up/gate experts The graph builder for Minimax M3 (build_minimaxm3.cpp) was not passing model.layers[il].ffn_up_gate_exps to llm_build_std_moe_ffn, unlike Minimax M2 and all other MoE model graph builders. When -muge (merge_up_gate_experts) is enabled, the merge creates a single ffn_up_gate_exps tensor with ffn_up_exps and ffn_gate_exps as views. Only the parent merged tensor gets the split 'extra' pointer set. Without passing it as up_gate_exps parameter, the function sees null split pointers for up/gate (the views) while split_down_exps is valid, causing the assertion at llama-build-context.cpp:1453 to fail. --- src/graphs/build_minimaxm3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphs/build_minimaxm3.cpp b/src/graphs/build_minimaxm3.cpp index 388ae75d..352058e4 100644 --- a/src/graphs/build_minimaxm3.cpp +++ b/src/graphs/build_minimaxm3.cpp @@ -52,7 +52,7 @@ ggml_cgraph* llm_build_context::build_minimaxm3() { hparams.expert_weights_scale != 0.0f, hparams.expert_weights_scale, (llm_expert_gating_func_type) hparams.expert_gating_func, LLM_FFN_SWIGLU_OAI, - cb, il, gf, true); + cb, il, gf, true, model.layers[il].ffn_up_gate_exps); } cur = lctx.cvec.apply_to(ctx0, cur, il);