feat: track policy versions in fully async rollout - #2279
Open
0z5a wants to merge 1 commit into
Open
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 is the first, dependency-free slice of #1800. It establishes policy-version lifecycle semantics for fully async rollout without adding staleness control, eviction, or partial-resume policy yet.
before_weight_update/after_weight_updatehooksRolloutManagerforward lifecycle hooks to the configured rollout module while preserving compatibility with rollout functions that do not define themCompletedSampleRecordeven if completions arrive out of orderSample.policy_versionSemantics
policy_versionstarts at zero inRolloutManager. A successful initial or periodic weight update increments it once. The async worker captures that published value at admission, so a weight update completing while generation is in flight cannot relabel an older trajectory. The existing behavior of recycling aborted groups remains unchanged.Validation
python -m pytest tests/test_fully_async_rollout.py tests/test_sample.py tests/test_train_async_policy_version.py— 21 passedpre-commit run --from-ref 41014d1f29e201137fdffce737bb8bac65bc5219 --to-ref HEAD— all hooks passedThe tests cover successful and failed weight updates, monotonic version publication, out-of-order completion across an update boundary, immutable completion records, queue backpressure, and
Sampleserialization.Follow-ups
To keep review scope small, configurable staleness/requeue policy, partial rollout resume, and fixed-cardinality observability metrics will be submitted as follow-up PRs after this lifecycle foundation is reviewed.
Part of #1800.