Repository navigation
Conversation
# ⭐ Feature ## Share the inference control plane - Add the CPU-only gateway, common manager, lifecycle coordinator, placement planner, routing schema, and compatibility client for Rollout, GenRM, and Teacher. - Validate split, defer, decoupled placement and reject same-phase co-residency before startup. - Coordinate drain, offload, onload, deferred Teacher publication, and dynamic Rollout updates without changing role workloads. --- # ✅ Tests ## Cover RFC redai-studio#71 contracts and GPU workflows - Add CPU tests for routing, discovery, placement, lifecycle rollback, PG ownership, static-weight protection, legacy clients, and deferred publication. - Add opt-in PP/PD topology and three-role GPU integration tests and validation launchers. - Record passing split and decoupled multi-node training evidence in the bilingual validation guide. --- # 📝 Documentation ## Document the acceptance evidence - Add English and Chinese API and validation guides with reproducible commands and acceptance mapping. - Keep the scope limited to the explicit RFC redai-studio#71 acceptance checks.
Nyanpasu 审查看板审查状态: ✅ 已通过 审查版本: cb6f63e 目标分支: main 完成 cb6f63e 五文件增量复查:缺配置时静态 Teacher 清理可继续,四组回归与 readiness、SFT 可选角色、logical-head 和资源清理契约一致;指定 CPU 用例通过,未发现新增问题。117 个未变文件沿用前序已审证据。拆分复核覆盖 122 文件,新增差异全部归 A,A→B→C 边界保留。当前头仅三项辅助检查有通过结果,尚无 GPU 单测与训练集成结果;本地缺少 GPU/多节点硬件,未执行相应集成。
审查发现待处理
已解决或已取代
改进建议(非阻塞)拆分💡 1 个拆分方案 建议保留 A→B→C 的非阻塞拆分:统一推理及安全生命周期保持完整,手动 GenRM 弹性和分服务 Autoscaler 各有独立验收且存在真实依赖。本次五文件增量全部归 A,未改变原边界;22,460 行本身不是强制拆分理由。 箭头表示前置部分 → 后续部分;目标分支为 flowchart LR
target["目标分支"]
A["PR A"]
target --> A
B["PR B"]
A --> B
C["PR C"]
B --> C
如何按依赖提交(stack)只读 GitHub 元数据再次确认作者 Arazyu 为 FIRST_TIME_CONTRIBUTOR,head 为 Arazyu/Relax、base 为 redai-studio/Relax,作者上游权限查询返回 read。 先按表重组混合提交,每部分携带对应测试和文档;逐层验证,并核对顶层最终树与原 PR 一致。独立部分各自向目标分支开普通 PR;只将有依赖的线性链组成 stack,分叉或多前置依赖按图分别安排提交。 Fork 贡献者: 分支保留在 fork,先将底层向上游目标分支提交;上层暂留本地,或在 fork 内以其前置分支为 base 开 draft PR。底层合入后,只将上层独有提交 rebase 到更新后的上游目标分支,再提交下一层;若底层被 squash,注意排除其旧提交。 Fork 内 PR 只用于增量审阅;上游 PR 的 base 不能指向 fork 独有分支。多个累计 PR 同时指向上游目标分支会包含重复差异。GitHub 原生 stack 要求所有分支位于同一仓库。 相关 PR💡 实现与合入建议#347、#368、#381 与本 PR 的 RFC #71 核心行为实质重叠,应由维护者选择一个核心并迁移独有行为;它们均不能直接全量替换 #356 已集成的 #370 弹性功能。 https://github.com/redai-studio/Relax/pull/347 · https://github.com/redai-studio/Relax/pull/368 · https://github.com/redai-studio/Relax/pull/381 · 实现取舍: 保留既有 facade 并同时交付 GenRM 弹性时,可选择 #356;严格 defer 的提交门控可借鉴 #347 在 TQ put/finalizer 后 commit 的设计。若本轮要完成 engine ownership 与 workload 分离,#381 的任务级 Manager 和共用请求 executor 更完整,但涉及 discovery v2、旧 manager/具名 actor/handles 迁移。#368 的 EnginePool 与 characterization 测试可供比较,当前仍为 draft。现有证据不支持仅凭体量或历史 approval 选唯一实现。 当前 PR 调整: 无论选哪一核心,都保留 #356 的静态模型/权重隔离、logical-head/PD 路由、Teacher 写回和 #370 的幂等伸缩、单 Gateway 请求计数、候选/退役准入与 PG 回收。若采用 #381 的 executor,合并 legacy/raw 两条执行协议时仍须保留 sampling/chat-template/response 适配;不能只按测试名称去重。 合入顺序: 相关 PR 无必须先合入的技术依赖;#370 已在本 PR,PD #433 和 HiCache #442 已在 main。维护者可先落聚焦且独立可用的核心,后续广泛重构 rebase 并删除重叠实现;也可先落更完整的统一核心,再将本 PR 缩为 GenRM 弹性与必要适配。前者降低单次迁移范围但增加适配轮次,后者减少过渡代码但需要更广验收;不能直接丢弃 #370 的独有行为。 依据与验证范围: 498087c 仅修复既有清理/Teacher 隔离缺陷,未改变相关核心边界;父级据此复核并沿用已完成比较。依据 RFC #71 https://github.com/redai-studio/Relax/issues/71、各自固定 diff/调用链/测试定义、#347 提交门控 https://github.com/redai-studio/Relax/blob/62ae8c1f2ae6f1e35a40b15f61ce35f4bf4f70f5/relax/inference/defer.py#L286 与 #381 共用执行器 https://github.com/redai-studio/Relax/blob/e29cc71324c6dd0c97d7f23f18fae96fe92f3ab9/relax/engine/inference/executor.py#L114。发布前重新核对三 PR 仍 open、head/base/merge-base 未漂移;未执行跨实现 GPU/NCCL 性能或完整训练比较,非阻塞建议不构成正确性全覆盖。 提交范围 · 接收 122 · 建议移出 0 · 待确认 0接收 122 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。
Powered by Nyanpasu with gpt-6.1-sol xhigh, please check the suggestions carefully.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rai-studio-bot
left a comment
There was a problem hiding this comment.
已完成审查,有一项非阻塞的启动就绪问题,详见行级评论。
本地 CPU 契约测试为 91 通过、1 跳过;未发现需要阻塞合并的问题。GitHub 暂无 CI 检查记录,完整训练及多节点 GPU 验证未在本机复跑。
| complete | ||
| and group.lifecycle_status == EngineGroupLifecycle.ACTIVE | ||
| and not self._is_weight_updating | ||
| and self._policy_weights_ready.get(name, False) |
There was a problem hiding this comment.
请在纯 fully-async 的首次权重同步成功后发布就绪状态。包含 Actor 的默认模型初始为 False,但 Controller 启动时调用的 Actor.update_weights_fully_async → MegatronTrainRayActor.update_weights_fully_async 只完成 DCS 传输,没有更新此标志;目前异步路径要等首次训练后的 /end_update_weight 才设为 True。因此首次同步已成功、引擎可用时,/rollout/generate、/rollout/v1/chat/completions 和新客户端仍会返回 503。建议在初始同步确认成功后解除门控,并补充“首次训练前即可通过网关生成”的回归测试;失败同步仍应保持不可用。
There was a problem hiding this comment.
已确认在 4335eab 修复。Actor 在等待全部训练 worker 的初始异步同步成功后发布 Rollout 就绪状态;同步异常和 actor_fwd-only 分支不会发布。已核对启动调用链,并复跑 CPU 契约测试:94 通过、1 跳过。F1 已解决。
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查通过:此前的启动就绪问题已修复,本轮增量未发现新的审查问题。CPU 契约测试 94 通过、1 跳过(缺少 Ray);GitHub 暂无 CI 检查记录,本机未复跑多节点 GPU 验证。
|
@SigureMo 任务已完成,请求 review。 |
rai-studio-bot
left a comment
There was a problem hiding this comment.
新到达的 CI 结果确认了一项测试替身兼容性回归,详见行级评论;此前 F1 仍已解决。本次补充意见不要求阻塞合并。
Pre-commit 检查 也因 ruff-format、docformatter 修改文件而失败,需要应用格式化结果。GPU 检查仍在运行。
| await self._weight_update_ready.wait() | ||
|
|
||
| self.status = "running" | ||
| await self.rollout_manager.set_policy_weights_ready.remote(True) |
There was a problem hiding this comment.
新增 RPC 后需要同步更新 tests/components/test_rollout_weight_update_handshake.py 的 _ManagerStub。它目前仅提供 health_monitoring_pause 和 set_weight_updating,因此现有 test_end_update_weight_does_not_block_after_failed_can_do 在此处抛出 AttributeError: '_ManagerStub' object has no attribute 'set_policy_weights_ready'。此提交的 Python 3.11 CI 已复现该失败(458 通过、47 跳过后停止)。请给替身补充可等待的就绪 RPC,并保留故障后恢复握手的原有断言;新增的 inference 契约测试没有覆盖这个旧测试调用链。
There was a problem hiding this comment.
已确认 c519b19 修复 F2:测试替身补充了可等待的就绪 RPC,原有故障恢复断言保留。由于本机缺少 Ray,我提取生产方法并隔离 Ray 导入边界,执行该文件的 6 项握手测试,全部通过;CPU inference 契约测试另有 94 通过、1 跳过。完整 CI 仍需以新提交结果为准。
# 🐛 Bug Fix ## Keep weight readiness test doubles compatible - Add the rollout readiness RPC to the handshake manager stub. - Preserve failed synchronization behavior while allowing successful resume. --- # 🎨 Style ## Apply required CI formatting - Apply the repository's ruff and docformatter output to touched Python files.
|
@rai-studio-bot review |
|
@SigureMo 不好意思,只验证了rai-studio-bot,忘记检查CI了,我先修复下CI错误 |
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查通过:F1、F2 均已解决,本轮其余变更仅为格式化,未发现新增问题。
CPU 契约测试 94 通过、1 跳过;隔离 Ray 导入边界后的 6 项握手测试通过。新提交暂未显示 CI 结果,本机未复跑多节点 GPU 验证。
| { text: 'Distributed Checkpoint', link: '/zh/guide/distributed-checkpoint' }, | ||
| { text: '健康检查管理器', link: '/zh/guide/health-check-manager' } | ||
| { text: '健康检查管理器', link: '/zh/guide/health-check-manager' }, | ||
| { text: '统一推理服务验收记录', link: '/zh/guide/unified-inference-validation' } |
rai-studio-bot
left a comment
There was a problem hiding this comment.
已复核当前提交 c519b19:与上次审查相同,F1、F2 仍已解决,未发现新增代码问题。
Pre-commit 已通过,Python 3.10–3.12 及 GPU 检查仍在运行。此前本地结果为 94 通过、1 跳过,以及隔离 Ray 导入后的 6 项握手测试通过,不能替代完整 CI。
还需回应维护者关于验收记录进入正式文档的意见,确认文档范围;此前代码审查通过不代表该意见已解决或 PR 已满足合并条件。
# 🐛 Bug Fix ## Preserve legacy engine discovery and startup fixtures - Keep `get_engines_info()` compatible with managers created without the unified inference manager. - Update the startup cleanup fixture for the fully async weight-update arguments and metrics state. --- # 📝 Documentation ## Keep the public inference API focused - Remove internal acceptance reports and experiment details from the public API docs. - Move shared inference links into the related lifecycle and placement sections. --- # 🔩 Chore ## Remove private validation wrappers - Delete one-off cluster scripts containing site-specific paths and runtime settings.
There was a problem hiding this comment.
本轮代码兼容性修复及文档清理未发现新增运行时问题;F1、F2 仍已解决。CPU 契约测试 94 通过、1 跳过,另有 4 项隔离的引擎信息兼容检查通过;当前提交 Pre-commit 已通过,Python/GPU CI 仍在运行,本机未复跑多节点 GPU 验证。
优先级:P3 — 非行级:PR 描述。请同步更新 Acceptance evidence:其中仍列出已删除的中英文
guide/unified-inference-validation.md,并称 API 页面包含验收记录和复现信息,但这些段落也已移除。建议把验收结果及复现信息放在 PR 描述或可访问的附件中,删除失效的文件引用,并将剩余 API 页面说明改为接口与用法文档。
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查通过:F3 已解决,PR 描述已移除失效引用,并准确说明 API 页面的用途。此前 F1、F2 仍已解决。
代码提交未变化,沿用此前验证结果;Pre-commit 已通过,Python/GPU CI 仍在运行。本审查结论不替代 CI 结果或维护者的合并决定。
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查 375ed00a 通过:合并 main 后,算法注册与奖励处理、critic 放置及设备/权重同步接口未发现新增回归;此前 F1–F3 仍已解决。
推理契约测试 94 通过、1 跳过,另有 6 项隔离握手检查通过。Pre-commit 已通过,Python/GPU CI 仍在运行;本机缺少相应运行环境,未复跑多节点 GPU 验证。
|
@SigureMo 任务已完成,请求 review。 |
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查结论:通过(9eec00a1)
新提交相对上轮已通过的 904b4b8 仅新增两个文件(+25 行):relax/backends/megatron/model_provider.py 在 NPU 分支整体拷贝 vars(args) 时排除运行时放置计划 _inference_placement,配套回归测试用真实 PlacementPlanner 构造放置计划并参数化 NPU 可用性。已核对该字段唯一写入方为 relax/inference/placement.py:171,NPU 拷贝循环是唯一会把该 frozen dataclass 计划带上 provider(随后被整体 pickle)的路径;排除后 args 仍持有计划供运行时消费,无其他泄漏面。本地 20 项 provider 测试与 104 项 inference 契约测试通过,该提交 CI 全绿。其余 57 个变更文件与上轮已通过内容一致,结论沿用;F1–F3 修复均保留。多节点 GPU 验证未在本机复跑,沿用 PR 描述中的验收记录。
说明:当前合并因维护者此前的 changes-requested 决定而阻塞;其中验收记录页的意见已由该页移除落实,是否放行由维护者复核决定。
Merge the GenRM elasticity implementation with the unified inference service. Preserve legacy generation, sampling and attribution through the gateway, count raw and streaming requests during drain, and bind closed admission to engine identities so recovered engines may reuse endpoints. Use the same published engine states for discovery and legacy routing. Preserve split placement offsets, retain owned placement groups until Ray confirms removal, and recreate elastic placements during engine recovery. Exclude retired slots from recovery and keep failed cleanup retryable. Reject deferred, training-offload and multi-GPU elastic layouts before taking the lifecycle lock or allocating resources. Document the supported scope in both languages and regenerate the GenRM API schema. Validation: focused CPU suite 426 passed, 4 optional-dependency skips; latest lifecycle/gateway regression rerun 34 passed (overlaps that suite); additional contract tests 12 passed, 17 optional-dependency skips. All pre-commit hooks and the VitePress documentation build passed. Real SGLang and multi-node GPU execution were not rerun on this CPU host. Refs redai-studio#71, redai-studio#351, redai-studio#356, redai-studio#370
|
/review |
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查结论:有一项非阻塞回归(P2)
本轮增量是提交 36ee4ba 把 #370 的 GenRM 弹性扩缩容并入本 PR。已逐块核对集成提交对网关、放置与 Teacher 共享语义的兼容改造:legacy /generate 与网关原生请求共用同一 in-flight 计数与 drain 证明命名空间;生命周期操作通过非阻塞 _exclusive_lifecycle 与弹性扩缩容互斥,发现快照不持转移锁、扩缩容期间发现服务仍可用;弹性 PG 保留至 Ray 确认 REMOVED,失败清理保持 fail-closed 并可重试。本地 CPU 套件 330 例:328 通过、2 失败,失败项即下方行级评论的 P2——并入的 #370 测试断言 GenRM 继承全局 sglang_* 参数,而该继承循环在本 PR 早期提交中已从 _compute_genrm_server_args 删除;CI 环境缺少真实 sglang 而跳过这两条测试,未能暴露。F1–F3 修复均保留;#370 引入的弹性扩缩容本体沿其在 #370 的审查讨论评估,此处不复述。
说明:多节点 GPU 与真实 SGLang 运行未在本机复跑,沿用 PR 描述披露的验收边界;当前合并因维护者此前的 changes-requested 决定而阻塞,是否放行由维护者复核决定。
| # (re-review finding). A failed probe defers to SGLang's default instead | ||
| # of pinning ``None`` over it; per-instance ``--genrm-engine-config`` | ||
| # overrides still take priority over both (applied after the loop). | ||
| if getattr(args, "sglang_attention_backend", None) is None: |
There was a problem hiding this comment.
合并基线(7c4e5371)的 _compute_genrm_server_args 内含 sglang_* 继承循环;本 PR 在 a3bbb30 删除了其中两行(if hasattr(args, f"sglang_{attr.name}") and attr.name not in kwargs: 及其赋值,见 hunk @@ -1632,8 +1699,6),而 #370 并入时新增的注释("the sglang_* inheritance loop below backfills only fields absent from kwargs … (applied after the loop)")与两条测试仍按该循环存在来断言。
本地装有真实 sglang 0.5.17 的环境复跑 tests/backends/sglang/test_sglang_engine.py:test_genrm_attention_backend_respects_global_user_choice 与 test_genrm_attention_backend_probe_failure_defers_to_global_and_default 均失败(用户显式 sglang_attention_backend 未出现在 kwargs);CI 环境因缺少真实 sglang 由 importorskip 跳过,故未能暴露。rollout 侧 _compute_server_args 的同名循环保留完好,两侧行为已分叉。
影响:用户显式 --sglang-attention-backend(以及其他未在 kwargs 显式计算的全局 sglang_* 项)对 GenRM 引擎静默失效;此时确定性推理落到 SGLang 通用默认后端,即上方注释所述 radix cache 被禁、48 路并发评分预填楔死场景的入口。
建议:恢复 genrm 函数内被删的两行继承循环(保留当前 guard "仅在用户未显式选择时探测" 的语义),或在文档中明确 GenRM 不继承全局 sglang_* 并同步修正此注释与两条测试;修改 relax/utils/arguments.py 或后端参数语义需按仓库约定先征求维护者确认。
There was a problem hiding this comment.
已在 bf354e7 确认修复:`compute_genrm_server_args` 恢复了被删的两行 `sglang*` 继承循环,与合并基线 1632–1637 行逐字节一致(rollout 侧同构,两侧行为不再分叉)。原先两条依赖真实 SGLang 的测试恢复通过,且 tests/inference/test_engine_contract.py 已改用真实 dataclasses schema 直接执行生产构建器(31 例通过,不要求安装 SGLang),原先 CI 因 `importorskip` 跳过而无法暴露此回归的盲区随之消除。另:bf354e70 的 CPU 测试失败源于 `_dep_stubs` 导入桥的桩模块泄漏污染 `sys.modules`,已在 0e1b722 隔离修复,与本条发现无关。
Exercise canonical discovery on every engine pick while preserving round-robin, recovery and lifecycle admission coverage. Inject watcher failures at the processing boundary and test repeated registry eviction with small caps instead of long waits and large scans. Validation: 444 passed, 4 dependency skips in focused CPU regressions; 36 registry tests passed after strengthening protected-record eviction coverage; all pre-commit hooks passed.
Backfill supported global SGLang fields without replacing GenRM role defaults, then apply per-model overrides. Add CPU-only builder regressions for attention precedence, memory tuning, static-model defaults and the decode cache exclusion so missing SGLang cannot hide this regression. Validation: 31 engine contract tests passed; 454 focused tests passed with 4 dependency skips; all pre-commit hooks passed.
Restore both the SGLang engine module cache entry and its parent-package attribute after importing the GenRM manager, including failed imports. This prevents later CPU tests from mistaking a dependency bridge for an installed engine runtime. Validation: 9 import-isolation regressions passed; ordered manager/precheck regression passed 31 tests with 20 missing-SGLang skips; all pre-commit hooks passed before this commit.
|
/review |
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查结论:通过(APPROVE)
本轮增量(36ee4ba8..0e1b722,三笔提交)均已逐项核实:79d98456 将 engine-pick 回归测试改写为按规范发现快照逐次取准入——旧断言对应集成前的缓存列表语义,且该头 36ee4ba 的 CI 失败(get_inference_snapshot 缺失)证实其已失效,watcher 测试改为在处理边界注入异常并断言 poll/sleep 次数,registry 洪水测试限界后覆盖等价并加强驱逐断言;bf354e70 恢复 _compute_genrm_server_args 对全局 sglang_* 的继承(与合并基线 1632–1637 行逐字节一致,rollout 侧同构),F4 随之解决,契约测试改用真实 dataclasses schema,不安装 SGLang 即可执行,消除了原先 importorskip 造成的 CI 盲区;0e1b7228 以 try/finally 恢复 _dep_stubs 引擎导入桥的 sys.modules 与包属性绑定,修复了 bf354e7 CPU 测试失败的模块缓存污染机制。本地逐文件复跑共 224 例加 5 子测试全部通过;bf354e70 的 GPU Unit Tests 与 Integration Tests(Qwen3-4B 4GPU/2GPU/4NPU)经 GitHub API 核实成功,该头与本头仅差测试文件。当前头的 CPU Tests 因 bypass 门未开尚未运行,待其完成后如有失败由后续跟进处理。说明:上轮在 36ee4ba 发布时该头 CI 已有 engine-pick 旧测试失败而未及时纳入结论,本轮已核对并确认由 79d9845 修复;多节点 GPU 完整训练流程未在本机复跑,沿用 PR 描述披露的验收边界。
已解决冲突 |
|
辛苦再解决下冲突,今天合入了一个大 PR 冲突项比较多~ |
Merge main 9cd70b8 into the unified inference branch, preserving managed PD/HiCache, role routing and static-model weight isolation. Use cached engine metadata with whole-replica readiness checks, retain PG ownership through follower cleanup, adapt deferred rewards and per-service autoscaler observations, and close startup rollback gaps. Validation: 746 CPU regressions passed, 11 subtests passed, 56 skipped for missing SGLang/GPU dependencies; pre-commit run --all-files passed. GPU and multi-node validation must run on this new revision in remote CI.
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查结论:有补充意见
已完成 7d981ed5 合入主线后的增量复查,确认两项非阻塞问题,详见行级意见。既有修复仍保留。本轮证据包括源码、1 个指定 CPU 回归及受控探针;未验证真实 GPU/多节点集成,当前头仅有辅助 CI 检查通过,历史训练结果不覆盖本次合并。
| if inference is None: | ||
| self._dispose() | ||
| else: | ||
| inference.transition("shutdown", self._dispose) |
There was a problem hiding this comment.
_dispose() 最后调用的 stop_launched_routers() 会捕获终止异常,并保留仍存活的进程供重试,但正常返回。因此第一次清理失败仍会让这里的 transition 发布 dead;之后再次 dispose() 会直接跳过 action,保留的路由进程再也收不到终止请求。主线原实现每次 dispose 都会重试,合入后丢失了这一行为。
在 9cd70b8 与 7d981ed 的生产方法 CPU 对照探针中,让第一次 terminate 抛出 OSError、第二次成功:主线第二次清理移除了进程,当前头则保持 dead、只尝试一次。这证明重试失效,未证明真实 Ray worker 退出后进程一定残留。请在路由清理未确认完成时让 shutdown 保持可重试,或允许终态 dispose 继续协调残留资源。
There was a problem hiding this comment.
已在 498087ce 确认修复:路由进程仍被保留时 _dispose() 抛错,生命周期停在 failed,后续 shutdown 会再次执行清理;清理成功后才进入 dead。指定回归 test_rollout_contract.py::test_dispose_retries_unconfirmed_router_cleanup[terminate] 通过,覆盖首次失败、二次成功及成功后幂等。此测试使用进程替身,未复验真实 Ray 进程退出。
| teacher_args.sglang_ep_size = 1 | ||
| teacher_args.sglang_router_ip = None | ||
| teacher_args.sglang_router_port = None | ||
| teacher_args.use_rollout_routing_replay = False |
There was a problem hiding this comment.
这里清除了学生的 sglang_* 配置和 routing replay,却保留了 use_rollout_indexer_replay。合入主线后,共享 _compute_server_args() 会据此为 Teacher 设置 enable_return_indexer_topk=True。当学生使用 indexer replay、托管 DSA/DeepSeek-V4 Teacher 为 TP=2 且未单独配置 DP attention 时,这里的 DP 重置使 attention TP=2;固定 SGLang 的 capturer 初始化要求 attention TP=1,Teacher 启动因此断言失败。
三版本参数构建探针确认:主线继承 DP attention,旧分支未开启 Teacher capture,当前头则组合出 TP2/DP1/capture=true;固定依赖的 CUDA factory CPU 提取探针在分配显存前触发断言。未进行 GPU 启动复现;无 indexer 层的 Teacher 不受该断言影响。建议同样清除这个学生开关,保留后续独立 teacher_sglang_* overrides 的优先级,并补充组合回归:
| teacher_args.use_rollout_routing_replay = False | |
| teacher_args.use_rollout_routing_replay = False | |
| teacher_args.use_rollout_indexer_replay = False |
There was a problem hiding this comment.
已在 498087ce 确认修复:Teacher 复制参数后清除学生的 indexer replay 标志,后续独立 teacher_sglang_* 覆盖仍生效,学生参数保持不变。指定回归 test_engine_contract.py::test_teacher_does_not_inherit_student_indexer_replay[None] 和 [True] 均通过,分别验证默认隔离与显式开启。未进行真实 GPU Teacher 启动验证。
Keep shutdown retryable when router processes remain after cleanup instead of publishing dead. Clear student indexer replay for managed teachers while preserving explicit teacher SGLang overrides. Add CPU regressions for termination errors, surviving routers, successful shutdown idempotence, and Teacher TP2 configuration with indexer replay. Validation: 127 passed, 32 skipped (missing runtime dependencies); all pre-commit hooks passed. GPU and multi-node integration were not run.
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查结论:通过
已核对 498087ce 的四文件增量,两项修复均已在原线程确认,三个指定 CPU 回归通过,未发现新增可操作问题;未变部分沿用 7d981ed5 的已审证据。GPU/多节点集成因本环境缺少相应硬件未执行,当前头的 GPU 单测与训练集成仍在运行,历史验收不覆盖本次合并。
Keep partial-startup cleanup working when Controller config is unavailable. Bind real static-inference cleanup in its regression and assert Teacher shutdown and kill. Update merged tests for readiness fencing, valid SFT colocation, and head-only discovery while retaining follower observation. Validation: 197 CPU tests passed; 2 runtime-dependent modules skipped. The 3 affected Megatron/discovery cases also passed controlled CPU probes using production methods and the actual test functions. All pre-commit hooks passed. Full GPU validation remains for CI.
rai-studio-bot
left a comment
There was a problem hiding this comment.
复查结论:通过
完成 cb6f63e5 五文件增量复查:缺配置清理保护及四组回归与既有契约一致,指定 CPU 用例通过,未发现新增问题;未变部分沿用前序已审证据。当前仅辅助 CI 有结果;GPU/多节点集成因缺少相应硬件未在本地执行。
已解决冲突 辛苦看看 |
Merge main 09e456c into the unified inference branch. Preserve topology-aware multimodal transport defaults alongside deferred CPU backups and static model memory-saver settings. Combine flattened DCS buckets with main's lock-release error handling without hiding the original synchronization error. Adapt initial-sync and DCS regression fixtures to the unified contracts, and cover lock-release failures in both regular and fully-async modes. Validation: 726 passed, 14 subtests passed, 33 optional SGLang/router skips. All pre-commit hooks passed. Real GPU and multi-node integration were not run on this CPU host; remote CI must validate the new merge head. Refs redai-studio#71, redai-studio#356
Merge main a155b62, retaining process-owned router cleanup and the unified inference shutdown retry contract. Resolve moved CPU test imports, preserve static-manager cleanup assertions, and adapt new router cleanup tests to the shared lifecycle owner. Validation: 734 passed, 14 subtests passed, 42 optional runtime skips. All pre-commit hooks passed. GPU and multi-node validation remain for CI. Refs redai-studio#71, redai-studio#356
|
本赛题已经由 #381 锁定,感谢参与~ |


Summary
Implements the RFC #71 unified inference service scope for Rollout, GenRM, and Teacher, with integration of GenRM elastic scaling from #370.
InferenceGateway, sharedInferenceManager/lifecycle, placement planner, routing schema, and compatibility client.GenRM integration
Commit
36ee4ba8edca29fcf6d1d563eaabc503842b5512integrates #370 atda4acbbab530f082f37c1633c811c704be5a044einto the previous #356 head,9eec00a186b4b92f32dc2aba9c23e673e2375b13. This PR now includes #370's implementation and original commit history, together with the compatibility fixes:REMOVED, reconcile unfinished cleanup, and create a fresh PG when recovering a failed elastic engine.--offload-rollout) and multi-GPU elastic engines before taking the training lifecycle lock or allocating resources.sglang_*tuning inheritance without overriding GenRM role defaults; per-model engine configuration keeps priority. Cover this contract in CPU tests that do not require SGLang.Elastic scaling retains #370's scope: single-GPU elastic engines and drain accounting within one Gateway. Consistent direct-client routing does not establish direct-client or cross-Gateway graceful drain. Pools that participate in training offload do not support live elastic scaling in this integration.
Acceptance evidence
The following are previously reported results from before the integration with #370. They have not been rerun after integration with #370 and do not establish GPU acceptance of the integrated head:
6654867: PP/PD routing and complete Megatron data flow passed.6772050: four-node split training passed, including Teacher writeback before GenRM and completed Megatron steps.6780723: four-node decoupled training passed, including Teacher results before training and dynamic Rollout updates.Evidence inherited from #370 and
demos/task4_genrm/likewise belongs to its original producing revisions, not a new integration run.The public API pages document the unified inference interfaces and usage:
docs/en/api/inference.mddocs/zh/api/inference.mdValidation
Current head:
0e1b7228bf3f058e9cca8e16bdea43357f9f2e5d.The current follow-up isolates the test-only SGLang import bridge: module-cache and parent-package bindings are restored on both success and failure, while an available runtime is imported unchanged. The isolation regressions passed 9 tests; the combined manager/precheck run passed 31 tests with 20 missing-SGLang skips and 5 passing subtests. These counts overlap. All pre-commit hooks passed before committing. The current head requires fresh remote CI results.
Remote validation on the preceding functional head
bf354e7:The following functional regression results were also collected on
bf354e7. Local environment: macOS arm64, Python 3.12.13, Ray 2.59.0, pytest 9.1.1, CPU only. Python commands ran throughuvin a temporary test environment.pre-commit run --all-filesThe four skips concern an unavailable Rollout import. The suite uses the existing test-only import bridges for unavailable optional dependencies; the argument regressions execute the production builder with a minimal supported
ServerArgsschema and do not require an installed SGLang runtime. Broader local CPU testing remains incomplete because this macOS environment lacks some Linux/runtime dependencies; it is not reported as a full-suite pass. Multi-node GPU acceptance has not been rerun after the integration; remote CI results must be assessed on the current head separately.The GenRM routing tests now consume canonical discovery snapshots and verify immediate admission changes, round-robin continuity and recovery. The watcher regression injects the exception at the processing boundary without a real deadline wait. Registry tests cross reduced test-only capacity limits repeatedly and verify eviction while protecting live and dirty records; production limits and CI timeouts are unchanged.
The VitePress documentation build passed on integration commit
36ee4ba; the subsequent fixes do not modify documentation.Test commands
TEST_PYTHONis the Python executable in the temporary test environment.Refs #71, #351; integrates #370.