Commit 1ddc26255 for llama.cpp
commit 1ddc262558fe736f4e046dc6d203eefbf0bbe5d8
Author: Pascal <admin@serveurperso.com>
Date: Thu Oct 15 06:38:12 2026 +0200
graph: keep the graph non empty without embeddings (#30522)
An embedding-only graph has no logits, and build_pooling() returns
early when embeddings are off, so since the models no longer expand
t_embd the graph ends up empty and its inputs are never allocated.
Expand t_embd in that case.
diff --git a/src/llama-graph.cpp b/src/llama-graph.cpp
index f69fe63f8..6cadda971 100644
--- a/src/llama-graph.cpp
+++ b/src/llama-graph.cpp
@@ -3978,6 +3978,10 @@ void llm_graph_context::build_pooling(
ggml_tensor * cls_out_b,
ggml_tensor * cls_norm) const {
if (!cparams.embeddings) {
+ // a graph without logits still computes t_embd, so that it is never empty
+ if (res->t_logits == nullptr && res->t_embd != nullptr) {
+ ggml_build_forward_expand(gf, res->t_embd);
+ }
return;
}