Skip to content

Commit 523051a

Browse files
committed
Make reset_cache optionally return None for unimplemented connectors
Signed-off-by: tovam <tovam@pliops.com>
1 parent 89cf8f0 commit 523051a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

vllm/distributed/kv_transfer/kv_connector/v1/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,11 @@ def build_kv_connector_stats(
472472
"""
473473
return None
474474

475-
def reset_cache(self) -> bool:
475+
def reset_cache(self) -> bool | None:
476476
"""
477477
Reset the connector's internal cache.
478478
479479
Returns:
480480
bool: True if the cache was successfully reset, False otherwise.
481481
"""
482-
return False
482+
return None

vllm/distributed/kv_transfer/kv_connector/v1/multi_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,4 @@ def get_kv_connector_stats(self) -> MultiKVConnectorStats | None:
374374
return stats_by_connector
375375

376376
def reset_cache(self) -> bool:
377-
return all(connector.reset_cache() for connector in self._connectors)
377+
return all(c.reset_cache() is not False for c in self._connectors)

vllm/v1/core/sched/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,7 +1249,7 @@ def reset_connector_cache(self) -> bool:
12491249
if self.connector is None:
12501250
logger.warning("reset_connector called but no KV connector configured.")
12511251
return False
1252-
return self.connector.reset_cache()
1252+
return self.connector.reset_cache() is not False
12531253

12541254
def make_stats(
12551255
self,

0 commit comments

Comments
 (0)