Repository navigation
fix(train): preflight checkpoint publication on every rank - #6089
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
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. Review the Copilot code review billing settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
njzjz-bot
left a comment
There was a problem hiding this comment.
Agent: dot
Reviewed exact head 04f93d9d8710d5e9517b7bebcc806db071d8d0ca against 4f78c2d0de347e4a40920c105a04a0506118f7af, including all eight changed files, the shared trainer loop, and the superseded #6061 review history. I found no additional actionable regression in this bounded review.
The replacement addresses the earlier preflight/serialization ordering concern structurally: even a rank without a local guard update joins the flag agreement before diagnostics; selected top-K state remains provisional until preflight succeeds and is then present during serialization. PT regular/final/zero-step publication converges on one helper, and ordinary DDP nonchief ranks now join PT-expt preflight before returning without writing. Each regular live-plus-EMA boundary checks once. Not-due, unselected, and save_best=False validation paths do not consume the accumulated guard. Reset on inspection, including rejection, is retained behavior, not a new success-only reset contract.
Independent verification: 25 exact-source host-control scenarios passed with blocking two-thread collective doubles (5 guard, 12 validator, 8 regular live-plus-EMA save cases), plus trainer wiring/participation checks and syntax inspection. These check control flow and top-K reload bookkeeping; they are not native Torch serialization, real Gloo/ZeRO, FSDP, GPU, or full-training execution. The added two-process test source does exercise real trainer writers, rank-1-only historical failure, and finite controls, but its hosted execution remains pending while current-head jobs are queued. Author-reported local test totals are separate evidence.
No general I/O rollback/recovery requirement is being reintroduced into this deliberately narrower replacement. This is a scoped review record, not full distributed-runtime qualification.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6089 +/- ##
==========================================
- Coverage 78.08% 77.84% -0.24%
==========================================
Files 1171 1171
Lines 141657 141655 -2
Branches 5072 5078 +6
==========================================
- Hits 110615 110278 -337
- Misses 29102 29439 +337
+ Partials 1940 1938 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Agent: dot Qualification follow-up to review 5574354987, at unchanged head Python shard 6 reports all 23 cases in The CUDA workflow is aggregate green but both actual CUDA test jobs were skipped. This does not establish FSDP or GPU execution. No source re-review is being repeated. |
wanghan-iapcm
left a comment
There was a problem hiding this comment.
LGTM. Agreeing on the non-finite flag across ranks before any checkpoint write, and proposing the validation top-K update without side effects until the save is confirmed, closes the unguarded save paths.
njzjz-bot
left a comment
There was a problem hiding this comment.
Agent: dot
Incremental review only: 04f93d9 → 91364f6. No additional actionable issue found in this one-file test cleanup change; the earlier checkpoint review is not being repeated.
The temporary-directory cleanup is registered first, so unittest's LIFO cleanups close all seven trainer/probe creation sites before removing the LMDB files. Registration immediately after construction also covers failures in get_batch/run/assertions, and directory cleanup now runs after a failed setUp. All training assertions remain intact. I checked Trainer._close_data_systems and the LMDB adapter/iterator/reader close paths: they release the prefetch pipeline before the reader, with idempotent iterator/reader closure, so cleanup after trainer.run's own closure is safe. Removing ignore_errors makes a remaining resource leak visible instead of concealing it.
Verification: exact-source syntax inspection and three stdlib cleanup-order/error-path scenarios passed; these are not real LMDB/Torch training execution. Current-head CI has successful Python shards plus others still running, with CUDA Python skipped; no GPU or full-suite pass is claimed. Review-only: no code, branches, auto-merge, or merge changed.
Summary
Fixes #5816. Supersedes #6061 with a fresh implementation on current master.
The optimizer-step path and gradient-clipping algorithm are unchanged. Existing serialization/reconciliation I/O-error behavior is retained; this fix does not introduce a general checkpoint rollback or file-recovery protocol.
Validation
git diff --check: passed.04f93d9: all 12 Test Python shards passed. Shard 6 ran all 23 cases intest_checkpoint_guard.pysuccessfully, including the two-process Gloo/DDP/ZeRO-1 regression; none of those 23 cases were skipped. CodeQL, pre-commit, and documentation checks also passed.Summary by CodeRabbit