From 275510ddf50b61a86e85a9ec7e479d062418d649 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Mon, 4 Aug 2025 16:44:23 -0700 Subject: [PATCH] kvcache: Log contents of cache when unable to find a slot There is a bug when using sliding window attention where we run out of KV cache slots. This is likely due to not correctly removing all of the entries as they slide out of range. This adds additional logging when this occurs to track down the source. Bug #10127 --- kvcache/causal.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kvcache/causal.go b/kvcache/causal.go index 56c936003..96d8067eb 100644 --- a/kvcache/causal.go +++ b/kvcache/causal.go @@ -214,6 +214,7 @@ func (c *Causal) StartForward(ctx ml.Context, batch input.Batch, reserve bool) e c.curLoc, err = c.findStartLoc() } if err != nil { + slog.Warn("unable to find a kv cache slot", "cache", c) return err }