Skip to content

Commit 626f822

Browse files
committed
kv-cache : add comment + warning [no ci]
1 parent 8ab37b1 commit 626f822

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/llama-kv-cache.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ void llama_kv_cache_unified::restore() {
481481
}
482482

483483
void llama_kv_cache_unified::commit() {
484+
if (pending.ranges.empty()) {
485+
LLAMA_LOG_WARN("%s: no pending KV cache updates to commit - might indicate a bug (ref: %s)\n",
486+
__func__, "https://github.com/ggml-org/llama.cpp/pull/12695");
487+
return;
488+
}
489+
484490
pending.ranges.clear();
485491
}
486492

src/llama-kv-cache.h

+1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class llama_kv_cache_unified : public llama_kv_cache {
144144
uint32_t c1 = 0;
145145
};
146146

147+
// pending cell updates that are not yet committed
147148
struct {
148149
std::vector<slot_range> ranges;
149150
} pending;

0 commit comments

Comments
 (0)