[EC Connector] Add shutdown API to EC Connector. (#42423)

Signed-off-by: omerpaz95 <omerpaz95@gmail.com>
This commit is contained in:
omerpaz95
2026-05-28 12:28:01 +00:00
committed by GitHub
parent c1c4db8b4b
commit 811d805195
5 changed files with 25 additions and 1 deletions
+2
View File
@@ -3,6 +3,7 @@
from vllm.distributed.ec_transfer.ec_transfer_state import (
ensure_ec_transfer_initialized,
ensure_ec_transfer_shutdown,
get_ec_transfer,
has_ec_transfer,
)
@@ -10,5 +11,6 @@ from vllm.distributed.ec_transfer.ec_transfer_state import (
__all__ = [
"get_ec_transfer",
"ensure_ec_transfer_initialized",
"ensure_ec_transfer_shutdown",
"has_ec_transfer",
]
@@ -79,6 +79,14 @@ class ECConnectorBase(ABC):
def is_consumer(self) -> bool:
return self._is_consumer
def shutdown(self) -> None:
"""
Shutdown the connector. This is called when the process
is shutting down to ensure that all the async operations are
completed and the connector is cleaned up properly.
"""
return None
# ==============================
# Worker-side methods
# ==============================
@@ -40,3 +40,10 @@ def ensure_ec_transfer_initialized(vllm_config: "VllmConfig") -> None:
_EC_CONNECTOR_AGENT = ECConnectorFactory.create_connector(
config=vllm_config, role=ECConnectorRole.WORKER
)
def ensure_ec_transfer_shutdown() -> None:
global _EC_CONNECTOR_AGENT
if _EC_CONNECTOR_AGENT is not None:
_EC_CONNECTOR_AGENT.shutdown()
_EC_CONNECTOR_AGENT = None