Skip to content

Commit 303f8d5

Browse files
kevincheng2claude
andcommitted
[BugFix][KVCache] fix gpu_free_block_list returning wrong block IDs
## Motivation `gpu_free_block_list` 的兼容 property 中误用了 `list(range(N))`, 将 `available_blocks()` 的返回值当作整数传给 `range()`, 导致返回 `[0, 1, ..., N-1]` 的假列表,而非真实的空闲 block ID。 ## Modifications - `cache_manager/v1/cache_manager.py`:将 `list(range(self._device_pool.available_blocks()))` 改为 `list(self._device_pool.available_blocks())` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 643f502 commit 303f8d5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fastdeploy/cache_manager/v1/cache_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def gpu_free_block_list(self) -> List[int]:
426426
with PrefixCacheManager.gpu_free_block_list.
427427
"""
428428
# Return list representation of available blocks
429-
return list(range(self._device_pool.available_blocks()))
429+
return list(self._device_pool.available_blocks())
430430

431431
@property
432432
def available_gpu_resource(self) -> float:

0 commit comments

Comments
 (0)