[Feature] MultiCollector: track policy version per fresh continue command#3759
Merged
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/3759
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 4 New Failures, 1 Cancelled JobAs of commit 4479a5d with merge base 0a01ee8 ( NEW FAILURES - The following jobs have failed:
CANCELLED JOB - The following job was cancelled. Please retry:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced May 15, 2026
This was referenced May 15, 2026
vmoens
commented
May 15, 2026
Collaborator
Author
vmoens
left a comment
There was a problem hiding this comment.
Unmergeable, this goes against the idea of policy version tracking. Continue != update policy weight
This was referenced May 15, 2026
This was referenced May 17, 2026
This was referenced May 18, 2026
vmoens
added a commit
that referenced
this pull request
May 18, 2026
…mand When the parent calls ``update_policy_weights_()`` and immediately sends a ``continue`` to a worker, the resulting batch was getting tagged with the *pre-update* policy version: the worker's policy version is only bumped when ``increment_version()`` is called, and that previously only fired on direct user calls. Off-policy logging, staleness gating, and prioritized sampling that key on the version saw a 1-step lag. Pass ``track_policy_version=(self.policy_version_tracker is not None)`` to the worker, plumb a ``fresh_command`` flag through the recv loop so the worker knows whether ``msg`` was just received vs replayed from a timed-out iteration, and increment the version on each fresh ``continue`` / ``continue_random`` (only when not in ``run_free``, where the worker drives its own pacing). No new unit test: existing ``MultiCollector`` policy-version coverage in ``test/test_collectors.py`` continues to assert the per-batch version. End-to-end coverage comes through the example at the top of the stack. ghstack-source-id: d780a00 Pull-Request: #3759
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.
Stack from ghstack (oldest at bottom):
When the parent calls
update_policy_weights_()and immediatelysends a
continueto a worker, the resulting batch was gettingtagged with the pre-update policy version: the worker's policy
version is only bumped when
increment_version()is called, andthat previously only fired on direct user calls. Off-policy logging,
staleness gating, and prioritized sampling that key on the version
saw a 1-step lag.
Pass
track_policy_version=(self.policy_version_tracker is not None)to the worker, plumb a
fresh_commandflag through the recv loopso the worker knows whether
msgwas just received vs replayedfrom a timed-out iteration, and increment the version on each fresh
continue/continue_random(only when not inrun_free,where the worker drives its own pacing).
No new unit test: existing
MultiCollectorpolicy-version coveragein
test/test_collectors.pycontinues to assert the per-batchversion. End-to-end coverage comes through the example at the top of
the stack.