feat: unified resume system with checkpoints.jsonl state tracking - #172
Closed
Hecate0821 wants to merge 2 commits into
Closed
Hecate0821 wants to merge 2 commits into
Hecate0821 wants to merge 2 commits into
Conversation
Hecate0821
force-pushed
the
feat/dataloader-state-tracking
branch
9 times, most recently
from
March 6, 2026 01:59
ccb797a to
50dd3d7
Compare
PR #168 (FrozenLake example) incorrectly overwrote several shared utilities with older/incompatible versions during merge: - Restore TrainStepFns interface in train.py (reverts MinibatchTrainFns rewrite that broke rl_loop.py recipe) - Remove _install_tinker_future_retrieve_compat() from client.py (workaround no longer needed, fixed server-side) - Restore direct disable_speculative_decoding= in config.py (removes unnecessary inspect guard) - Remove grad_accum param and restore apply_shape() in infra.py - Update frozen_lake example to use TrainStepFns (1:1 loop) Made-with: Cursor
Hecate0821
force-pushed
the
feat/dataloader-state-tracking
branch
2 times, most recently
from
March 6, 2026 03:02
b1553ef to
1ec8904
Compare
4 tasks
Replace the dual-path resume logic (ResumeConfig + setup_resume regex parsing vs checkpoints.jsonl auto-resume) with a single source of truth: checkpoints.jsonl in a persistent log_path directory. - Add checkpoint_utils.py: ResumeState dataclass, resolve_resume(), load_dcp(), dataset fingerprint validation, training shape validation, checkpoint availability check, DCP load timing - Delete resume.py and ResumeConfig -- all resume flows through resolve_resume() which reads checkpoints.jsonl - Add rows_consumed tracking to run_rl_loop (RL) and examples_consumed tracking to sft_loop (SFT) for dataset position persistence - Add init_from_checkpoint config field for loading pretrained weights on a fresh dataset (writes initial checkpoints.jsonl entry) - Log perf/dcp_load_time to wandb on resume - Update all 4 recipe loops (rl, sft, dpo, orpo) to use the new system Made-with: Cursor
Hecate0821
force-pushed
the
feat/dataloader-state-tracking
branch
from
March 11, 2026 03:52
1ec8904 to
0763105
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fix/pr168-merge-issuesso the resume work sits on top of the shared RL utility fixes from PR feat: add FrozenLake multi-turn tool-call GRPO training example #168ref_logpfix by makingref_logprobsoptional throughout the RL pipeline sokl_beta=0works without a reference model, including thetraining/utils/rl/grpo.pyconflict resolution from the rebaseResumeConfig+setup_resumeregex parsing vscheckpoints.jsonlauto-resume) with a single source of truth:local_checkpoint_state.jsonlin a persistentlog_pathdirectorycheckpoint_utils.pywithResumeStatedataclass,resolve_resume(),load_dcp(), dataset fingerprint validation, training shape validation, checkpoint availability check, and DCP load timingdata_consumed) so resume skips already-trained datainit_from_dcpconfig field for loading pretrained DCP weights on a fresh datasetperf/dcp_load_timeto wandb on resumeDesign
flowchart TD A[Training starts] --> B{local_checkpoint_state.jsonl exists?} B -->|Yes| C[Read last entry] C --> D["Validate: shape, dataset fingerprint"] D --> E["Load DCP, skip data_consumed rows"] B -->|No| F{init_from_dcp set?} F -->|Yes| G["Write initial entry: step=0, data_consumed=0"] G --> H[Load DCP weights, start from row 0] F -->|No| I[Fresh start, no DCP]Changes
training/utils/checkpoint_utils.pytraining/utils/resume.pytraining/utils/config.pyResumeConfigdataclasstraining/utils/__init__.pyResumeConfig,setup_resumeexportstraining/utils/validation.pyresumeparameter fromvalidate_configtraining/utils/client.pylist_checkpoints()method toReconnectableClienttraining/utils/rl/train.pydata_consumedcounter torun_rl_looptraining/utils/rl/losses.pyPromptGroup.ref_logprobsnow optional (Nonewhen no ref model);combine_prompt_groupshandlesNonetraining/utils/rl/grpo.pyref_logprobs=Nonewith zeroresp_ref; preserved through the PR #168 rebase conflict resolutiontraining/utils/rl/dapo.pytraining/utils/rl/gspo.pytraining/utils/rl/cispo.pytraining/recipes/rl_loop.pylog_path+init_from_dcp. Resume viaresolve_resume()+load_dcp().ref_forwardonly called whenuse_reference=True. Save loop state alongside DCPtraining/recipes/sft_loop.pydata_consumedand epoch/batch offsettraining/recipes/dpo_loop.pytraining/recipes/orpo_loop.pytraining/tests/e2e/conftest.pye2e_training_shapefixturetraining/tests/e2e/test_grpo_resume_e2e.pytraining/tests/e2e/test_sft_resume_e2e.pytraining/tests/e2e/test_dpo_resume_e2e.pyTest plan
init_from_dcp-- verify DCP loads, training starts from row 0perf/dcp_load_timeandperf/dcp_save_timeappear in wandbkl_beta=0(no reference model) -- verify no IndexError, KL penalty is zerots-qwen3-30b-a3b-instruct-64k-rft-dev-cp8ep8-v1in AP_TOKYO_2