From 05baa62a73dbb600279454050ec1f239d1300111 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 17 Jul 2025 20:18:36 +0300 Subject: [PATCH] kv-cache : fix k-shift for multiple streams ggml-ci --- src/llama-kv-cache-unified.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llama-kv-cache-unified.cpp b/src/llama-kv-cache-unified.cpp index 98c01ea7ad15d..321dc79fc36ab 100644 --- a/src/llama-kv-cache-unified.cpp +++ b/src/llama-kv-cache-unified.cpp @@ -1261,7 +1261,7 @@ void llama_kv_cache_unified::set_input_k_shift(ggml_tensor * dst) const { const auto & cells = v_cells[s]; for (uint32_t i = 0; i < cells.size(); ++i) { - data[i] = cells.is_empty(i) ? 0 : cells.get_shift(i); + data[s*cells.size() + i] = cells.is_empty(i) ? 0 : cells.get_shift(i); } } }