feat: adapt orchestrator to index-addressed env server#2856
Closed
mikasenghaas wants to merge 1 commit into
Closed
feat: adapt orchestrator to index-addressed env server#2856mikasenghaas wants to merge 1 commit into
mikasenghaas wants to merge 1 commit into
Conversation
…ask count) The env server no longer reports a task count for lazily-served (generator, possibly unbounded) tasksets — `info().num_tasks` is now `int | None`. Adapt the orchestrator to drive purely by `task_idx`: - `Env.num_tasks` is `int | None`; `EvalEnv` requires `num_examples` to bound a lazily-served eval (can't enumerate an unknown/infinite count). - `TrainSource` keeps the finite path unchanged (enumerate the index range, shuffle, reshuffle per epoch, weight by size) and adds an unbounded path: `num_tasks is None` → stream a monotonically increasing `task_idx` (the taskset's own generator supplies the variety). Unbounded envs have no size to weight by, so they require an explicit `ratio`. Backward-compatible: against a server that still reports a count, every env is bounded and behavior is unchanged. Pairs with verifiers PR #1829 (the env-server API change); the verifiers pin bump lands when that merges. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 23, 2026
Member
Author
|
Superseded by #2882, which reimplements the same orchestrator change off |
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.
Summary
Companion to verifiers PR #1829, which makes the v1 env-server index-addressed with no required task count so it can serve lazy/unbounded tasksets —
InfoResponse.num_tasksis nowint | None(None= served lazily; the caller drivestask_idx). This adapts the orchestrator to that API.Env.num_tasksis nowint | None(Nonewhen the taskset is served lazily).EvalEnv.startrequiresnum_examplesto bound a lazily-served eval — an unknown/infinite count can't be enumerated (raises a clear error ifnum_examples < 0).TrainSource:num_tasks is None) —next_examplestreams a monotonically increasingtask_idx(no epoch/reshuffle; the taskset's own generator, e.g. RNG-seeded pairs, supplies the variety).ratio(clear error otherwise).Backward-compatible: against a server that still reports a count (every current taskset that returns a list, and the v0 bridge), every env is bounded and behavior is identical. The change is safe to land before the verifiers pin bump.
Verification
Unit-checked
TrainSourceagainst stub envs:[2,0,1,3, 1,2,0,3, ...]);num_tasks=None, with aratio) → streams[0,1,2,3,4,5];ratioalongside a finite env →ValueError(no size to weight by);ruff check/ruff formatclean (pre-commit).Follow-up
The verifiers pin bump (to the merged #1829 commit) lands separately once that PR merges; only then does an actual unbounded taskset report
num_tasks=Noneend-to-end.