Skip to content

Commit 177b788

Browse files
Rebase to current master
- Changes after #20661 merge - Fixed one pre-commit error Signed-off-by: Christian Pinto <christian.pinto@ibm.com>
1 parent f4224b2 commit 177b788

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vllm/v1/core/kv_cache_coordinator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,7 @@ def __init__(self, kv_cache_config: KVCacheConfig, max_model_len: int,
250250
super().__init__(kv_cache_config, max_model_len, use_eagle,
251251
enable_caching, caching_hash_fn,
252252
enable_kv_cache_events)
253-
# attention free models are initialized with 0 kv_cache_groups
254-
if len(self.kv_cache_config.kv_cache_groups) > 0:
255-
self.verify_and_split_kv_cache_groups()
253+
self.verify_and_split_kv_cache_groups()
256254

257255
def verify_and_split_kv_cache_groups(self) -> None:
258256
"""
@@ -390,7 +388,9 @@ def get_kv_cache_coordinator(
390388
kv_cache_config: KVCacheConfig, max_model_len: int, use_eagle: bool,
391389
enable_caching: bool, caching_hash_fn: Callable,
392390
enable_kv_cache_events: bool) -> KVCacheCoordinator:
393-
if not enable_caching:
391+
if not enable_caching or len(kv_cache_config.kv_cache_groups) == 0:
392+
# We instantiate this coordinator also for attention free models that
393+
# have 0 kv_cache_groups
394394
return KVCacheCoordinatorNoPrefixCache(kv_cache_config, max_model_len,
395395
use_eagle, caching_hash_fn,
396396
enable_kv_cache_events)

vllm/v1/core/kv_cache_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(
8989
self.prefix_cache_stats = PrefixCacheStats() if log_stats else None
9090

9191
self.block_size: Optional[int] = None
92-
if self.enable_caching and len(self.kv_cache_config.kv_cache_groups) > 0:
92+
if self.enable_caching and len(kv_cache_config.kv_cache_groups) > 0:
9393
assert len(
9494
set(g.kv_cache_spec.block_size
9595
for g in kv_cache_config.kv_cache_groups)

0 commit comments

Comments
 (0)