Repository navigation
Conversation
保留训练 Actor、optimizer 和 scheduler,在共享累计预算内局部重建 Rollout 或独立 ActorFwd,并在确认旧工作终态和替代实例接管后继续训练。 组件拥有恢复准入,Ray 组协调服务握手和权重/评估派发,恢复执行器 拥有服务生命周期,Megatron 与 DCS 分别拥有本地模型导出和传输确认。 基于 PR redai-studio#548(RexFlux/Relax@0ab3d29)的功能与文档进行架构重划。 聚焦 CPU 回归 193 项通过;完整 Megatron/GPU 恢复验证仍有环境缺口。
Contributor
|
Thanks for contributing to Relax, @Yangruipis! 感谢你为 Relax 做出贡献! 📚 Contribution guide / 贡献指南Describe the problem, your changes, and how you validated them. Keep each PR focused and run 请说明问题、改动和验证方式,保持 PR 聚焦,并在提交前运行 🛠️ CI commands / CI 指令
Put one command on the first line of a new PR comment. Rerun/cancel require PR authorship or repository write access. 在新 PR 评论的首行写一条指令。PR 作者或有仓库写权限的贡献者可以重跑、取消 CI。 🔎 Merge requirements / 合入条件GitHub:✅ 满足合入条件
|
Remove the stateless core recovery executor and let Controller own the cross-service recovery sequence. Rollout owns its pending data window and replacement router configuration; the training backend keeps local training state and metrics rather than recovery policy. Preserve metrics and evaluation ordering across the deferred inference tail, including direct backend callers. Validate with 403 focused CPU tests and local GPU fault injection in colocate, async, and hybrid modes.
Make Megatron training and forward calls execute only their local work. Components always coordinate weight sync, evaluation, and metrics; the recovery switch controls admission and failure handling rather than selecting a second backend execution path. Move RL evaluation HTTP to the existing inference coordinator, preserve local offline evaluation, and align startup/recovery sender and receiver steps explicitly. Keep FSDP's backend contract unchanged.
Supply the normal parsed backend setting and mock the manager publication configuration in the existing initialization fixtures. Keep all sync and offline assertions unchanged. The affected file passes all 23 cases.
4 of 11 tasks
Preserve main startup sender/receiver cancellation and receiver selection, while retaining recovery admission and success-only synchronization release. Align the existing recovery startup test double with rollout_only. Validation: 387 CPU tests and 10 subtests passed; Ruff checks passed.
Select component recovery through --use-fault-tolerance for supported configurations and retain engine recovery elsewhere. Prevent legacy monitors, rebuilding, and fault injection from overlapping the new flow. Remove the separate enable environment variable while retaining the local attempt budget and drain timeout. Update existing tests and both guides.
Yangruipis
marked this pull request as ready for review
November 17, 2026 10:59
Yangruipis
requested review from
Lemon-412,
RexFlux,
SigureMo and
yuanlehome
as code owners
November 17, 2026 10:59
Contributor
Yangruipis
added a commit
that referenced
this pull request
Nov 18, 2026
## What 新增只读架构专家,并接入仓库的专家入口与 code-review skill。包含专家定义、加载入口、review skill,以及直接写入专家正文的架构案例。 ## Why 功能测试通过无法说明代码职责归属合理。架构评审需要判断代码放置、模块边界、依赖方向,以及新增抽象是否必要,避免只修局部故障或移动同一份耦合。 ## How - `arch-expert.md` 提供完整专家指引;复用现有 `.codex/agents`、`.claude/agents` 到 `.opencode/agents` 的链接。 - `arch-expert.toml` 定义 Codex 自定义代理 `arch_expert`,要求先完整读取 Markdown,并保持只读。 - `AGENTS.md` 增加架构任务触发入口及不同工具中的代理名称。 - code-review skill 要求审视完整职责链,并单独给出设计合理性与简洁性的结论。 - `.codex/agents/arch-expert.md` 正文内直接记录 #548 → #705 的职责优化案例:组件统一编排、Controller 协调恢复、资源操作归拥有者,并删除内部兼容双路径。案例随完整专家指引一起读取,无独立 reference 文件。 不包含 recovery 实现、实验记录或 RSI 专用回执/等待流程。 ### 专家如何产出:以真实改动驱动指引迭代 这份专家指引通过 DeepSeek 与 Codex 分工的 RSI 迭代形成:DeepSeek 负责生成和改进 `arch-expert.md`,独立 Codex 将指引用于真实 PR 的架构评审与修改,主评审根据代码结果给出反馈。迭代对象是可复用的架构判断方法,代码改动则用于检验指引是否能落实到职责、边界和调用关系上。 ```mermaid flowchart TD A["真实任务:评审 PR548 的恢复架构"] --> B["DeepSeek 生成或改进专家指引"] B --> C["固定本轮 MD 与代码起点版本"] C --> D["新开独立 Codex 会话<br/>不继承上轮对话,完整读取专家指引"] D --> E["检查相对 main 的完整 diff<br/>优化架构并验证行为"] E --> F["主评审独立评估代码结果<br/>按固定标准评分"] F --> G{"是否继续迭代?"} G -->|"未达预期且未到上限"| H["向 DeepSeek 返回分数与概括评语<br/>不提供评分细则或具体修复方案"] H --> B G -->|"符合预期或达到轮次上限"| I["整理专家指引、代码结果与验证结论"] I --> J["通用专家进入 PR706<br/>架构实践与案例见 PR705"] ``` 流程设置最多 10 轮,以架构评审结论决定是否继续。评测侧关注职责归属、模块位置、依赖方向、抽象必要性及行为保持;反馈给指引生成侧时仅保留分数与概括评语,避免把具体修复答案写进专家规则。独立会话及显式加载用于减少历史上下文干扰;功能测试用于验证行为保持,架构合理性由完整职责链的评审判断。过程中结合维护者反馈校准架构目标,最终将实践经验整理为通用指引。 ### 实践案例:从 PR548 到 PR705 的推理恢复职责优化 [PR548](#548) 提供真实恢复场景,[PR705](#705) 展示后续完成的职责重构。关键问题是训练后端同时承担服务握手、恢复准入和 RL HTTP 评估,而独立 Executor 又借用 Controller 的状态进行恢复编排。优化围绕“控制决策归编排者,资源操作归拥有者”展开,范围为 Megatron 路径。 ```mermaid flowchart TB subgraph Before["原实现 PR548"] BC["组件"] --> BT["训练 rank<br/>计算、恢复准入、服务握手、同步与评估"] BX["独立恢复 Executor"] --> BS["借用 Controller 的服务集合与状态"] end subgraph After["职责重构 PR705"] AC["组件<br/>阶段编排与 RecoveryGate"] --> AT["训练后端<br/>计算、模型状态与通信操作"] AC --> AS["同步协调模块<br/>服务握手、接收方选择与 RL 评估"] CT["Controller<br/>恢复流程编排"] --> OW["Service / Rollout / updater / DCS<br/>各自管理资源、清理与接收确认"] end ``` - 组件统一执行训练、同步、评估阶段;恢复开关控制准入与失败处理,收敛内部兼容双路径。 - 跨服务握手和 RL HTTP 评估从训练 rank 移到同步协调模块;后端保留模型、CPU 快照、通信操作与本地离线评估。 - 没有独立资源或生命周期的 Executor 收回 Controller;生成窗口清理由 Rollout 封装,传输资源与完整接收确认由 updater/DCS 管理。 这些调整减少跨层状态依赖和重复路径,保持用户可见的训练与恢复语义。案例已直接写入 `.codex/agents/arch-expert.md` 正文,供后续评审参考职责判断方法;具体目录与抽象仍需依据实际调用链决定。 ## Testing - [x] `pre-commit run --all-files` passes - [ ] Tests pass (`pytest tests/`) - [ ] New tests added (if applicable) - [x] Documentation updated (if applicable) - 全量 pre-commit 检查通过。 - skill validator 与 TOML 解析通过,确认共享 Markdown 链接可解析。 - 原提交 `6ad2f58` 已通过 Codex CLI 0.167.1 新会话启动 `arch_expert` 的加载检查,子代理不继承历史,返回的专家文件 SHA-256 与该版本一致,并确认只读角色及正文规则。 - 已将案例并入专家正文,删除独立 reference 文件及跳转;确认 `.codex/agents`、`.claude/agents` 与 `.opencode/agents` 入口内容一致。合并后未重跑子代理加载实验。 - 未运行训练测试:本 PR 只改变开发代理配置与工作指引,不修改训练实现。加载检查不等于架构判断质量评测。 ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [x] Documentation update - [ ] Refactoring (no functional changes) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs 无需截图。加载检查在临时目录执行,未将实验产物加入仓库。 --------- Co-authored-by: Yangruipis <[email protected]>
Reuse is_offline_mode to keep SFT, DPO, and RM on their existing data path when fault tolerance is enabled. This prevents the rollout recovery gate from waiting for train partitions that offline producers never write. Cover all three objectives through the existing recovery policy tests.
Merge main to match the PR CI checkout and retain its dataset-load error handling. Initialize the recovery gate and resume-data flag in existing Rollout test shells that bypass the constructor. Reproduced all seven CPU failures before the fixture fix; 98 related tests pass afterward. No new test cases or production fallback paths.
Preserve replay field selection and partition retirement, checkpoint scheduling, and Judge cleanup across recovery. Keep reference replay on the engine-level fault tolerance path because retired partition names cannot be reused within its run.
Collaborator
Author
|
/review |
Keep startup and recovery weight synchronization bounded. After a training rank fails, settle its peers before recovery can reuse their resources. Cover delayed storage ACKs and restore the offline OpenAPI build.
Collaborator
Author
|
/review |
Collaborator
Author
|
/review |
rai-studio-bot
suggested changes
Nov 24, 2026
Collaborator
Author
|
/review |
Yangruipis
added a commit
that referenced
this pull request
Nov 25, 2026
) ## What 将 Megatron 训练后的推理服务握手、权重同步调度和在线评估迁到 Actor 组件和 Ray 训练组。训练 rank 继续执行训练、保存和实际权重传输。这是 #705 的前置 PR,可单独合入 `main`。 ## Why 原先各 rank 的训练入口包含 HTTP 握手、选择接收者和评估收尾。把这些步骤放到组件层后,训练组每个版本只需与服务协调一次。后续 #705 可以在同一边界处理推理服务故障。 ## How - Actor 等训练组完成本轮计算,再协调权重和评估。普通、hybrid、fully async 三条训练路径共用这个边界。FSDP 继续使用它已有的训练入口。 - 托管 LoRA 保留自己的发布协议。启动时先配置托管发布,再绑定训练组,组件和 rank 在绑定时分别读取同一配置。[RolloutManager 配置入口](https://github.com/redai-studio/Relax/blob/580aac1d898f378b8e4307064033c560ab4d956d/relax/distributed/ray/rollout.py#L1178-L1212) - 普通异步握手成功后仍调用已有的 `/recover_rollout_engines`。ActorFwd 和 Reference 保留原有权重接收流程。 - hybrid 模式在发起本轮评估、结束权重更新窗口后刷新指标。最后一轮会等待评估完成。SFT、DPO 和 RM 的离线评估仍由训练 rank 执行。 ## Testing - 最新提交 `42bb5f91` 的 8 项远端检查全部通过。CPU 和单卡、四卡 H20 单测以及双卡多模态、四卡 GPU 与 NPU 异步训练均通过。最后一次测试改动在两层分别用真实 Ray/Serve 复跑了 3 个故障恢复场景。[单元测试](https://github.com/redai-studio/Relax/actions/runs/45574185399) · [集成测试](https://github.com/redai-studio/Relax/actions/runs/45574185489) - 复审修复版本 `580aac1d` 在 CU12 运行 8 个 CPU 测试文件,236 项通过。DCS 客户端访问真实 HTTP 地址,连续收到 503、503、200,同一训练 worker 先后返回两次原始拓扑错误,第三次完成训练。该实验采用单 rank Gloo,模型计算与 GPU 权重传输使用替身。 - fully async 的成功同步计入 `train`。失败轮不刷新指标,从训练计算结束到下一次重试的区间计入下一份 `train_wait`。定时用例核对了成功后的下一步和 timeline。Rollout 地址解析失败会向上传播,已发起的异步权重更新仍执行结束握手。 - 普通权重更新复用训练组方法,两个具名的异步入口负责向各 rank 提交。控制器可以按需等待每个 rank 的结果。 - 已在仅装 FastAPI 和 Pydantic 的文档生成环境导出四份 OpenAPI 规范,完整 `npm run docs:build` 构建通过。 - 在 CU12 镜像中隐藏 GPU,运行 Megatron、FSDP、Actor、权重握手和训练模式的 10 个相关测试文件,226 项通过。 - 用两个真实 CPU Ray worker 和本机 HTTP 服务验证了 5 种情况下的调用顺序,覆盖 colocate、hybrid、fully async 和握手失败。模型计算使用轻量替身。 - 使用双进程 Gloo 验证 SFT、DPO、RM 的离线评估间隔、rank 0 数据清理和 barrier;模型计算和数据服务使用测试替身。 - [ ] `pre-commit run --all-files` passes - [x] Tests pass (targeted suites above) - [x] New tests added (if applicable) - [ ] Documentation updated (if applicable) ## Type of Change - [ ] Bug fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [x] Refactoring (includes the hybrid metrics ordering described above) - [ ] Performance improvement - [ ] CI/CD or build changes ## Screenshots / Logs 定向测试可从 checkout 根目录复跑,例如 `python -m pytest -q tests/cpu/components/test_simple_inference_components.py tests/cpu/distributed/ray/test_inference_sync.py tests/cpu/backends/megatron/test_train_async_metrics.py tests/cpu/backends/megatron/test_hybrid_weight_sync_lifecycle.py`。 --------- Co-authored-by: Yangruipis <[email protected]>
Yangruipis
deleted the branch
redai-studio:yangruipis/refactor/post-train-inference-sync
November 25, 2026 08:33
Yangruipis
changed the base branch from
yangruipis/refactor/post-train-inference-sync
to
main
November 25, 2026 08:34
Collaborator
Author
|
/review |
rai-studio-bot
approved these changes
Nov 25, 2026
RexFlux
self-requested a review
November 25, 2026 11:17
5 of 11 tasks
dirtyDan0
added a commit
to dirtyDan0/Relax
that referenced
this pull request
Nov 29, 2026
Remove the managed, immutable multi-version LoRA publication introduced by redai-studio#475 and redai-studio#476, and connect Agentic generation to the existing fixed-name single-adapter path. This removes the version control subsystem, its public configuration APIs, its Session ownership protocol, and its custom SGLang control endpoints. Keep the original LoRA training and weight-transfer paths together with the independent correctness fixes carried by those PRs. 1. The capability Relax already had Before redai-studio#475 and redai-studio#476, Relax could train LoRA with either merge mode or adapter mode. Merge mode folds the learned delta into the base weights before transferring them to inference. Adapter mode sends the frozen base once and subsequently transfers the adapter under the fixed name relax_policy_lora. Colocate uses the existing in-memory tensor loading path. Fully asynchronous training uses the existing bucketed NCCL path. Ordinary rollout generation selects that adapter by sending its name as lora_path in the native SGLang request. That single-adapter transport is useful on its own. It reduces the amount of weight data sent at each synchronization point. It already existed before the version-publication PRs and remains the serving contract after this removal. The inference engine can use its existing pause, cache flush, same-name replacement, and resume sequence when weights change. 2. The concurrency problem that motivated the original feature The reference was Miles #3127. Its motivating example has adapters A, B, and C sharing a frozen base. They represent separate training identities with their own data and training progress. When A finishes an update and publishes A@2, existing generation using B or C should be able to continue. An engine-wide pause and cache flush interrupts those independent tasks. Miles addresses this by staging a fresh adapter name, transferring its complete weights, validating the update, and opening it for sampling after commit. The weight-update session in that path is a begin/send/end transfer transaction. Relax also has a possible overlap window in fully asynchronous training. A new snapshot of its single training policy can be transferred while requests using an earlier snapshot are still generating. The distinction between separate training identities and successive versions of one policy matters when choosing which parts of the reference to adopt. Relax's integration continued to train one adapter with one current optimizer state. It did not introduce independent A/B/C training jobs. 3. How the Relax requirement became substantially stronger Task 7 explicitly required an Agent Session to bind a version on its first generation and keep it through later tool turns, retries, and abort/resume. RFC redai-studio#418 made that requirement concrete through a central version owner, Session registrations, capacity accounting, and periodic reconciliation. redai-studio#475 supplied the immutable identity and state machine. redai-studio#476 connected that state to training export, engine loading, and resident Agent Sessions. The broader contract was already present in the task and RFC before the implementation was integrated. The important change in scope was the lifetime of the version reference. An inference request needs its selected weights while it can still be forwarded, retried, queued, or executing. Whole-Session binding also keeps the weights alive while an Agent has no inference request and is waiting on a tool. A slow tool can therefore keep an old version resident across several training updates. At the configured version limit, publication must wait or skip until those Sessions release their references. Whole-Session consistency is an additional sampling policy that needs its own algorithmic or workload justification. The existing full-weight path can use updated weights after rollout interruption and resumption. LoRA training also continues to optimize the current adapter, including when its batch contains samples produced by older versions. Keeping a Session on an old inference version does not select that old adapter for its training forward pass or make the batch automatically on-policy. The managed publication mode made this stronger policy inseparable from its concurrent-update mechanism. As a result, ordinary Agent execution became an owner of inference-weight retention and cleanup. 4. How subsequent upstream work inherited the LoRA contract The compatibility history helps explain the selective removal. The later commits generally carried the Session-binding rules through changes to shared infrastructure. Their fixes have value independently of the sampling policy that originally required the version manager. The following observations come from the upstream history through eb0ec97. They describe observable code and test changes. Benefit and cost still require a separate workload evaluation. - redai-studio#628, 043d7a2, reworked Agentic admission and resource reuse. It kept lora_key, lora_binding, and the existing Session version selection. It changed finalization so a logical result could be published before the physical cleanup completed. To make that work with managed LoRA, _release_lora_session recorded a pending release before waiting for a binding task. If cleanup timed out during the wait, heartbeat still had responsibility for retrying the release. Its revised test explicitly allowed a terminal Session result while the old version's session_count remained one, then expected zero after background cleanup completed. This is a compatibility repair around an existing Session reference. Retain independent Session progress, result publication, background cleanup, and unconfirmed-request ownership. Withdraw the additional version reference and its pending-release/heartbeat protocol. - redai-studio#655, d0e00f3, developed ordinary Qwen3.8 LoRA training and repaired the fixed-name adapter update failure path. The pre-existing managed branch remained alongside it. The important correction was that one rank's adapter-push failure had to reach all training ranks before any of them resumed generation or marked the new weights loaded. Keep that failure agreement and the ordinary model/adapter support. It does not depend on storing immutable versions or binding an Agent Session. - redai-studio#720, 0f6dac5, addressed ordinary policy-sample and weight-sync consistency, including the effective checkpoint and quantization used by inference receivers. Its new sender and quantization tests were added to test_actor_lora_publication.py, which already hosted the managed LoRA tests. This made a file created for version publication contain useful ordinary synchronization coverage. Retain those tests in the original file and retain the receiver/configuration checks. Remove cases whose contract requires the deleted publication service. - redai-studio#761, 21b3662, introduced shared router and multimodal replay ownership. It kept both the managed direct-engine transport and the normal router transport, wrapping them with post_generation_request. It added _BackendAttempt with the actual wire RID, target set, and send_done state. An abort acknowledgement arriving before a delayed generate request settled could not release ownership. _pending_backend_cleanups kept a Session alive while backend cleanup was unconfirmed. Managed tests also held session_count until a failed abort or release was safely retried. These changes show how a Session-bound weight reference had to follow the newer request-ownership model. Keep wire-RID tracking, replay leases, abort ordering and pending backend cleanup. Remove the separate managed transport, Session version reference, and LoRA release RPCs. - redai-studio#791, 7354e4f, moved post-training inference coordination out of training ranks into the Actor component and inference_sync.py. It preserved the managed bypass of ordinary rollout-update readiness and completion handshakes. To select that behavior, the component queried get_lora_training_config and passed _managed_lora_publication through the shared coordinator. A feature-specific assumption therefore moved into the component-level orchestration API. Retain the once-per-group coordination, evaluation and metric settlement. Delete the old configuration lookup, managed parameter, and handshake bypasses. - redai-studio#705, 50eb517, added local inference recovery around that coordinator. rebind_rollout_manager refreshed the managed configuration when replacing an inference target, and RecoveryGate supplied settlement and retry boundaries around training and weight synchronization. This continued the compatibility contract at a new lifecycle entry point. Keep rebind, RecoveryGate, waiting for all participating ranks, and verification of the expected replacement receivers. Rebinding the normal manager can proceed through these mechanisms after the version configuration query is removed. - redai-studio#804, 8c11399, hardened ordinary multimodal IPC and request cleanup. Its interaction with the managed-LoRA test file was an additional fixture binding for _finish_ipc_dispatch. Preserve the production IPC lifecycle corrections and their ordinary tests. The fixture-only increment disappears with the removed feature test file. While rebasing the retained SGLang patch, keep the required IPC method bindings and use one consistent fixture adaptation where the old and new patch sections address the same lifecycle fields. Verify the resulting patch by applying it to the actual pinned source. - redai-studio#805, 198f9a6, replaced the router infrastructure while keeping the LoRA branches around it. redai-studio#828, 250eca5, converted fault-tolerance and health arguments to direct reads inside the managed configuration checks. Keep the native routing and ordinary argument handling. The configuration checks that belonged exclusively to the removed version service are removed together with that service. The version manager, runtime, training publisher, and managed engine client under relax/engine/lora_versions and lora_client.py have identical contents at redai-studio#476 and upstream eb0ec97. The repository's managed configuration calls still occur in definitions and tests, with no training script or example adding an automatic activation path. This establishes how the in-repository integration evolved. External callers and deployments are outside this source inspection. The resulting pattern is that shared scheduling, replay, synchronization, and recovery improved while continuing to honor a strong existing Session contract. Maintaining that contract required repeated work in surrounding systems even as the version-control core remained fixed. A compatibility test demonstrates that a refactor respected its existing contract. The justification for keeping whole-Session version pinning also needs evidence that its sampling semantics and retention cost fit Relax's workloads. This removal follows those responsibility boundaries. Preserve each independent correction at its existing owner and preserve the ordinary single-adapter update path. Withdraw the version owner, cross-Session weight-retention policy, dedicated transport and control APIs that caused those systems to depend on managed publication. Reversing the original PRs mechanically would also discard later useful work, so each affected path is reduced to its ordinary behavior and its independent protections. 5. The concrete initialization conflict exposed by first-step prelaunch The integration assigned a SessionKey in start_group only when a LoRA runtime had already been installed. set_lora_runtime rejected a Shard with any existing Groups. RolloutManager first synchronized and published the initial adapter, then injected the runtime into the Shard fleet. First-step prelaunch deliberately constructs PREPARE Groups before engine initialization is complete. Their first inference requests remain queued behind Runtime admission. Those Groups are safe to prepare before weights are available, but the separate empty-Group configuration invariant still rejects them. Merely deleting that check would also be unsafe. A Session created before configuration could lack its key, and the old dispatch branch used the presence of that key to select managed generation. The implementation actually bound weights at the first permitted inference dispatch. Nevertheless, its earlier key-allocation and runtime injection rules imposed a stricter construction order. This coupled Agent startup to initial weight publication and prevented the intended overlap between preparing Agents and initializing inference engines. This affected runs that explicitly configured managed publication. The ordinary training scripts did not automatically enable that API-only mode. 6. Why the managed subsystem is removed The additional policy required a dedicated LoRAVersionRuntime Ray actor, SessionKey allocation, per-Session binding tasks, Shard registration, release retries, heartbeats, sequence watermarks, engine inventory, publication attempts, capacity states, and shutdown calls back into Shards. Generation also acquired a LoRA-specific route directly to a verified engine. Those responsibilities crossed training, rollout orchestration, Agent lifetime management, and inference transport. The integration further introduced shared-file snapshot publication and an extra training control path alongside the working IPC/NCCL adapter updates. Its automatic publication required a fixed Agentic/Megatron fully-async pool and disabled recovery and several engine configurations. These restrictions and ownership rules made the feature expensive to maintain and exposed the initialization conflict described above. The existing Agentic rollout-step boundary still pauses and aborts active requests according to its scheduling rules. Resuming a Session on its old adapter preserves weight identity across that interruption. It does not establish uninterrupted execution for the entire Agent. Concurrent adapter publication has a valid narrower purpose, but retaining the complete Session-bound subsystem requires evidence for its stronger contract and its integration cost. The feature is withdrawn here with that boundary made explicit. 7. What this commit removes and restores - Delete relax/engine/lora_versions, including immutable snapshot identity, shared-file artifacts, the version state machine, publisher, training publication coordinator, and the dedicated Ray actor. - Delete the managed SGLang LoRA client and the Relax-specific inventory, load, fencing, and reclamation control protocol from the 0.5.17, 0.5.20, and 0.5.21 dependency patches. - Remove RolloutManager's managed configuration, publication and actor-handle APIs, the publication concurrency group, and feature-specific fixed-pool restrictions on normal lifecycle operations. - Remove Agentic runtime injection, SessionKey and version state, binding tasks, heartbeats, release watermarks, version metadata overrides, and LoRA-specific direct-engine generation and endpoint tracking. - Remove the training publication configuration, topology lease, publication result handling, and the managed bypasses of normal weight-update readiness and completion handshakes. Retain the shared inference-sync implementation and its later recovery integration. - Delete tests whose product contract disappears with the version manager, managed configuration, immutable publication, or whole-Session binding. Adapt mixed tests to exercise ordinary router, replay and request cleanup. Keep their original file names and their independent assertions. SGLang's native ability to load named adapters remains available. The removed API is Relax's additional managed publication and Session-binding layer. Manual users of configure_lora_training, configure_lora_versions, or get_lora_version_runtime must move to the ordinary adapter-mode path. 8. What is kept, and why each part remains useful The fixed name relax_policy_lora, existing adapter export and gather, colocated tensor transport, fully asynchronous NCCL buckets, merge mode, and ordinary rollout request construction all remain in place. Ordinary LoRA updates retain the existing scheduling and synchronization contract. The later PRs also contain independent changes that were integrated around the publication code. Retain those changes through their ordinary paths. - redai-studio#655 keeps Qwen3.8 LoRA training and adapter export support. In the normal DeviceDirectBackend update, all training ranks reduce the adapter-push failure flag. A failed push raises before continue_generation, and only a confirmed successful push sets adapter_loaded and base_sync_done. This prevents rollout from using a partially updated adapter. - redai-studio#628 keeps independent progress of Sessions within a Group and publishes the logical Session result before scheduling process and backend cleanup. _pending_backend_cleanups retains ownership of unconfirmed requests so cleanup can finish safely after logical retirement. The empty actor_fwd/reference-group gate also remains, avoiding communication to recipients that do not exist. Remove the separate LoRA Session-release and heartbeat work from this cleanup path. - redai-studio#640 keeps synchronization of same-checkpoint NEXTN draft weights. The normal model and draft synchronization path continues to determine which inference weights are transferred. - redai-studio#720 keeps effective receiver-checkpoint and quantization configuration during weight conversion and transfer. Its ordinary quantization cases remain in test_actor_lora_publication.py under the original file name. The file name alone does not make these cases publication-specific. - redai-studio#761 keeps router and multimodal replay, response manifests, and cleanup using the actual wire request ID. Mixed replay tests use the ordinary router transport after removal of the LoRA-specific direct-engine path. Their success, lost-response, and late-publication expectations remain. - redai-studio#791 keeps post-training inference coordination in the Actor component and inference_sync.py. Readiness checks, weight synchronization, evaluation completion, and metric settlement still run through the shared coordinator. Remove the managed flag and its handshake bypasses. - redai-studio#705 keeps local inference recovery, RolloutManager rebinding, RecoveryGate settlement, and checks that the expected replacement engine actors actually received their weights. Rebinding no longer queries the deleted managed LoRA configuration API. Keep unrelated image and model support already integrated around the SGLang patches, including the CUDA 12/0.5.21 image work from redai-studio#503 and the 0.5.17 DeepStack correction from redai-studio#788. The dependency version pins and existing platform patch application paths remain the basis of validation. The following fixes introduced with the version feature also remain because their failure modes are reachable without multi-version serving. - Keep Megatron Bridge wrapper forwarding of *args and **kwargs in _make_adapter_splice_wrapper. Upstream adapter export can pass additional arguments such as exclude_adapter_base_prefixes. Dropping those arguments breaks ordinary adapter export as well. Its existing regression remains. - Keep max_staleness > 0 in Agentic _step_can_close. With zero staleness, training must consume the current partition before a later rollout can proceed. Closing the current partition with missing samples can leave training waiting for rows that a blocked next rollout would have to produce. The existing zero-staleness regression remains. - Keep ordinary LoRARegistry acquire and cancellation handling. Hold the registry lock while looking up an adapter and incrementing its request count so unregister cannot pass between those operations. If acquisition is cancelled after incrementing part of a batch, roll those increments back. This protects ordinary single-adapter load/unload as well. - Keep ordinary SGLang request cleanup fixes. Requests dispatched to the scheduler retain their adapter reference until terminal output or abort acknowledgement. Parallel-sampling children share the parent's lease and keep it alive until all owners finish. A retired logical parent can still cancel its running children. These rules protect a single adapter during replacement as well as any normal named-adapter request. - Keep the request lifecycle identity checks in the 0.5.21 patch. A delayed abort waiter or failed handler must not delete a new request that reused its RID. Validate a complete batch for RID conflicts before adding states so a later duplicate cannot leave an earlier half-registered request. Preserve the associated ordinary tokenizer lifecycle tests. The other supported SGLang patches retain their version-appropriate cleanup fixes. - Keep the global Bridge parameter-name initialization and its regression for the first synchronization. That test also exercises a non-LoRA configuration and protects the normal weight-transfer path. These retained pieces have explicit behavior and failure cases independent of the removed version manager. Their presence is intentional, so this is a selective removal that preserves independently useful fixes. 9. The small Agentic single-adapter connection Ordinary rollout already sent lora_path=relax_policy_lora before redai-studio#475/redai-studio#476. The earlier Agentic native /generate request did not carry that field. After removing managed binding, enabling the engine's LoRA support alone would still let such a request select the base model. Add the same mode check and fixed-name field directly where the Agentic SGLang payload is built. The implementation adds four nonblank lines and reuses LORA_ADAPTER_NAME. Adapter mode selects the already loaded policy adapter. Merge mode and full-weight requests retain their existing payload. The existing router, request ID, admission, pause/resume, abort, replay and cleanup paths carry the request. This closes the separate single-adapter integration gap with a local request-field change. 10. Validation and evidence limits During this removal, the retained dependency patches were applied to fixed SGLang 0.5.17 29481685, 0.5.20 94602c9c, and 0.5.21 e00930c5 sources. All three normal combinations, the 0.5.21 CUDA 13 two-stage application, and the ROCm exclusion/overlay sequence applied successfully. The retained 0.5.21 embedded ordinary request regressions passed 13 cases after adapting their existing fixture to the preserved lifecycle registration contract. Those checks validate source transformation and CPU request behavior. Final targeted CPU verification passed 34 existing eager Agentic generation, backend abort-target, checkpoint-resume and Bridge forwarding tests. Three temporary payload checks exercise the actual Agentic request construction with controlled HTTP for full-weight, merge and fixed-adapter requests. Full pre-commit checks passed against the complete tree. Temporary payload checks are removed after execution. No permanent test file is added by this commit. CUDA devices are unavailable in the local environment. Real Megatron training, GPU numerical equivalence, multi-node execution, and rebuilt training images remain unverified. No throughput or latency improvement is claimed. The removed publication GPU tests are retired with their removed feature contract, and the ordinary LoRA training tests remain available for hardware validation. References radixark/miles#3127 https://github.com/redai-studio/community/blob/main/contributor-program/2026-cohort-2/official-task.md#task-7 redai-studio#418 redai-studio#475 redai-studio#476 BREAKING CHANGE: Remove Relax's managed multi-version LoRA publication APIs and whole-Session version-pinning behavior. Ordinary LoRA merge and fixed-name adapter serving remain supported, with fixed-name selection also connected to Agentic generation.
nianliunian
pushed a commit
to nianliunian/Relax
that referenced
this pull request
Nov 30, 2026
Resolve two conflicts and reconcile the version-source contract with main's new managed LoRA publication (redai-studio#705): - state.py: keep both main's MoE route-span imports and this branch's WeightVersionSpan import; build_sample keeps the response_start offset. - device_direct.py: keep main's managed-publication fast path and this branch's actor_fwd_only rule (an actor_fwd-only sync advances weight_sync_attempts but not the published ordinal). Managed mode labels generation from `session.lora_binding.version_id`, so the counter doc now says the ordinal covers the traditional weight-sync paths. Follow-through so a consumption stamp joins the same sequence generation reports: add DeviceDirectBackend.published_weight_version (managed: publisher.published_version, so a capacity_skipped publication does not advance it; traditional: weight_version) and have the actor read it. Extend the helper test to cover the managed sequence.
3 of 11 tasks
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.



