Skip to content

【No.15】feat(agentic): audit rollout weight versions at training consumption - #629

Open
MU-ty wants to merge 3 commits into
redai-studio:mainfrom
MU-ty:codex/task15-weight-version-audit
Open

MU-ty wants to merge 3 commits into
redai-studio:mainfrom
MU-ty:codex/task15-weight-version-audit

Conversation

@MU-ty

@MU-ty MU-ty commented Nov 11, 2026

Copy link
Copy Markdown

What

Track the policy version and token range of each committed generation fragment. Report policy age for the rows consumed by Megatron Fully Async Agentic training. Include per-sample diagnostics in the existing debug training dump.

Why

A tool wait or partial-rollout resume can span multiple weight publications. A completed response can also wait for training while newer weights are published. The audit measures these stages separately.

Relates to #321 and Contributor Program Task 15.

How

  • Carry committed fragment ranges through Session export and the standard TransferQueue sample converter. Exclude cancelled attempts and unselected branches.
  • Assign consecutive publication ordinals to successful DCS rollout syncs. Preserve missing or unrecognized versions as unknown.
  • At Actor consumption, report generation span, post-generation lag, token-weighted lag and missing-version fraction. Use the training input loss mask and exclude VPP padding batches.
  • Document the current scope and a reproducible tool-wait and partial-resume example.

Testing

  • python -m pytest -q tests/cpu/agentic/test_policy_audit.py — 3 passed on the current main base.

  • Ruff lint, format and Python compilation passed for the changed Python files.

  • Full pre-commit was attempted locally. GitHub connectivity blocked fetching the first hook repository.

  • The DCS regression requires Ray, which is unavailable in the local environment. GPU end-to-end training is unverified.

  • pre-commit run --all-files passes

  • Tests pass (pytest tests/)

  • 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
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD or build changes

Screenshots / Logs

The CPU example reproduces two publications during a tool wait, a later partial resume and one publication after generation. It reports a generation span of 3, post-generation lag of 1, token-weighted lag of 2.4 and zero missing versions.

Record committed generation fragments and audit policy-version lag at
Megatron Fully Async Actor consumption.

Relates to redai-studio#321.
@MU-ty
MU-ty requested a review from a team November 11, 2026 05:42
Copilot AI balanced review requested due to automatic review settings November 11, 2026 05:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@rai-studio-bot

rai-studio-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for contributing to Relax, @MU-ty! 感谢你为 Relax 做出贡献!

📚 Contribution guide / 贡献指南

Describe the problem, your changes, and how you validated them. Keep each PR focused and run pre-commit run --all-files before submitting.

请说明问题、改动和验证方式,保持 PR 聚焦,并在提交前运行 pre-commit run --all-files。

English contribution guide · 中文贡献指南

🛠️ CI commands / CI 指令
Command / 指令 Usage / 用途
/rerun Retry failed CI / 重跑失败的 CI
/rerun <target> Rerun a workflow or check / 重跑指定 workflow 或检查
/cancel <workflow> Cancel an entire workflow / 取消整个 workflow
/help Show commands and targets / 查看指令和 target
/review Request a code review / 请求代码 review

Put one command on the first line of a new PR comment. Rerun/cancel require PR authorship or repository write access.

在新 PR 评论的首行写一条指令。PR 作者或有仓库写权限的贡献者可以重跑、取消 CI。

CI usage and targets · CI 用法与 target

🔎 Merge requirements / 合入条件

GitHub:⏳ 合入条件未满足

Requirement / 条件 Status / 状态
审批人数 ⏳ 0/1 · 至少 1 位有仓库 write 或更高权限的人 Approve
团队审批(relax-block-reviewers) ⏳ 0/1 · 可联系:Aurelius84, Yangruipis, RexFlux, yuanlehome, SigureMo, NINGBENZHE, Lemon-412
CI ✅ 已通过

@rai-studio-bot

rai-studio-bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: 155497c

目标分支: main

已复核 155497c 合入最新 main 后的变更及相关调用链,未发现新问题;保留已有批准。

审查阶段进度范围与结果
常规审查 ✅ 已完成 11 个 PR 文件与已审查的 aea7dc5 完全一致,需求和讨论无新增约束;已确认新基线的启动清理、GDN 权重还原及 ClearML 绘图分支未改变审计契约。
深度审查 ✅ 已完成 复用原生成/传输/发布/消费调查,并核对新基线交互及相关 PR 的当前版本。本轮未运行本地测试;多节点 GPU/Ray/NCCL 和当前 head 的回归 CI 仍无验证证据。

没有未解决的审查问题。

改进建议(非阻塞)

相关 PR

💡 实现与合入建议

