Repository navigation
fix(args): warn when multi-step training compounds async staleness - #2524
Draft
SriRangaTarun wants to merge 7 commits into
Draft
SriRangaTarun wants to merge 7 commits into
SriRangaTarun wants to merge 7 commits into
Conversation
SriRangaTarun
marked this pull request as draft
August 13, 2026 21:06
SriRangaTarun
marked this pull request as ready for review
August 20, 2026 21:00
SriRangaTarun
requested review from
Shi-Dong,
Zhichenzzz,
fzyzcjy,
guapisolo,
maocheng23,
yueming-yuan and
yushengsu-thu
as code owners
August 20, 2026 21:00
SriRangaTarun
marked this pull request as draft
August 20, 2026 21:57
This branch has not been deployed
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.
Motivation
Closes #1697.
--max-weight-stalenessbounds how far behind a drained batch's generating policy may be,but it says nothing about what happens within the batch. The drained batch flows through the
normal consume path and is split into
rollout_batch_size * n_samples_per_prompt // global_batch_sizeoptimizer steps(
miles/backends/training_utils/data.py). With more than one step, steps 2..N update weightsthat have already moved away from the policy that generated the data — per-batch off-policyness
stacked on top of the inter-batch gap the staleness filter deliberately allows.
The two knobs are configured independently and nothing connects them, so the compounding is
silent. Fully async assumes one optimizer step per drain; that invariant currently lives only in
a docstring in
miles/ray/rollout.py.Changes
Warn at validation time (
miles/utils/arguments.py) when--max-weight-stalenessis setand the effective steps-per-rollout is > 1. Warning, not assertion: multi-step is valid for
overlapped-async recipes that account for the compounding themselves, and erroring would break
working runs. The step count is derived from
--num-steps-per-rolloutwhen given, otherwiseinferred from
--global-batch-size, so a user who never touches the former still gets thewarning.
--use-dynamic-global-batch-sizeis exempt — it resizes the global batch to thedrained batch and therefore always yields exactly one step.
Rewrite the
--use-dynamic-global-batch-sizehelp text. It described the mechanism("disable trim samples in rollout buffer") rather than the purpose, which is avoiding
sample-trim waste when the collected count is variable — and, in fully async, pinning the
drain to one step.
Document the invariant in
docs/user-guide/fully-async.md, in a new "Steps per rollout"subsection under the buffer/staleness arguments, which previously covered off-policyness only
via
--max-weight-staleness.Tests
TestMultiStepStalenessWarningintests/fast/utils/test_arguments.pycovers the four-way matrix(staleness × multi-step, via explicit
--num-steps-per-rolloutand via implied--global-batch-size) plus the--use-dynamic-global-batch-sizeexemption.No behavioural change to training: this only adds a log line and edits help text and docs.