-
Notifications
You must be signed in to change notification settings - Fork 395
[Feat][1/N] support async_rl in replaybuffer #1337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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