From 07443bea29db509cfc84b060317c7077b343376a Mon Sep 17 00:00:00 2001 From: Ming Huang Date: Mon, 10 Aug 2026 20:56:25 -0700 Subject: [PATCH] [BugFix][Core] free_blocks: restore prepend (LIFO) reuse order when prefix caching is off (#51482) Signed-off-by: theminghuang Signed-off-by: Ming Huang --- vllm/v1/core/block_pool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/v1/core/block_pool.py b/vllm/v1/core/block_pool.py index a64b7e3215..6b73f91afe 100644 --- a/vllm/v1/core/block_pool.py +++ b/vllm/v1/core/block_pool.py @@ -732,7 +732,7 @@ class BlockPool: if block.ref_cnt == 0 and not block.is_null: # When caching is disabled we always append for better # GPU cache locality from reusing recently used blocks - if block.block_hash is None and self.enable_caching: + if block.block_hash is None or not self.enable_caching: blocks_without_hash.append(block) else: blocks_with_hash.append(block)