From a85724bd6e51af58793da365da7b70b1b72d71b9 Mon Sep 17 00:00:00 2001 From: wangxiyuan Date: Thu, 18 Dec 2025 14:45:29 +0800 Subject: [PATCH] [Platform] Let EPD work with non-cuda platform (#30225) Signed-off-by: wangxiyuan --- .../ec_transfer/ec_connector/example_connector.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vllm/distributed/ec_transfer/ec_connector/example_connector.py b/vllm/distributed/ec_transfer/ec_connector/example_connector.py index c9aad9e9fc8f3..3518044ce2e00 100644 --- a/vllm/distributed/ec_transfer/ec_connector/example_connector.py +++ b/vllm/distributed/ec_transfer/ec_connector/example_connector.py @@ -73,6 +73,7 @@ class ECExampleConnector(ECConnectorBase): data hashes (`mm_hash`) to encoder cache tensors. kwargs (dict): Additional keyword arguments for the connector. """ + from vllm.platforms import current_platform # Get the metadata metadata: ECConnectorMetadata = self._get_connector_metadata() @@ -91,7 +92,9 @@ class ECExampleConnector(ECConnectorBase): if mm_data.mm_hash in encoder_cache: continue filename = self._generate_filename_debug(mm_data.mm_hash) - ec_cache = safetensors.torch.load_file(filename)["ec_cache"].cuda() + ec_cache = safetensors.torch.load_file( + filename, device=current_platform.device_type + )["ec_cache"] encoder_cache[mm_data.mm_hash] = ec_cache logger.debug("Success load encoder cache for hash %s", mm_data.mm_hash)