[KV Connector] Make KVCacheConfig an explicit constructor argument (#27887)

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
This commit is contained in:
Mark McLoughlin
2025-11-04 07:00:49 +00:00
committed by GitHub
parent 2f84ae1f27
commit 58279c60b5
14 changed files with 410 additions and 43 deletions

View File

@@ -380,9 +380,7 @@ class Worker(WorkerBase):
# NOTE(Kuntai): This need to be done before `initialize_kv_cache`,
# because `initialize_kv_cache` will inject kv cache groups not
# related to kv cache connector (e.g. kv cache sharing layers).
connector_vllm_config = copy.copy(self.vllm_config)
connector_vllm_config.kv_cache_config = copy.copy(kv_cache_config)
ensure_kv_transfer_initialized(connector_vllm_config)
ensure_kv_transfer_initialized(self.vllm_config, kv_cache_config)
if self.vllm_config.model_config.enable_sleep_mode:
from vllm.device_allocator.cumem import CuMemAllocator