-
-
Notifications
You must be signed in to change notification settings - Fork 15.6k
[KVConnector] Support worker -> scheduler metadata #31964
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
263ba3f
c8b9af7
dbaf1d6
e73c52b
45a4a14
6eea1bb
262348b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,8 @@ | |
|
|
||
| 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 | ||
|
|
@@ -137,13 +139,34 @@ class KVConnectorHandshakeMetadata(ABC): # noqa: B024 | |
|
|
||
| class KVConnectorMetadata(ABC): # noqa: B024 | ||
| """ | ||
| Abstract Metadata used to communicate between the | ||
| Scheduler KVConnector and Worker KVConnector. | ||
| Abstract Metadata used to communicate | ||
| Scheduler KVConnector -> Worker KVConnector. | ||
| """ | ||
|
|
||
| pass | ||
|
|
||
|
|
||
| class KVConnectorWorkerMetadata(ABC): | ||
| """ | ||
| Abstract Metadata used to communicate back | ||
| Worker KVConnector -> Scheduler KVConnector. | ||
|
|
||
| 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 KVConnector. | ||
| """ | ||
|
|
||
| @abstractmethod | ||
| def aggregate( | ||
| self, other: "KVConnectorWorkerMetadata" | ||
| ) -> "KVConnectorWorkerMetadata": | ||
| """ | ||
| Aggregate metadata with another `KVConnectorWorkerMetadata` object. | ||
| """ | ||
| pass | ||
|
|
||
|
|
||
| class KVConnectorBase_V1(ABC): | ||
| """ | ||
| Base class for KV connectors. | ||
|
|
@@ -409,6 +432,16 @@ def get_handshake_metadata(self) -> KVConnectorHandshakeMetadata | None: | |
| """ | ||
| return None | ||
|
|
||
| def build_connector_worker_meta(self) -> KVConnectorWorkerMetadata | None: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this read better as
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought to follow the convention being used for the other direction ( |
||
| """ | ||
| Build the KVConnector worker metadata for this engine step. | ||
|
|
||
| Returns: | ||
| KVConnectorWorkerMetadata: the worker metadata. | ||
| None if no worker metadata is available. | ||
| """ | ||
| return None | ||
|
|
||
| # ============================== | ||
| # Scheduler-side methods | ||
| # ============================== | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit missing cae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've now added: