-
Notifications
You must be signed in to change notification settings - Fork 371
fix(orchestrator): hold batch ship on the trainer's published version #3050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+86
−15
Merged
Changes from 32 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
36d7d43
fix(orchestrator): enforce target lag strictly at ship time
mikasenghaas d97d1cf
remove staleness metrics from ship path
mikasenghaas 1ab3826
feat(orchestrator): step-based staleness with demand-driven dispatch
mikasenghaas 3e167d7
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas fa0aed0
review pass: bool dispatch contract, oversampling-aware demand, inlin…
mikasenghaas 278d0dd
require max_off_policy_steps >= 1 at the field
mikasenghaas 58c8392
fix CI regressions: partial-group dispatch deadlock + serialized weig…
mikasenghaas 7508ec6
raise multi-run integration timeout to 600s
mikasenghaas ffecd2a
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas 1242261
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas a7aa4d3
retract stale-dropped rollouts from the payload-size estimate
mikasenghaas c31b84c
upload integration run logs as artifacts on failure
mikasenghaas d1fcbef
keep CI test outputs for the failure-artifact upload
mikasenghaas bc022da
dispatch lookahead: cover TARGET_LAG extra batches when freshness allows
mikasenghaas 78b9915
raise reverse_text mismatch-KL budget to 0.02
mikasenghaas 19f28e7
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas 269e106
raise alphabet_sort and multi-run integration budgets
mikasenghaas b3a8048
raise multi-run inner milestone waits to 600s
mikasenghaas a0c857f
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas 81e0e6e
count group-scored partial arrivals as batch coverage
mikasenghaas a4dc7f5
guard token-export STABLE markers against deleted run dirs
mikasenghaas 7e4400f
recalibrate multi-run early-step reward floor for strict pacing
mikasenghaas 67ec049
raise rl_sft integration budget to 900s
mikasenghaas 9897ad7
lower multi-run final reward floor to 0.6
mikasenghaas f9c2db4
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas 0143423
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas 420e97c
bound dispatch freshness at DISPATCH_LAG instead of the drop cap
mikasenghaas 330d934
ci: retrigger GPU tests
mikasenghaas fd5e0dc
Merge remote-tracking branch 'origin/main' into fix/strict-target-lag
mikasenghaas a752e27
tolerate trainer tail-flush when deleting run dirs in multi-run test
mikasenghaas 2cb062d
restore NIXL ModelExpress handshake signals in the version hooks
mikasenghaas 5edfcbf
reduce to the minimal ship-hold fix + staleness docs
mikasenghaas c504f1d
fold staleness spec into docs/training.md
mikasenghaas cd40dd9
drop the docs section for now, trim the hold comment
mikasenghaas f4963b4
never delete the test output dir; clean at run start instead
mikasenghaas e467d6b
stamp true consumption staleness on shipped rollouts
mikasenghaas daf5c8c
use the deletion-retry helper for alpha's run dir too
mikasenghaas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Submodule research-environments
updated
14 files
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,10 +9,11 @@ | |
| "training", | ||
| "inference", | ||
| "scaling", | ||
| "staleness", | ||
| "algorithms", | ||
| "advanced", | ||
| "development" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Staleness and pacing | ||
|
|
||
| How the async RL pipeline bounds off-policy staleness, when dispatch starts and | ||
| stops, and why shutdown is race-free. Two counters govern everything: | ||
|
|
||
| - `N` — the batch the orchestrator is collecting (`progress.step`, 1-indexed). | ||
| - `v` — the trainer's policy version (0-indexed). `v` advances when the trainer | ||
| *publishes* a version; inference applies it immediately and pauses generation | ||
| during the update, so published and applied versions are indistinguishable to | ||
| every consumer. | ||
|
|
||
| A rollout is stamped with the version it was generated from (`v_gen`). If it is | ||
| consumed in batch `N`, it trains `lag = (N-1) - v_gen` versions behind — batch | ||
| `N` produces `v{N}` from `v{N-1}`, so `lag = 0` is fully on-policy. | ||
|
|
||
| ## The three rules | ||
|
|
||
| Each rule bounds `N - v` (or a rollout's `lag`) at one lifecycle point. They are | ||
| independent: each one prevents a failure mode the others cannot. | ||
|
|
||
| | Rule | Bound | Enforced at | Failure mode it prevents | | ||
| |---|---|---|---| | ||
| | **START** | dispatch pauses while `(N-1) - v > TARGET_LAG` | dispatch gate | generating data that is born stale | | ||
| | **ADVANCE** | batch `N` ships only once `v ≥ N-1-TARGET_LAG` | ship hold | the batch counter outrunning the trainer | | ||
| | **DIE** | rollouts that straddle more than `max_off_policy_steps` weight updates in flight are cancelled | weight-update hook | long-running stragglers aging without bound | | ||
|
|
||
| With `TARGET_LAG = 1`, START and ADVANCE together keep consumption lag at ≤ 2 | ||
| in steady state (≤ 3 with batch-boundary spill); DIE only fires on rollouts | ||
| whose own duration spans many trainer steps (agentic long tails). | ||
|
|
||
| ## The two worlds | ||
|
|
||
| Which rule binds depends on the ratio of trainer step time `T` to per-batch | ||
| generation time `G`. The rules never change — only which one saturates: | ||
|
|
||
| **World 1 — generation-bound (`T < G`, the trainer waits).** `v` catches up | ||
| after every ship, so `(N-1) - v ≤ 1` always: START and ADVANCE never bind and | ||
| DIE stays quiet. The pipeline is paced by generation; the trainer idles between | ||
| batches. All staleness rules are inert insurance. | ||
|
|
||
| **World 2 — trainer-bound (`T > G`, inference races).** Batches fill faster | ||
| than versions arrive. ADVANCE binds every step (the ship hold paces `N` to | ||
| `v`); START closes dispatch between version publishes (inference alternates | ||
| generate/idle, idle fraction `1 - G/T`). Without ADVANCE this world is where | ||
| the orchestrator finishes all its batches from buffered rollouts, exits, and | ||
| strands the trainer (see below). | ||
|
|
||
| The crossover is smooth: the same predicates are evaluated everywhere, and no | ||
| configuration switch distinguishes the worlds. | ||
|
|
||
| ## Shutdown correctness | ||
|
|
||
| For in-memory weight transports (NCCL, NIXL) the trainer *blocks* inside each | ||
| broadcast until the orchestrator's weight watcher completes the matching apply. | ||
| Two guarantees make teardown race-free: | ||
|
|
||
| 1. **ADVANCE is the liveness guarantee.** The orchestrator cannot exit before | ||
| shipping its final batch `M`, which requires `v ≥ M-2` — and `v{M-2}` is | ||
| exactly the last version whose broadcast needs a live watcher (the trainer | ||
| skips the final `TARGET_LAG + 1` in-memory broadcasts because their receiver | ||
| is torn down; this is also why the hold never waits for an unpublishable | ||
| version). | ||
| 2. **The watcher drains before dying.** `WeightWatcher.stop()` waits for an | ||
| in-flight apply to complete before cancelling, so a shutdown that races the | ||
| last handshake finishes it instead of stranding the trainer. The | ||
| orchestrator's global teardown budget bounds this wait. | ||
|
|
||
| No other component participates in shutdown ordering: the trainer only ever | ||
| waits on the watcher, and the watcher outlives every wait. | ||
|
|
||
| ## Who starts and stops dispatch | ||
|
|
||
| Nobody signals — dispatch is *pulled*. The dispatcher re-checks the gate before | ||
| each scheduling decision, so stop/resume is a stateless predicate over | ||
| `(N, v)`, re-evaluated on its own loop. The single push-style signal in the | ||
| system is the version-advance event that wakes a held ship. Throughput is | ||
| identical to an unpaced orchestrator in both worlds: in World 1 no rule ever | ||
| binds, and in World 2 the trainer is the bottleneck regardless — the hold only | ||
| changes *where* a finished batch waits (in the orchestrator instead of the | ||
| trainer's queue), never when the trainer gets to consume it. |
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.