What
#791 已合入
main。本 PR 以main为基线,Files changed 展示 Rollout 和 ActorFwd 局部恢复的增量。这个 PR 让 Controller 在支持的训练配置下局部重建失败的 Rollout 或 ActorFwd,并保留原训练 Actor、优化器与调度器。恢复时先停止准入,等待旧操作结束,再清理未训练分区、重建推理资源、确认权重完整接收并继续训练。无法确认安全时转入全局重启。
Why
单个推理服务故障也可能触发整个训练作业重启。局部恢复需要确定旧服务已交还共享资源、训练进度可续接,以及替换实例拿到了完整权重。
How
--data-source-path需实现discard_pending(),清空待处理样本并保留游标。缺少该方法或调用抛错时,Controller 会转入全局重启。Testing
在单机 H800、CUDA 12 上,用 Qwen2.5-1.5B-Instruct 和 GSM8K 跑 Megatron + SGLang 的 GRPO 训练。前三组从
a091790c的干净归档启动,第四组直接从 PR 最新提交1e6e9c09的干净归档启动。两版只差中英文指南,relax/的 Git tree 均为02e41bd1。4。os._exit(86)退出ActorDiedError,Controller 判定局部恢复不安全,执行一次全局重启。此配置未保存 checkpoint,新训练进程从初始模型重跑第 0–7 步。3,另一台没有收到更新。4 个原训练 rank 各自上报缺少同一接收方,Ray 独立记录了 4 个失败任务。局部恢复被拒,原训练 rank 停在第 1 步。全局重启一次,4 个新 rank 均重跑完第 0–5 步。四组训练作业的退出码均为 0。本轮故障注入使用单机。
另在
1e6e9c09的隔离 CPU Ray/Serve 作业中加载了缺少discard_pending()的自定义数据源。第 0 步训练结束后杀掉推理子进程,生产 Rollout 清理待处理样本时抛出AttributeError,Controller 进入第 1 次全局重启。本组用轻量训练和队列替身,观察至全局重启入口。a091790c基于main@7354e4fa。在指定 CU12 镜像上从该提交导出的干净代码复跑了 13 个相关文件,393 项全部通过。切换前后的完整 Git 补丁经逐字节比对相同,共 69 个文件,新增 5,676 行、删除 403 行。在 CU12 镜像中隐藏 GPU,在拆分时运行 14 个文件的定向测试,337 项通过。涵盖 Controller 局部与全局重启、Rollout/ActorFwd 重建、权重接收确认和评估异常传播。
拆分完成时的
b3a8059e与将原获批版本051bb106合到main@b9142f93的文件树相同。之后的前置复审修复已同步到d48ea79a。此提交在 CU12 运行 13 个 CPU 文件,393 项通过,覆盖故障恢复、权重同步、评估和计时。此次未重跑多节点 GPU 故障注入。双 rank 真实 Ray 实验覆盖两种权重更新入口。两个 rank 都结束后才开始评估。一个 rank 明确失败时等待其余 rank 结束,再返回原始错误;另一个 rank 超时未结束时返回
UnsafeInferenceError。pre-commit run --all-filespassesTests pass (targeted suite above)
New tests added (if applicable)
Documentation updated (if applicable)
Type of Change
Screenshots / Logs
前置编排及该版本的独立验证见 #791。下方保留此前 #705 的完整范围、复跑命令与逐版验证记录。
拆分前的背景与验证记录(截至 051bb10)
What
基于 #548 的独立实现修订稿,面向
main。保留局部推理恢复功能与中英文文档,重新划分恢复、同步和训练职责。core/inference_recovery_executor.py包装层。组件拥有恢复准入与训练/推理阶段边界,Ray 组级协调负责服务握手和权重派发,训练 rank 不读取共享恢复状态或决定恢复策略。仅包含 recovery 生产代码、测试和文档,不包含 agent、skill、加载配置或实验产物。
Why
原实现让训练 Actor 感知推理服务的恢复准入、生命周期与握手时序。只移动 helper 不能解除职责耦合;引入无实际职责的中间执行器也增加追踪成本。此次让既有资源所有者承担相应职责,并在真实训练中验证行为。
How
架构对照与范围
对照原作者 #548 接手时的
0ab3d29a与当前实现2ee4ffc,主要针对 Megatron。FSDP 实现保持原有契约;此次调整未扩展到整个后端体系。原作者实现中,组件已有任务准入,但训练 rank 内仍包含同步准入、服务握手和 RL HTTP 评估:
当前正常训练路径
组件决定阶段时序,训练后端执行持有模型与通信资源的具体操作:
开启和关闭 recovery 都由组件编排这条正常路径;开关只控制准入、排空和失败处理,不再选择编排发生在哪一层。删除
defer_inference/defer_weight_receive双路径。Colocate 发送权重后刷新训练指标,再请求评估。full-async 在推理阶段之后刷新。主线 hybrid 在发送权重后、请求评估前刷新,本 PR 的 hybrid 在请求评估并完成 Rollout 释放握手后刷新,最后一步还会先等评估结束。已验证调用顺序和刷新所用的训练步编号;未在相同训练输入上逐项对比两版上报的指标值或上报时间。离线训练保留所有模型 rank 参与的本地评估/predict,不进入普通 RL 服务握手。ActorFwd 和 reference 均由组件显式调用:
当前故障恢复路径
发送和接收两端使用明确且一致的
sync_step,避免从 checkpoint 启动时使用尚未对齐的组件 step 推导接收集合。保持原训练 Actor、optimizer 和 scheduler 的局部恢复语义;全局重启仍遵循原有重建路径。职责归属变化及理由
Controller 已拥有服务集合、恢复任务和全局接管约束,因此将没有独立资源或生命周期的 Executor 收回其私有恢复流程。Rollout、Service、updater/DCS 管理自己的状态和资源,减少外部调用方穿透内部实现。
训练后端仍保留权重发送、CPU 快照、通信客户端重置和本地离线评估等操作,因为模型与相应资源实际驻留于各 rank。此次迁移的重点是服务级决策和编排;用户可观察的行为契约需要保持,旧私有调用形态不自动构成兼容要求。
容错配置
SFT、DPO、RM 等离线模式通过共享的
is_offline_mode()判定排除组件级恢复,不创建 RecoveryGate 的恢复状态;保留用户的use_fault_tolerance配置及既有离线训练路径,避免等待 RL 的train_<step>分区。统一使用
--use-fault-tolerance开启容错,默认关闭。支持组件级恢复的配置使用 Controller 恢复流程,并停用旧引擎监控、自动重建和旧 CI 注入;其他配置保留原有引擎级容错。同步暂停握手保留,新旧恢复互斥。删除
RELAX_ENABLE_INFERENCE_RECOVERY;保留RELAX_INFERENCE_RECOVERY_MAX_ATTEMPTS与RELAX_INFERENCE_RECOVERY_DRAIN_TIMEOUT。局部尝试预算与--max-global-restart仍分别计数。Testing
051bb106的 8 项必需检查全部通过。CPU 和 H20 单卡、四卡单测中,CPU 为 10,948 项通过、115 项跳过,另有 31 个子用例通过。双卡 GPU 多模态、四卡 GPU 异步、四卡 NPU 异步集成、文档构建和静态检查均通过。本轮在指定 CU12 镜像单独运行 207 项相关回归,包含恢复排空、评分插件回退和数据集自定义生成器的显式评分异常。本轮没有运行多节点 GPU 故障注入。自定义评分回退
复审 确认前次五项反馈已修复,并指出自定义 reward 内部回退成功后仍可能误报终止错误。b0ac3ca3 保留插件捕获的原始异常类型,只登记实际退出评估任务的评分失败。指定镜像中验证了普通打分和分组打分、内联和后台评分。插件返回有效分数时训练会保留该分数。同批另有生成失败时,训练收到原生成错误。插件未处理的评分失败仍以
EvalJudgeError传回。7828ff91 修复了任务组中未处理的评分错误在恢复排空时被丢弃的问题。051bb106 修复了复审发现的另一种包装方式。插件用
raise ... from exc给同一评分失败补充说明时,Manager 的评估和恢复排空都会报告评分错误,并保留插件说明。插件已处理评分失败、后备生成请求自身失败时,评估仍报告生成错误。自定义评分回退(CPU,验证镜像
qs-20261124-447fe38f-cu12)ValueError后,评估报告生成的ConnectionError。放行评分异常时,评估报告EvalJudgeError。后台评分和同步评分各有一个单样本用例,在测试进程直接调用EvalJudgeWorker.score和RewardWorker.compute_custom,均断言得分 4.5。RolloutManager.eval → SGLang → RewardExecutor探针开启group_rm=True,每个 prompt 生成一条。组评分捕获原始异常后得到[4.5]。同批再注入一个生成失败时,Manager 抛出ConnectionError,记录的评分错误数为 0。单独直接调用后台EvalJudgeWorker.score,单样本和分组请求也都得到[4.5]。RewardWorker发起单样本compute_custom.remote。局部恢复关闭、开启各一次,插件均捕获原始ValueError并返回 4.5。仓库里另有两个 RPC 用例分别核对独立 worker PID,以及三条样本的批量返回顺序和数量。从 checkout 根目录复跑仓库用例
复跑额外的 SGLang 分组评分和同步 RewardWorker RPC
第一条命令复用单样本用例的故障注入和断言,将评分切到
group_rm=True。同批含一条生成失败,分别检查评分回退成功和未回退时的错误。第二条命令在独立的 Ray worker 注册故障评分器,调用仓库的同步回退插件。
健康回调与并发评估错误
修复提交 14fbf5d7 将同角色健康回调的检查放在认领重启的锁内。正常训练收尾时,已知的评分或上报错误优先。只有生成失败时,仍会及时报错。原生 SGLang 评估将缺少 reward 字段识别为评分失败,并在同一请求的并发数据集和样本间保留已观察到的评分错误。
指定 CU12 镜像的 127 项定向测试通过。真实 CPU Ray/Serve 对照中,同一个评分响应缺少配置字段时,前一提交清理了训练分区一次,修复后 Controller 收到带字段名的
EvalJudgeError,分区清理次数为零。另验证了后台评分卡住、指标写入失败与 RPC 延迟返回的情况。中英文站点构建通过。本机未运行多节点故障注入。该提交的 8 项必需检查均已通过。CPU 为 10,941 项通过、115 项跳过,另有 31 个子用例通过。H20 单卡、四卡单测以及两项 GPU 和一项 NPU 集成均通过。单元测试 · 集成测试
并发评估与恢复
行为修复 b71dd88e 处理了 2 个 P1 和 2 个 P2。局部恢复等待旧操作、评估提交和评分共用同一截止时间。恢复线程在退出前记录终止性的评分错误,防止后续健康回调将其覆盖。旧 Rollout 在排空前关闭评估入口,并跟踪每个已受理请求的生成、评分和上报。
done=false,排空后的新请求返回 HTTP 503。内联结果写入失败以及另一请求仍卡在生成时的后台评分失败都能传回。将恢复预算设为 1 秒并让评估卡住,Controller 在 1.001 秒后超时,清理训练分区调用次数为 0。本机未运行 GPU 或多节点故障注入。最终提交的远端单测全部通过。CPU 为 10,931 项通过、115 项跳过,另有 31 个子用例通过。H20 单卡、四卡单测以及 Qwen3.5 双卡视觉语言、四卡 GPU 异步、四卡 NPU 异步集成测试均通过。
前次复审修复
415fc621 修复了四种恢复场景。
--keep-old-actor时使用引擎级容错,保证旧策略快照按原训练流程轮转。纯 fully-async 仍支持组件级恢复。在 cu12 训练镜像中运行了 34 个相关 CPU 测试文件,1072 项测试和 10 个子测试全部通过。真实 CPU Ray/Serve 进程验证了游标和评分错误能跨进程传回 Controller。另用实际参数解析器验证了 hybrid 的旧策略准入,用实际 Advantages 循环验证了末步回退保留分区。中英文文档构建通过。本轮未在本机运行 GPU 或多节点故障注入。
复审修复
5a189bf6将组件恢复限定在启动时的引擎池,原生和外部扩容均在创建请求前返回 HTTP 409。测试使用公开请求列表确认队列为空,并确认执行入口未被调用。扩缩容相关 107 项测试通过,中英文文档构建通过。复审修复
7d36a1ef恢复训练后权重传输的 600 秒等待上限。开启组件恢复时,如有权重 rank 始终 pending,Actor 保留同步预约与训练分区,交给全局重启。正常训练和前向计算继续等待各 rank 自然完成。新增 pending rank 用例在旧代码上失败,修复后两个相关 CPU 测试文件共 59 项通过。 真实 Ray CPU 对照把等待上限缩短到 0.6 秒。旧实现超过 1.2 秒仍卡住,新实现在 0.604 秒报错;Ray 此时仍有 1 个 pending rank,训练步和分区均保留。复审修复
1ce96532:本轮复审
468de314修复了 full-async/hybrid 权重握手和同步非共置的恢复选择。修复前,Rollout 准备、ActorFwd 探测和 Rollout 释放三处连接异常均被吞掉。修复后,三个回归均验证 Actor 保留同步预约和原训练分区,训练步不会前进。准入测试使用真实 CPU 状态矩阵,反转就绪值的对照会失败。验证结果:34 个相关 CPU 测试文件共 1055 项通过,另有 10 个子测试通过。最终使用 CPU Torch 张量的准入测试文件另行复跑,21 项通过。隔离的 CPU Ray Serve 烟测确认关闭健康检查后,训练入口以错误码 1 退出,等待中的接收副本和其子 rank 在 Ray 关闭前已终止。完整文档构建通过。本轮未运行 GPU 或多节点故障注入。
本轮复审修复
aaf4d1d7:npm run docs:build通过。本轮未重跑 GPU 或多节点训练。最终提交
e97938f3按 CI 要求调整两处 docstring 的换行,18 项定向回归复跑通过。历史版本的验证记录
当前 CPU CI 修复版本:
f95759d61db7f4f529eeba1896a47f8d96ac2ee9,合入main@c75b0a1c对齐 CI 的合并测试版本。两个跳过构造函数的 Rollout 测试对象补齐_resume_data_source和真实RecoveryGate初始化,仅增加 3 行,不新增用例或生产兜底。原 7 项失败已在本机复现,修复后相关 98 项 CPU 测试通过。新版本远端 pre-commit 已通过,CPU 单测等待 runner:本轮 Unit Tests。当前修复版本:
54fa2be7d7c8ed6c89041611d048456fbed0a260。离线准入三模式回归在修复前全部失败、修复后通过;相关恢复测试 83 项、离线运行时与 Actor 分区测试 71 项通过,共 154 项。全量 pre-commit 通过,独立复核未发现阻塞问题。本轮未运行 GPU/多节点训练,以下历史硬件证据仍仅对应各自注明版本。此前验证版本:
02bbea180f325e084f4ac4c0a120db6c77289255。本轮 80 项相关 CPU 测试通过,全量 pre-commit 通过;未重跑 GPU/多节点训练。以下既有验证记录仍对应各自注明版本。本次冲突处理:
975194876d24f0ff633dc94dc7c9c077f28675bd合入main@d0e00f3。Controller 同时保留启动同步失败时取消其余任务,以及 recovery 准入和成功后的解锁;同步适配旧测试桩的rollout_only参数。本轮验证:本机 387 项 CPU 测试及 10 个子用例通过;此前指定镜像内 39 项后端/恢复/LoRA 同步 CPU 测试通过,合计 426 项及 10 个子用例;冲突文件 Ruff 检查通过。本轮未重跑 GPU/多节点训练,以下 GPU 证据仍对应原注明版本,不能视为本次合并版本的 GPU 验证。
此前验证实现:
2ee4ffc6d63bb(生产tree1e149bbe234527970c2f65416fa7cf8d12a8cbaf)。本轮只调整7个已有生产模块,未修改FSDP实现、CLI或agent/skill。GPU固定源码与提交仅有两处新增docstring的自动换行差异,无行为改动;最后一个提交仅适配测试夹具,生产tree与7caada8相同。pre-commit run --all-filespassespytest tests/)CPU:当前提交的全量CPU CI为 9909 passed、0 failed、155 skipped,另有3个subtests passed。跳过项未计通过。原11项失败均为初始化测试手工构造配置缺少backend字段及manager配置响应,已只改夹具并保留原有断言。
本机相关套件分别1077项、真实Ray/Serve全局恢复及收发回执206项、CI夹具文件23项通过;本机21项既有tokenizer前置条件skip未计通过。最终等待策略变更后另有86项关键回归及3个subtests复跑通过。未手动运行未分组的全仓
pytest tests/。本轮GPU四项均正常退出并通过独立审计。使用目标训练镜像(ID
sha256:7be0cf58e0007e1d6d06eb233d62d4cb8efcf5294e6c10e6fce94a99b95cda1b)、已有Qwen2.5-1.5B-Instruct+GSM8K资产、单节点H800、训练TP2/推理TP1、非零有限梯度及decode CUDA graph。四项均验证真实恢复和后续训练,不以服务启动状态代替通过。完整日志、argv、原始观察和审计保留在本机,实验产物未加入源码。
历史GPU边界:
d16fbf9还实测通过DCS部分接收拒绝与全局回退、HealthChecker全局恢复及原生token回执链。这两项未在本轮新编排上重新运行GPU;本轮真实Ray/Serve和回执CPU回归覆盖了对应控制链,不冒充GPU重测。边界:Ray按仓库本机入口提前启动;未验证多节点、推理TP2、长期收敛、吞吐等价、GPU/节点丢失或hung检测。全局重启从HF重建,不承诺跨global保留optimizer。对象身份/版本不等于逐字节数值等价。此前提交通过的远端检查包括:pre-commit、CPU全量、H20单卡/四卡单测、多模态GPU集成、全异步GPU集成及全异步NPU集成。
Type of Change
Screenshots / Logs
上表只记录本版本实际执行的测试;每个训练用例保留独立 driver/Ray 日志、argv、原始观察与审计结果。