]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
model : load MiMo V2 MTP tensors only if used (#26412)
authorSigbjørn Skjæret <redacted>
Sun, 2 Aug 2026 07:03:05 +0000 (09:03 +0200)
committerGitHub <redacted>
Sun, 2 Aug 2026 07:03:05 +0000 (09:03 +0200)
src/models/mimo2.cpp

index 4080a934cb9841953b3e16790929209a0ad58c4e..d50e186cce929d0f6bf898f1a5babb57fc656ccb 100644 (file)
@@ -30,7 +30,11 @@ void llama_model_mimo2::load_arch_tensors(llama_model_loader & ml) {
 
     const std::string mtp_probe = "blk." + std::to_string(n_layer) + ".nextn.eh_proj.weight";
     const bool trunk_only = (hparams.n_layer_nextn > 0) && (ml.get_weight(mtp_probe.c_str()) == nullptr);
-    const int  mtp_flags  = trunk_only ? TENSOR_NOT_REQUIRED : 0;
+    int mtp_flags         = trunk_only ? TENSOR_NOT_REQUIRED : 0;
+
+    if (!ml.load_mtp) {
+        mtp_flags |= TENSOR_SKIP;
+    }
 
     tok_embd = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, 0);