]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
model : clarify MTP layer comment in qwen35.cpp [no ci] (#23338)
authorDaniel Bevenius <redacted>
Tue, 19 May 2026 16:41:44 +0000 (18:41 +0200)
committerGitHub <redacted>
Tue, 19 May 2026 16:41:44 +0000 (18:41 +0200)
This commit attempts to clarify a code comment in graph_mtp regarding
where the MTP layer is stored.

The motivation for this is that it was not obvious to me what the
original comment meant and hopefully this makes it clearer.

src/models/qwen35.cpp

index 361d7538a0385f8ae57ecfe69b5de296b4ac3517..35a0158e8548892bffa3e7535cc645b78c5c4b51 100644 (file)
@@ -496,7 +496,8 @@ llama_model_qwen35::graph_mtp::graph_mtp(const llama_model & model, const llm_gr
     const int64_t n_embd_head = hparams.n_embd_head_v();
     GGML_ASSERT(n_embd_head == hparams.n_embd_head_k());
 
-    // The MTP block lives at the source file's original layer index.
+    // hparams.n_layer includes both main model layers and MTP layers. The MTP
+    // layer is stored immediately after the main layers in model.layers[].
     const int il = (int) hparams.n_layer - (int) hparams.nextn_predict_layers;
     const auto & layer = model.layers[il];