From 1ddc262558fe736f4e046dc6d203eefbf0bbe5d8 Mon Sep 17 00:00:00 2001 From: Pascal Date: Thu, 15 Oct 2026 06:38:12 +0200 Subject: [PATCH] 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. --- src/llama-graph.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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; }