feat(grpc): add KV event source discovery (#50033)

Signed-off-by: Connor Carpenter <connorc@nvidia.com>
Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Connor Carpenter
2026-07-29 13:46:40 -07:00
committed by GitHub
co-authored by Nick Hill
parent 2ecd8645d8
commit 48fc2e2797
13 changed files with 179 additions and 5 deletions
+18
View File
@@ -272,6 +272,10 @@ class EventPublisher(ABC):
def shutdown(self) -> None:
"""Shutdown the publisher."""
def get_publisher_config(self) -> KVEventsConfig | None:
"""Return the publisher's resolved runtime configuration."""
return None
class NullEventPublisher(EventPublisher):
"""No-op implementation (default when disabled)."""
@@ -335,6 +339,17 @@ class ZmqEventPublisher(EventPublisher):
self._replay_endpoint = self.offset_endpoint_port(
replay_endpoint, self._dp_rank
)
assert self._endpoint is not None
self._publisher_config = KVEventsConfig(
enable_kv_cache_events=True,
publisher="zmq",
endpoint=self._endpoint,
replay_endpoint=self._replay_endpoint,
buffer_steps=buffer_steps,
hwm=hwm,
max_queue_size=max_queue_size,
topic=topic,
)
self._hwm = hwm
self._socket_setup()
@@ -351,6 +366,9 @@ class ZmqEventPublisher(EventPublisher):
)
self._thread.start()
def get_publisher_config(self) -> KVEventsConfig:
return self._publisher_config
def publish(self, events: EventBatch) -> None:
if not self._running:
raise RuntimeError("Publisher is closed")