fragmentation calculation fix
This commit is contained in:
parent
97ad402539
commit
38328bb599
1 changed files with 1 additions and 1 deletions
|
@ -9037,7 +9037,7 @@ static int llama_decode_internal(
|
||||||
|
|
||||||
// decide if we need to defrag the kv cache
|
// decide if we need to defrag the kv cache
|
||||||
if (cparams.defrag_thold >= 0.0f) {
|
if (cparams.defrag_thold >= 0.0f) {
|
||||||
const float fragmentation = kv_self.n >= 128 ? 1.0f - float(kv_self.used + n_tokens_all)/float(kv_self.n) : 0.0f;
|
const float fragmentation = kv_self.n >= 128 ? 1.0f - float(kv_self.used)/float(kv_self.n) : 0.0f;
|
||||||
|
|
||||||
// queue defragmentation for next llama_kv_cache_update
|
// queue defragmentation for next llama_kv_cache_update
|
||||||
if (fragmentation > cparams.defrag_thold) {
|
if (fragmentation > cparams.defrag_thold) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue