Skip to content

Commit a5a85a3

Browse files
committed
context : fix recurrent reserve
ggml-ci
1 parent 0699a44 commit a5a85a3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/llama-context.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3883,6 +3883,11 @@ llama_context_recurrent::llama_context_recurrent(
38833883
llama_context_recurrent::~llama_context_recurrent() = default;
38843884

38853885
void llama_context_recurrent::reserve() {
3886+
// simulate full KV cache
3887+
kv_self.n = kv_self.size;
3888+
3889+
LLAMA_LOG_DEBUG("%s: kv_self.n = %u\n", __func__, kv_self.n);
3890+
38863891
// TODO: implement recurrent-specific reserve logic
38873892
llama_context::reserve();
38883893
}

src/llama-context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ class llama_context_kv_self : public llama_context {
447447
ggml_tensor * self_k_shift; // I32 [kv_size]
448448
} inp;
449449

450+
protected:
450451
//
451452
// graph
452453
//
@@ -570,6 +571,7 @@ class llama_context_recurrent : public llama_context {
570571
ggml_tensor * s_mask; // F32 [1, n_kv]
571572
} inp;
572573

574+
protected:
573575
//
574576
// graph
575577
//

0 commit comments

Comments
 (0)