[Feat][1/N] support async_rl in replaybuffer#1337
Closed
YanhuiDua wants to merge 2 commits intoInternLM:mainfrom
Closed
[Feat][1/N] support async_rl in replaybuffer#1337YanhuiDua wants to merge 2 commits intoInternLM:mainfrom
YanhuiDua wants to merge 2 commits intoInternLM:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces asynchronous RL support to the replay buffer system, enabling partial rollouts and version-based sample management for more efficient training data generation. This is the first part of a multi-part feature implementation.
Key changes:
- Refactored replay buffer storage to support versioned samples with bucketed tracking of completed, aborted, and expired states
- Renamed
SamplertoDatasetSamplerand separated dataset sampling logic from replay buffer sampling - Added async-related configuration parameters including
partial_rollout,tail_batch_candidate_steps, andstaleness_threshold
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.
| File | Description |
|---|---|
| xtuner/v1/ray/dataflow/replay_buffer.py | Major refactoring: added version tracking to ReplayMeta, introduced bucketed storage for different sample states, renamed and split Sampler class, updated storage management methods |
| xtuner/v1/ray/dataflow/flow.py | Added async-related config parameters, updated DataFlow initialization to pass async configs to replay buffer, renamed _reset_internal_states to _prepare with prerun state fetching |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2191802 to
87c9c14
Compare
87c9c14 to
2f6fc68
Compare
2f6fc68 to
4c6d2fc
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.
This PR introduces asynchronous RL support to the replay buffer system, enabling partial rollouts and version-based sample management for more efficient training data generation. This is the first part of a multi-part feature implementation.
Key changes:
staleness_threshold: The maximum allowed threshold of stale (expired) samples in a training batch. Must be between 0.0 and 1.0.enable_partial_rollout: Whether to enable partial rollout for asynchronous data generation.tail_batch_candidate_steps: Number of rollout steps after which a sample becomes a candidate for the tail batch. Set to 0 to disable. 0 means no tail batch.tail_batch_trigger_size: Number of candidate samples needed in the queue to trigger a tail batch operation. It will be set to global_batch_size when not provided by userRefactored replay buffer storage to support versioned samples with bucketed tracking of completed, aborted, and expired states
Renamed Sampler to DatasetSampler and separated dataset sampling logic from replay buffer sampling