fix: don't overwrite an explicitly set --start-rollout-id - #2236
Open
keepkeen wants to merge 2 commits into
Open
fix: don't overwrite an explicitly set --start-rollout-id#2236keepkeen wants to merge 2 commits into
keepkeen wants to merge 2 commits into
Conversation
`--start-rollout-id` documents itself as a fallback:
if not set, will try to load the step from --load when doing continue
training, otherwise will be set to 0, meaning training from start.
But both branches of `slime_validate_args` assign `args.start_rollout_id = 0`
unconditionally whenever there is no resumable Megatron checkpoint — which is
exactly the situation an explicit value is for. `create_actor_model` then sees a
non-None value and keeps the 0, so `--start-rollout-id 100 --num-rollout 200`
silently replays from rollout 0.
Guard both assignments so they only fill in the default.
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
--start-rollout-idis silently discarded whenever the run does not resume from a Megatron checkpoint.Root cause
The flag documents itself as a fallback:
But
slime_validate_argsassigns it unconditionally in both branches:That branch is taken exactly when there is no resumable Megatron checkpoint — i.e. the situation where an explicit
--start-rollout-idis the only way to say where to start.create_actor_modelafterwards only fills in the value when it isNone:so the 0 survives, and
train.pyrunsrange(0, num_rollout).Reproduction
Driving the real
slime_validate_argsthrough the harness intests/test_megatron_argument_validation.py:So
--ref-load /ckpt/base --start-rollout-id 100 --num-rollout 200silently retrains rollouts 0-199 instead of 100-199.Fix
Guard both assignments with
if args.start_rollout_id is None:, so they only supply the documented default.No new failure mode downstream:
RolloutDataSource.loadalready returns quietly whenrollout/global_dataset_state_dict_{id}.ptis absent, so starting at an id with no saved dataset state just begins from a fresh dataset.Test
Four cases added to the existing (CI-wired)
tests/test_megatron_argument_validation.py, parametrized overraw/bridge: an explicitstart_rollout_id=100survives validation, andNonestill becomes0. The two "preserve" cases fail onmainwithassert 0 == 100.