Skip to content

Commit 26292d1

Browse files
committed
Make reset_cache optionally return None for unimplemented connectors
Signed-off-by: tovam <tovam@pliops.com>
1 parent c0a8db8 commit 26292d1

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
@@ -432,11 +432,11 @@ def build_kv_connector_stats(
432432
"""
433433
return None
434434

435-
def reset_cache(self) -> bool:
435+
def reset_cache(self) -> bool | None:
436436
"""
437437
Reset the connector's internal cache.
438438
439439
Returns:
440440
bool: True if the cache was successfully reset, False otherwise.
441441
"""
442-
return False
442+
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
@@ -344,4 +344,4 @@ def get_kv_connector_stats(self) -> MultiKVConnectorStats | None:
344344
return stats_by_connector
345345

346346
def reset_cache(self) -> bool:
347-
return all(connector.reset_cache() for connector in self._connectors)
347+
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
@@ -1244,7 +1244,7 @@ def reset_connector_cache(self) -> bool:
12441244
if self.connector is None:
12451245
logger.warning("reset_connector called but no KV connector configured.")
12461246
return False
1247-
return self.connector.reset_cache()
1247+
return self.connector.reset_cache() is not False
12481248

12491249
def make_stats(
12501250
self,

0 commit comments

Comments
 (0)