Skip to content

Reconcile training resume and reject incomplete RNG state - #7

Merged
ZhiningLiu1998 merged 2 commits into
SimpleJev:mainfrom
YennNing:feat/train-resume
Oct 15, 2026
Merged

ZhiningLiu1998 merged 2 commits into
SimpleJev:mainfrom
YennNing:feat/train-resume

Conversation

@YennNing

@YennNing YennNing commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Reconcile the original resume contribution with the implementation now on main, retaining --resume and --checkpoint-every-steps, checkpoint fingerprints, schedule validation, and prior-best/early-stop state. The original commits remain in this branch's history.

Port the contributor's SFT/RLCR checks for checkpoint cadence and recovery from every unfinished optimizer-step boundary. Incomplete per-rank RNG state now raises an actionable error before an output directory is created, rather than failing later with a missing-key, index, or attribute error.

Validation: 51 focused training/resume checks passed; 2 tests requiring an external trained checkpoint were skipped. Both SFT and RLCR match continuous-training tensors and counters after resuming from steps 1 through 5, and finished schedules are rejected.

--save_state_every_steps N writes checkpoints/step-* every N optimizer
steps: the usual servable checkpoint plus trainer_state.pt (optimizer,
scheduler, epoch and micro-batch position, counters, early-stopping state)
and per-rank torch/CUDA RNG. --resume_from continues from one of them into a
new --out. The data order is replayed from the seed and augmentation is
already seeded per record, so a resumed run reproduces the uninterrupted
weights bit for bit (tested for SFT and RLCR from every intermediate step,
including epoch boundaries). Trajectory-changing settings and the process
count must match; mismatches are rejected before training.

Both flags default to off, leaving existing runs and outputs unchanged.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Human Review

  • API request failed (HTTP 404)

Human Review: see the findings and review evidence.

AI semantic review has not completed.

  • CI ci.yml: passed (run) — All expected jobs passed
  • CI pages.yml: passed (run) — All expected jobs passed

Reviewed head d1c9f225271e61c2284836f9849137aab8820805; base fe9e087e7ff91e6f6a5a80e8a9eb4a6b781b8aa1.
CPU CI does not verify production-model quality, CUDA or multi-GPU performance.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@ZhiningLiu1998

Copy link
Copy Markdown
Collaborator

This conflicts with current main in jevany/train.py and docs/TRAINING.md, which already include a resume implementation. Please reconcile the two paths without losing checkpoint validation, then rerun uninterrupted-versus-resumed SFT/RLCR parity and incompatible/incomplete-state rejection tests.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

Keep the current resume interface and checkpoint validation. Adapt the
original contribution's cadence and per-step SFT/RLCR parity coverage,
and reject incomplete per-rank RNG state before creating the output.

Co-authored-by: Xuying Ning <xuying@meta.com>
@ZhiningLiu1998 ZhiningLiu1998 changed the title Resume interrupted training runs exactly Reconcile training resume and reject incomplete RNG state Oct 15, 2026

@github-actions github-actions Bot 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.

Human-Review. See the maintained PR review summary for evidence.

@ZhiningLiu1998 ZhiningLiu1998 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reconciled the duplicate resume implementation with current main and preserved the original per-step parity coverage. All 51 focused checks pass, including SFT/RLCR recovery and early rejection of incomplete RNG state; both full CPU CI jobs and site checks pass.

@ZhiningLiu1998
ZhiningLiu1998 merged commit fc9e141 into SimpleJev:main Oct 15, 2026
7 checks passed
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.

2 participants