Skip to content

【No.13 12/N】refactor(args): read checkpoint interval args directly - #810

Merged
SigureMo merged 3 commits into
redai-studio:mainfrom
HpIahtcthocw:refactor/args-checkpoint-intervals
Nov 27, 2026
Merged

SigureMo merged 3 commits into
redai-studio:mainfrom
HpIahtcthocw:refactor/args-checkpoint-intervals

Conversation

@HpIahtcthocw

@HpIahtcthocw HpIahtcthocw commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

本 PR 将 Relax 中以下 5 个 checkpoint/保存相关参数从 getattr(args, ..., default) 改为直接读取 args.x。

参数名 参数定义来源 参数定义 标准 argparse 下是否可以安全替换
save_interval Relax 注册,默认值 --save-interval,int 或 "epoch",默认 None 可以
rotate_ckpt Relax parser --rotate-ckpt,store_true,默认 False 可以
async_save Relax parser --async-save,store_true,默认 False 可以
save_lora_only Relax parser --save-lora-only,store_true,默认 False 可以
save_debug_rollout_data Relax parser --save-debug-rollout-data,str,默认 None 可以

通过 Relax 解析器初始化的参数已有这些字段,直接读取会保留默认值和显式配置。绕过解析器的测试需提供所读字段。

@rai-studio-bot

rai-studio-bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for contributing to Relax, @HpIahtcthocw! 感谢你为 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 / 状态
审批人数 ✅ 1/1 · 至少 1 位有仓库 write 或更高权限的人 Approve · 已审批:SigureMo
团队审批(relax-block-reviewers) ✅ 1/1 · 已审批:SigureMo
CI ✅ 已通过

@rai-studio-bot

rai-studio-bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: 5e3d16d

目标分支: main

两项既有审查意见均已解决。此前失败的 55 个 CPU 用例全部通过,复核未发现新增问题。

审查阶段进度范围与结果
常规审查 ✅ 已完成 复核了五处测试参数修改和 PR 描述。生产代码与上次审查一致,CPU 行为断言保留。
深度审查 ✅ 已完成 已复核参数来源、PR 描述与五处测试参数修改。REF007、PR001 和 TST002 均无新增发现。

审查发现

待处理
编号 严重性 问题状态规则来源
暂无待处理的记录。
已解决或已取代
编号 严重性 问题状态规则来源
F1 High severity 同步更新绕过解析器的既有测试参数 ✅ 已解决 No.13 参数默认值集中管理与兼容逻辑规范化
F2 Low severity [experimental · PR001] 说明参数读取等价的前提 ✅ 已解决 —
Powered by Nyanpasu with gpt-6.2-sol high, 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.

需要修改

已审查 c021bd21 的 9 个变更文件。请让现有 CPU 回归测试在新参数契约下继续执行原有断言。

查看审查看板

  • Low severity P3 · [experimental · PR001] 说明参数读取等价的前提

    非行级:问题在 PR 描述末句。建议改为「通过 Relax 解析器初始化的参数已有这些字段,直接读取会保留默认值和显式配置。绕过解析器的测试需提供所读字段。」解析入口

Powered by Nyanpasu with gpt-6.2-sol high, please check the suggestions carefully.

Comment thread relax/utils/arguments.py

def validate_save_lora_only_args(args) -> None:
if not getattr(args, "save_lora_only", False):
if not args.save_lora_only:

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.

High severity P1 · 同步更新绕过解析器的既有测试参数

CPU CI 第 1 次运行在本 PR 的合并提交 a798be5c 上报告 55 个失败。现有 PPO、SFT、RLOO 和 OPD 测试直接将手工构造的参数传给 relax_validate_args,缺少 save_lora_only 时会在这里抛出 AttributeError。同一轮迁移也漏了 SFT 周期测试的 rotate_ckpt,以及 Agentic 和 replay 转存测试的 save_debug_rollout_data。这些用例在执行原有断言前就退出了。

请补齐这些测试的参数构造,保留直接读取和原有行为断言,再确认 CPU CI 通过。失败日志 · No.13 验收要求

Powered by Nyanpasu with gpt-6.2-sol high, please check the suggestions carefully.

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.

已确认 5e3d16d 补齐了参数校验、SFT 保存周期及 rollout/replay 测试缺少的三个字段,原有断言均保留。该版本的 CPU 测试已通过。CPU CI

Powered by Nyanpasu with gpt-6.2-sol high, 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.

审查通过

确认 5e3d16d 补齐了测试参数,并在 PR 描述中说明了参数读取等价的前提。CPU CI 中此前失败的 55 个用例均已通过。

审查看板 · CPU CI

Powered by Nyanpasu with gpt-6.2-sol high, please check the suggestions carefully.

@SigureMo

Copy link
Copy Markdown
Member

PR 比较多,可以敏捷按照这种方式多提几个,避免下周日合不完

@SigureMo
SigureMo merged commit 6b21258 into redai-studio:main Nov 27, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants