From e94f3932f2dbcb2120580a9f42878e058a18cf5b Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Fri, 2 May 2025 19:29:23 -0400 Subject: [PATCH] kv-cache : allow context shift for recurrent models --- src/llama-kv-cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/llama-kv-cache.cpp b/src/llama-kv-cache.cpp index 87ce7ce03..99dd20b68 100644 --- a/src/llama-kv-cache.cpp +++ b/src/llama-kv-cache.cpp @@ -1938,7 +1938,8 @@ llama_pos llama_kv_cache_recurrent::get_pos_max() const { } bool llama_kv_cache_recurrent::get_can_shift() const { - return false; + // shifting is trivial, the recurrent states don't care about the absolute position + return true; } uint32_t llama_kv_cache_recurrent::cell_max() const {