From dad7a6383b7d86709cea420d9594f48b9b42cf69 Mon Sep 17 00:00:00 2001 From: omerpaz95 <73347585+omerpaz95@users.noreply.github.com> Date: Wed, 29 Jul 2026 12:04:22 +0300 Subject: [PATCH] [EC Connector] Add has_pending_push_work (#49582) Signed-off-by: omerpaz95 --- vllm/distributed/ec_transfer/ec_connector/base.py | 12 ++++++++++++ vllm/v1/core/sched/scheduler.py | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/vllm/distributed/ec_transfer/ec_connector/base.py b/vllm/distributed/ec_transfer/ec_connector/base.py index 1d5f467027..3c20a4a1f7 100644 --- a/vllm/distributed/ec_transfer/ec_connector/base.py +++ b/vllm/distributed/ec_transfer/ec_connector/base.py @@ -275,3 +275,15 @@ class ECConnectorBase(ABC): get_finished(). """ return False, None + + def has_pending_push_work(self) -> bool: + """Return True if the connector has push-mode work that requires + the engine main loop to keep stepping (e.g. for EPD, + Producer has push work when Xfer is in progress - Consumer + is reading it). + This mirrors exactly the KV Connector's has_pending_push_work(). + + Connectors that don't implement push-based EC transfer should + leave this as False. + """ + return False diff --git a/vllm/v1/core/sched/scheduler.py b/vllm/v1/core/sched/scheduler.py index 7fabf844a1..9ceda190b8 100644 --- a/vllm/v1/core/sched/scheduler.py +++ b/vllm/v1/core/sched/scheduler.py @@ -2362,6 +2362,10 @@ class Scheduler(SchedulerInterface): self.has_unfinished_requests() or self.has_finished_requests() or (self.connector is not None and self.connector.has_pending_push_work()) + or ( + self.ec_connector is not None + and self.ec_connector.has_pending_push_work() + ) ) def reset_prefix_cache(