Skip to content

[6/N] Opt-in partial final training step - #1937

Open
Zhichenzzz wants to merge 2 commits into
zhichen/vargbs-ffdfrom
zhichen/vargbs-partial-step
Open

[6/N] Opt-in partial final training step#1937
Zhichenzzz wants to merge 2 commits into
zhichen/vargbs-ffdfrom
zhichen/vargbs-partial-step

Conversation

@Zhichenzzz

@Zhichenzzz Zhichenzzz commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #1936. New opt-in flag --allow-partial-train-step: instead of dropping the trailing rollouts that don't fill a whole global_batch_size step, train them as one smaller final step. This is the endgame the series was built for — genuinely variable per-step global batch sizes.

  • Rollout-side schedule + dynamic batch size only (the static path can't satisfy its fixed-size mbs alignment on an arbitrary remainder); a partial step smaller than dp_size samples is skipped with a log line.
  • No other machinery changes: loss normalization and the LR scheduler increment already use the true per-step rollout count (from [1/N]), and the metric reduction is already count-weighted.
  • Saves up to global_batch_size - 1 rollouts per rollout batch under dynamic sampling / filtering — samples are the expensive part of RL.

Validation

  • CPU: 101 tests green, incl. partial-step opt-in coverage (uneven [2, 2, 1] schedule covering every sample) and the below-dp_size skip guard; default behavior unchanged when the flag is off.
  • GPU e2e (Qwen2.5-0.5B gsm8k, dp8, dynamic batch, mooncake, --ci-test, --global-batch-size 24 --disable-rollout-trim-samples):
Rollout-side DP schedule: num_samples=32, num_rollouts=32, global_batch_sizes=[24, 8], num_microbatches=[1, 1]

All 3 rollout batches trained with uneven [24, 8] steps — the first genuinely variable global batch size training in miles — job succeeded, CI logprob asserts pass, rewards healthy (0.47-0.59). Without the flag those 8 rollouts per batch (25%) would have been discarded.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Instead of dropping the trailing rollouts that don't fill a whole
global_batch_size step, train them as one smaller final step (rollout-side
schedule + dynamic batch size only; the static path can't satisfy its
fixed-size alignment on an arbitrary remainder). Loss normalization and the
LR scheduler already use the true per-step count ([1/N]), so no other
machinery changes. Saves up to global_batch_size - 1 rollouts per rollout
batch under dynamic sampling/filtering.
@Zhichenzzz
Zhichenzzz force-pushed the zhichen/vargbs-partial-step branch from 0744c0f to 0bc8a77 Compare July 29, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant