Prhub

#49582 [EC Connector] Add has_pending_push_work

原始 PR 作者 omerpaz95 合并时间 2026-07-29 17:04 文件变更 2 提交数 2 评论 0 代码增减 +16 / -0

执行摘要

EC Connector 新增 pending push 检测

让 EC Connector 能够像 KV Connector 那样,通过 has_pending_push_work() 通知引擎主循环仍有推送传输工作正在进行,防止引擎在推送传输完成前退出。

此 PR 为简单接口扩展,设计清晰,实现安全。值得关注的点是如何在子类中实际利用该钩子。

讨论亮点

无 Review 讨论。NickLucche 直接批准,无评论。

实现拆解

  1. 在 vllm/distributed/ec_transfer/ec_connector/base.py 的 ECConnectorBase 类中添加 has_pending_push_work() 方法,返回 False,供子类覆盖。
  2. 在 vllm/v1/core/sched/scheduler.py 的 has_requests() 方法中增加对 ec_connector.has_pending_push_work() 的检查,与已有 connector.has_pending_push_work() 并列。
文件 模块 状态 重要度
vllm/distributed/ec_transfer/ec_connector/base.py 分布式连接器 modified 6.49
vllm/v1/core/sched/scheduler.py 调度器 modified 5.51

关键符号

has_pending_push_work has_requests

关键源码片段

vllm/v1/core/sched/scheduler.py core-logic

在 has_requests 中增加对 ec_connector 的 pending push 检查,保持引擎活跃

def has_requests(self) -> bool:
    # Override the interface default to also keep the engine alive while a
    # connector still has pending push work (e.g. push-mode WRITE transfers
    # in flight after all "live" requests have finished). Without this hook
    # the engine would quiesce before the connector can drain completions.
    # TODO: replace with a more general mechanism for connectors to keep
    # the scheduler alive.
    return (
        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()
        )
    )

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

改动极小,新增方法默认返回 False,不影响现有 EC Connector 行为。Scheduler 侧增加的条件是安全短路逻辑,不会有性能影响。风险极低。

对使用 EC Connector 并实现推送传输的模型(如 EPD)有益,能正确保持引擎活跃直到传输完成。其他模型无影响。

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论