From: Georgi Gerganov Date: Thu, 17 Jul 2025 17:52:33 +0000 (+0300) Subject: kv-cache : fix k-shift for multiple streams (#14742) X-Git-Tag: upstream/0.0.6073~150 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=d6fb3f6b49b27ef1c0f4cf5128e041f7e7dc03af;p=pkg%2Fggml%2Fsources%2Fllama.cpp kv-cache : fix k-shift for multiple streams (#14742) ggml-ci --- diff --git a/src/llama-kv-cache-unified.cpp b/src/llama-kv-cache-unified.cpp index 98c01ea7..321dc79f 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); } } }