refactor: share training batch production#3027
Draft
tim0120 wants to merge 1 commit into
Draft
Conversation
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
Extracts the trainer-bound batch lifecycle behind a source-independent interface:
TrainingBatchSourceprepares examples and handles source-specific post-send work.TrainingBatchProduceris the single loop that publishesTrainingBatch, advances the trainer-aligned step, and notifies the source.This is a stacked architectural draft on #2954 for examining whether this is the right invariant boundary.
Why
#2954's
DatasetBatchProducerstill owned its own send/step loop, making it structurally close to a renamed static orchestrator. The first interface shared by rollout training and static SFT is the prepared trainer batch, not environments, dataset rows, or rollouts.This change shares the lifecycle at that boundary while leaving source-specific behavior on the appropriate side:
Orchestrator.DatasetBatchSource.No config, transport, trainer, normalization, or checkpoint format changes are intended.
Validation
git diff --checkpassed.No README changes or new test files.