Repository navigation
feat(grpo): checkpoint async replay buffer - #2632
Closed
macandro96 wants to merge 3 commits into
Closed
macandro96 wants to merge 3 commits into
macandro96 wants to merge 3 commits into
Conversation
Signed-off-by: Anish Mahishi <[email protected]>
Contributor
Author
|
Notes for reviewers A few adjacent issues are not handled here and may be better as follow-ups:
|
Signed-off-by: Anish Mahishi <[email protected]>
Contributor
Author
|
/ok to test 87cfe62 |
4 tasks done
Signed-off-by: Anish Mahishi <[email protected]>
Contributor
Author
|
/ok to test 251ebbd |
Contributor
Author
|
This PR will be folded and will be merged as part of #2651 |
This branch was previously deployed
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.
What does this PR do ?
Adds replay-buffer checkpointing via state_dict()/load_state_dict(), saved as replay_buffer.pt alongside the dataloader state and restored on resume.
Issues
Closes
Allow replay buffer checkpointing and reloading capabilitypart of #1906Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information
Restore Behavior
On restore, the replay buffer is prepared for the current training step:
last_target_weight_already_generatedtocurrent_step - 1so the collector re-checks current/future targets by countmax_age_stepsis providedmax_sizeis smaller than the checkpointed bufferBehavioral Differences From Upstream Commit
Empty replay-buffer restore resets
last_target_weight_already_generatedtocurrent_step - 1.Restore truncation happens after resume cleanup, not before.
max_sizeshrank, this could keep past-step trajectories and discard current/future ones needed for resume.When
current_training_stepis known, max-size truncation prioritizes the nearest current/future target steps.Restore can remove trajectories that are already stale for their target step via
max_age_steps.sample()evicts them later. Cleaning them during restore makes the restored state match what training can actually consume.GRPO passes
max_trajectory_age_stepsinto replay-buffer restore.