Skip to content

Commit d53b758

Browse files
simon-moavigny
authored andcommitted
[Bugfix] Fix eviction cached blocked logic (vllm-project#21357)
Signed-off-by: simon-mo <[email protected]> Signed-off-by: avigny <[email protected]>
1 parent 9f7f73d commit d53b758

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vllm/v1/core/block_pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def _maybe_evict_cached_block(self, block: KVCacheBlock) -> bool:
253253
return False
254254
block.reset_hash()
255255
blocks_by_id.pop(block.block_id, None)
256-
if blocks_by_id:
256+
if len(blocks_by_id) == 0:
257257
del self.cached_block_hash_to_block[block_hash]
258258

259259
if self.enable_kv_cache_events:

0 commit comments

Comments
 (0)