]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
context : fix graph not resetting when control vector changes (#20381)
authorAndreas Obersteiner <redacted>
Wed, 18 Mar 2026 06:10:13 +0000 (07:10 +0100)
committerGitHub <redacted>
Wed, 18 Mar 2026 06:10:13 +0000 (08:10 +0200)
src/llama-context.cpp

index 1f7a52d7895bbfc07086e708c318e288222e2947..dc61afb0bdb301b3b8b3e4ab18c6f8b40b6373b8 100644 (file)
@@ -1165,9 +1165,11 @@ bool llama_context::set_adapter_cvec(
                 int32_t   il_end) {
     LLAMA_LOG_DEBUG("%s: il_start = %d, il_end = %d\n", __func__, il_start, il_end);
 
-    // TODO: should we reserve?
+    bool res = cvec->apply(model, data, len, n_embd, il_start, il_end);
 
-    return cvec->apply(model, data, len, n_embd, il_start, il_end);
+    sched_need_reserve = true;
+
+    return res;
 }
 
 llm_graph_result * llama_context::process_ubatch(const llama_ubatch & ubatch, llm_graph_type gtype, llama_memory_context_i * mctx, ggml_status & ret) {