Skip to content

Commit 38328bb

Browse files
committed
fragmentation calculation fix
1 parent 97ad402 commit 38328bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llama.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9037,7 +9037,7 @@ static int llama_decode_internal(
90379037

90389038
// decide if we need to defrag the kv cache
90399039
if (cparams.defrag_thold >= 0.0f) {
9040-
const float fragmentation = kv_self.n >= 128 ? 1.0f - float(kv_self.used + n_tokens_all)/float(kv_self.n) : 0.0f;
9040+
const float fragmentation = kv_self.n >= 128 ? 1.0f - float(kv_self.used)/float(kv_self.n) : 0.0f;
90419041

90429042
// queue defragmentation for next llama_kv_cache_update
90439043
if (fragmentation > cparams.defrag_thold) {

0 commit comments

Comments
 (0)