Repository navigation
extract scheduler from encode server and DP runtime from HTTP server - #6
Merged
Merged
Conversation
cccccya
pushed a commit
that referenced
this pull request
Jul 27, 2026
extract scheduler from encode server and DP runtime from HTTP server
cccccya
pushed a commit
that referenced
this pull request
Jul 28, 2026
extract scheduler from encode server and DP runtime from HTTP server
cccccya
pushed a commit
that referenced
this pull request
Jul 29, 2026
extract scheduler from encode server and DP runtime from HTTP server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
当前 Encoder Server 的调度与启动逻辑分散在多个模块中:
EncoderScheduler位于encode_server.pyDPDispatcher、DP Worker 和 DP 启动逻辑位于encode_http_server.pyMMEncoder和 Scheduler 初始化也位于encode_http_server.py为了后续统一 HTTP/gRPC 后端启动方式、支持 DP+TP 拓扑,并进一步扩展 Scheduler 职责,本 PR 新增协议无关的
encoder_runtime.py,集中管理 Encoder 的调度、DP dispatch 和后端 Runtime 初始化。本 PR 只调整代码位置和职责边界,不改变现有请求路径和运行拓扑。
本 PR 暂时不包含
EncoderRuntime或DPDispatcher当前 DP Runtime 仍要求:
Modifications
1. 新增
encoder_runtime.py从
encode_server.py移入:PendingRequest_BATCHABLE_MODALITIESEncoderScheduler从
encode_http_server.py移入:DPDispatcherrun_dp_worker()和launch_dp_worker()同时新增:
EncoderRuntimelaunch_local_runtime()launch_dp_runtime()2. 集中 non-DP Runtime 初始化
launch_local_runtime()负责创建并持有:MMEncoderEncoderScheduler当前仍保持:
Scheduler 与 rank-0
MMEncoder仍在同一进程中,不引入新的 Scheduler/Worker IPC。3. 抽离 DP Runtime 启动逻辑
原 HTTP Server 中的 DP 启动逻辑拆分到
launch_dp_runtime(),负责:DPDispatcherHTTP Server 只保留
DPDispatcher引用,用于现有路由处理。4. 简化 HTTP Server 职责
encode_http_server.py现在主要负责:启动时根据
dp_size选择 Runtime:non-DP 路径暂时保留
encoder、encoder_scheduler和send_sockets模块级兼容引用,避免修改现有 HTTP handler。对象本身统一由EncoderRuntime创建和管理。5. 调整
encode_server.py的职责EncoderScheduler及相关数据结构移至encoder_runtime.pyMMEncoder和 TP follower 的实际计算逻辑encode_server.py,因为MMEncoder内部直接引用,但其初始化转移到 RuntimeAccuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): ❌ Run #30082920372
Latest PR Test (Extra): ❌ Run #30082920095