llama.cpp skips LM head for pooled embeddings

Coding Architecture

TL;DR: llama.cpp now avoids expanding the LM head when extracting pooled embeddings, eliminating per-token vocabulary logits and their host buffer.

Summary: A llama.cpp commit (b11597) changes graph construction so models only declare t_logits, which set_outputs() expands unless the context extracts embeddings with a pooling type other than NONE. A new build_logits() function handles the LM head separately and is called from llama_model::build_graph() before build_sampling(). Because the toggle alters graph shape for pooled contexts, set_embeddings() now schedules a re-reserve when switching to pooled embedding extraction.

Why it matters: This cuts wasted compute and memory for embedding-only workloads on llama.cpp, making pooled embedding inference cheaper and more efficient. Watch for downstream embedding tools and servers updating to leverage the reduced logits buffer.

Source: github_releases