Skip to content

fix(fastsac): 修正首次训练初始化与吞吐量状态显示 - #137

Merged
wlgys8 merged 1 commit into
mainfrom
fix/136-fastsac-startup-status
Oct 19, 2026
Merged

wlgys8 merged 1 commit into
mainfrom
fix/136-fastsac-startup-status

Conversation

@wlgys8

@wlgys8 wlgys8 commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

摘要

Closes #136

本 PR 只修复启动就绪判断和 console 状态表达,不修改 learner 训练/数据搬运调度。

  • 启动面板等待所有 learner 实际完成首批更新后再切入训练面板;等待期间显示 initializing first update…。
  • 首次更新完成立即发送状态,不等待完整日志间隔;使用本次运行的 training_started 状态,避免把 resume 的历史 update counter 当作本次初始化已完成。
  • 有统计窗口但没有新增步数时报告零吞吐量;没有速率测量且不在 replay warmup 时显示 measuring…,不再误显示 warming up。
  • 无训练更新的短运行仍可正常退出。

范围

首次 lazy compilation / CUDA Graph 初始化仍然可能耗时。本改动把首批初始化保留在启动阶段明确展示,不消除实际编译或 ring 等待。

根据 review,撤回初版中的 chunk 间 drain、staging stream 同步和相关调度测试。这些 learner 流水线改动需要独立正确性和性能验证,不属于本次状态修复范围。更新预算、strict UTD、ring 消费和 CUDA stream 同步保持原实现。

回归覆盖

  • plain / Rich console 区分 replay warmup、尚无速率测量和零吞吐量。
  • async 面板等待首轮更新、无更新短运行正常结束、采样停顿报告零吞吐量。

验证

  • Console 测试:python -m pytest motrix_rl/tests/test_console.py -q,25 passed。
  • Pre-commit 和范围缩小后的验证结果见评论。
  • FastSAC pytest 因当前 Torch 无法导入(ImportError: libcudnn.so.9)在收集阶段失败,未执行测试;未安装或修改依赖。
  • 真实 GPU / CUDA Graph 启动验收尚未完成。

@wlgys8 wlgys8 changed the title fix(fastsac): 修正启动状态并缓解 strict UTD 采样反压 fix(fastsac): 修正首次训练初始化与吞吐量状态显示 Oct 18, 2026
@wlgys8
wlgys8 force-pushed the fix/136-fastsac-startup-status branch from cc0bdd9 to 10c20a8 Compare October 18, 2026 17:23
@wlgys8
wlgys8 requested a balanced review from Copilot October 18, 2026 17:40

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.

🔵 Needs a closer look

The changes alter concurrency-sensitive startup gating in the multi-process async FastSAC trainer, and the PR notes the FastSAC test suite could not be executed and real GPU/CUDA-Graph startup behavior was not verified.

No open issues 🎉

What changed in this PR

This PR addresses issue #136, where the FastSAC async trainer prematurely switched from the startup panel to the training panel before learners finished their first (potentially lazily-compiled) update, and where sampling stalls were misrendered as warming up. The fix is scoped strictly to startup-readiness gating and console status wording; it deliberately does not touch learner training/data-movement scheduling.

Changes:

  • Added a per-run training_started flag to learner panel payloads (published immediately on the first completed update, not after a full log interval), and gate the training-panel handoff on all learners reporting it — with a short-run escape so runs that end during replay warmup still shut down cleanly.
  • Reworked the panel rate window so a non-empty time span with zero step progress reports a measured 0 env-steps/s instead of None, and disambiguated the None rate as warming up (replay warmup) vs measuring… (no span yet).
  • Added regression tests for console throughput wording and for async-panel first-update waiting, zero-throughput-after-stall, and no-update short runs.
File Description
motrix_rl/​src/​motrix_rl/​console.py Renders warming up vs measuring… based on the warming flag at all three None-rate sites; comment reworded.
motrix_rl_builtin/​src/​motrix_rl_builtin/​fastsac/​async_impl/​worker.py Emits training_started in payloads and publishes the first-update payload immediately.
motrix_rl_builtin/​src/​motrix_rl_builtin/​fastsac/​async_impl/​train.py Gates panel handoff on all learners' first updates, adds a dead-learner break, and reports measured-zero throughput.
motrix_rl/​tests/​test_console.py Parametrized test covering missing-measurement vs replay-warmup vs zero-throughput wording.
motrix_rl_builtin/​tests/​test_fastsac_live_metrics.py Adds updates/training_started to the scripted learner and three async-panel regression tests.

Review effort: Balanced

@wlgys8
wlgys8 merged commit f408e35 into main Oct 19, 2026
13 checks passed
@wlgys8
wlgys8 deleted the fix/136-fastsac-startup-status branch October 19, 2026 02:56
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.

[FastSAC] 启动后首次训练阻塞采样,吞吐量下降并误显示 warming up

2 participants