Refactor unified trainer async flow and add precomputed-advantage + Tinker rollout fixes#401
Merged
Merged
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.
Summary
This PR streamlines the experimental trainer execution path, standardizes episode/task metadata handling, and adds support for workflows that provide pre-computed per-
token advantages. It also includes several Tinker integration fixes (rollout parsing, model length wiring, and resume behavior).
What Changed
Unified trainer lifecycle
fit()as sync entry point, now usingasyncio.run(...).fit_async) and moved workflow-pool initialization into async startup.use_precomputed_advantagethrough trainer setup.episode.task_id.self.config(full config object used by trainer).Agent / episode model cleanup
Step.from_model_output(...)to centralize Step construction.Step.prompt_idstyping to allow non-int prompt blocks used by some backends.Episode.task_idandEpisode.rollout_idx.Advantage collection behavior
algorithm.use_precomputed_advantage(defaultfalse) to config/dataclass.step.advantagelists directly.step.advantagein precomputed mode now raises an error.Transform / metadata consistency
episode.id.split(":")usage withepisode.task_id/episode.rollout_idx.Tinker backend and rollout fixes
training.max_lengthinto Tinker engine asmax_model_length.rollout_engine.renderer_nameconfig.eos_token_idwhen available.max_tokensprecedence and copy semantics).compute_logprobs(...)API to Tinker engine.training.resume_from_tinker_id(tinker://.../weights/<batch>).