与 #549/#570 的生成来源、发布记录和消费审计存在重复链路;建议合入时协调一套协议。本建议不阻塞当前 PR。

https://github.com/redai-studio/Relax/pull/549 · 3ef063b5cf30eebd8e8439153c50a644e512a392 · 目标分支 main

https://github.com/redai-studio/Relax/pull/570 · 433cd17c29380749a80fdb0a7feab9ff9323dbf5 · 目标分支 main

https://github.com/redai-studio/Relax/pull/547 · f5f749ef2844d11c2488333f7713f9f784c093d1 · 目标分支 main

https://github.com/redai-studio/Relax/pull/516 · efa600a8935a83f4e445dac30f4ce9cca4c73af9 · 目标分支 main

实现取舍: 当前声明范围可优先采用 #629 较集中的标准转换器与现有日志/dump 接入;需要跨部署身份或独立完成快照时参考 #549,需要实际 loss callback 后的目标覆盖时适配 #570。#547/#516 的来源统计不能直接替代训练消费审计;没有足够证据认定某个实现全面胜出。

当前 PR 调整: 保留 #629 的提交片段、unknown/null、训练消费和 dummy 排除。与 #549/#570 集成时统一 token 坐标、策略/发布身份、完成时刻及传输字段,避免并行维护多套审计;#629 的 response 相对区间与 raw→ordinal 表不能直接拼接 #570 的绝对 token 坐标和 lineage 标签。当前无须因尚未合入的实现删除此链路。

合入顺序: 无硬性 PR 依赖。维护者可先落较聚焦的 #629,再让后续实现复用其来源与传输;也可先适配并验证较完整的实现,再将 #629 缩为尚未覆盖的接线。后者扩大首次集成的验证范围;两者尚未证明完全替代。#547 的普通 rollout 支持应单独保留。

依据与验证范围: 已重新核对四个相关 PR 的 live head/base、merge-base 和讨论,均未变化;#629 本次仅合入 main;11 个审计变更文件与已审查版本完全一致,已核对新增基线交互。来源与统计协议见 #629 policy_audit.py:https://github.com/redai-studio/Relax/blob/155497c223da5f3aa48e51aa1d8be449859ae2f2/relax/agentic/policy_audit.py、#549 weight_audit.py:https://github.com/redai-studio/Relax/blob/3ef063b5cf30eebd8e8439153c50a644e512a392/relax/agentic/weight_audit.py、#570 loss callback:https://github.com/redai-studio/Relax/blob/433cd17c29380749a80fdb0a7feab9ff9323dbf5/relax/backends/megatron/model.py#L1544。保留工具等待/恢复、缺失版本和成功发布回归;统一传输还需 TQ 往返及实际消费边界验证。本次对比只读,未运行测试,未验证组合实现。

提交范围 · 接收 11 · 建议移出 0 · 待确认 0

接收 11 个文件 · 建议移出 0 个文件 · 待确认 0 个文件。移出与待确认部分暂停深审,不代表审查通过。

文件结论仓库维护必要性依据替代去向或方案
relax/agentic/policy_audit.py
relax/agentic/session/service.py
relax/agentic/session/state.py
relax/backends/megatron/actor.py
relax/backends/megatron/data.py
relax/distributed/checkpoint_service/client/engine.py
relax/utils/data/stream_dataloader.py
relax/utils/utils.py
接收 生成片段、发布记录、传输和训练消费共同组成权重年龄审计链路。 PR #629 的 What/How 及 Task 15 的权重版本审计目标。 沿现有 Session、DCS 和 Megatron 数据路径接入,当前位置符合各模块职责。
tests/cpu/agentic/test_policy_audit.py
tests/cpu/distributed/ray/test_recovered_engine_registration.py
接收 覆盖已提交片段与成功权重发布的回归契约。 PR #629 的版本审计及失败同步不计入发布序号的行为。 持久回归放在对应 CPU 模块测试目录合适。
docs/zh/guide/agentic-rollout.md
接收 描述新增指标、适用边界和使用方法,属于现有 Agentic 用户指南。 PR #629 的用户可见审计指标。 当前用户指南位置合适;实验性验收数据可另放 PR 描述。
Powered by Nyanpasu with gpt-6.1-sol xhigh, please check the suggestions carefully.

@rai-studio-bot rai-studio-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查结论:通过

已完成 aea7dc5 的 11 个变更文件及生成、传输、发布和训练消费调用链审查,未发现可操作问题。本轮验证以源码和已有证据为主;未运行本地测试,多节点 GPU 路径及当前 head 的回归 CI 仍缺少验证证据。

审查看板 包含覆盖范围、验证限制和相关 PR 的非阻塞协调建议。

Powered by Nyanpasu with gpt-6.1-sol xhigh, please check the suggestions carefully.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants