[EC Connector] Added Build Connector Worker Meta for EC Connector (#49585)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: omerpaz95 <omerpaz95@gmail.com>
Signed-off-by: omerpaz95 <73347585+omerpaz95@users.noreply.github.com>
Co-authored-by: yewentao256 <zhyanwentao@126.com>
Co-authored-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
This commit is contained in:
omerpaz95
2026-08-15 15:40:38 -07:00
committed by GitHub
co-authored by yewentao256 Wentao Ye
parent c94cdd0ae0
commit fa9d67f782
16 changed files with 430 additions and 16 deletions
@@ -20,6 +20,8 @@ The class provides the following primitives:
get_finished() - called with ids of finished requests, returns
ids of requests that have completed async sending/recving.
build_connector_worker_meta() - builds metadata to be sent
back to the scheduler-side connector
"""
import enum
@@ -56,6 +58,27 @@ class ECConnectorMetadata(ABC): # noqa: B024
pass
class ECConnectorWorkerMetadata(ABC):
"""
Abstract Metadata used to communicate back
Worker ECConnector -> Scheduler ECConnector.
Each worker can output its own metadata.
For a single engine step, all metadata objects returned by workers
will be aggregated using the `aggregate` method below, before
being passed to the Scheduler ECConnector.
"""
@abstractmethod
def aggregate(
self, other: "ECConnectorWorkerMetadata"
) -> "ECConnectorWorkerMetadata":
"""
Aggregate metadata with another `ECConnectorWorkerMetadata` object.
"""
pass
class ECConnectorBase(ABC):
def __init__(self, vllm_config: "VllmConfig", role: ECConnectorRole):
self._connector_metadata: ECConnectorMetadata | None = None
@@ -190,6 +213,16 @@ class ECConnectorBase(ABC):
"""
return None, None
def build_connector_worker_meta(self) -> ECConnectorWorkerMetadata | None:
"""
Build the ECConnector worker metadata for this engine step.
Returns:
ECConnectorWorkerMetadata: the worker metadata.
None if no worker metadata is available.
"""
return None
# ==============================
# Scheduler-side methods
# ==============================