Repository navigation
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 17, 2026 20:17
cb2c127 to
627e1c2
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
2 times, most recently
from
September 18, 2026 00:55
0800040 to
b0fd1f0
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 18, 2026 01:06
b0fd1f0 to
4a168d2
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 18, 2026 01:32
4a168d2 to
928e01b
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 18, 2026 20:44
928e01b to
c2cc51d
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 18, 2026 21:36
c2cc51d to
0b41dfb
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 18, 2026 22:22
0b41dfb to
7b349ad
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 18, 2026 22:27
7b349ad to
952a1a0
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
2 times, most recently
from
September 18, 2026 22:34
4b3c7b8 to
aa97910
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
2 times, most recently
from
September 22, 2026 16:47
9b03b21 to
a22e9d1
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 22, 2026 17:37
a22e9d1 to
30d46f8
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 23, 2026 16:33
30d46f8 to
6a43738
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 23, 2026 16:36
6a43738 to
041154b
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 23, 2026 16:42
041154b to
7842d93
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 23, 2026 16:49
7842d93 to
e44378e
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 23, 2026 17:10
e44378e to
97b5362
Compare
ananthsub
force-pushed
the
ananthsub/episode-orchestration-10-rollout-routing
branch
from
September 23, 2026 17:13
97b5362 to
934c327
Compare
This was referenced Sep 23, 2026
Signed-off-by: Ananth Subramaniam <[email protected]>
…ts per row (#3576) ## What does this PR do? Lets one rollout-collection batch mix native (materialized) tasksets and compatibility-routed flat rows, with no new agent × resources pairing, and keeps the chosen environment server's identity on every row through shards, retries and results. - A materialized task (`task_id.taskset` plus `task_input`) now routes by `environment_server_routes` in **every** `environment_routing_mode`; it is the native episode request and no agent-server `/run` accepts it. - A flat row keeps following the mode: `agent` (default) resolves the row's own environment server at dispatch, as today; `legacy` sends every flat row to `environment_server_name`; `taskset` stays native-only and rejects flat rows, so a native run cannot silently pick up legacy input. - A materialized row whose taskset has no entry in `environment_server_routes` fails at preprocessing with the missing route named. (#3491 no longer has a `tasksets` config block, so routes are the only declaration.) - Two knobs that cannot apply to a materialized row now fail with the fix named instead of a `KeyError`: `num_repeats_add_seed` (the seed lives in the top-level prompt, which a materialized row keeps under `task_input`). - No config or YAML changes: routes point at existing environment-server deployments, and flat rows reach the `legacy_agent` servers that #3490 generates in front of each existing pairing. The `_ng_environment_server` stamp, written once at preprocessing, already reaches the materialized input file, resume retries (`_load_from_cache` re-reads the stamped rows) and result rows; this PR does not change that path. ## Interaction flow ```mermaid sequenceDiagram participant C as Rollout collector participant N as Native environment server, one per taskset route participant L as legacy_agent environment server, one per pairing participant A as Agent server Note over C: preprocess stamps _ng_environment_server once per row Note over C: materialized row routes by task_id.taskset, flat row follows the routing mode C->>N: POST /run with the episode request, episode_id plus task C->>L: POST /run with today's flat row L->>A: relay /run N-->>C: SingleAgentEpisodeResponse L-->>C: legacy result ``` ## Stack position Stacks on #3491 (part 12, `ananthsub/episode-orchestration-10-rollout-routing`) and touches only `nemo_gym/rollout_collection.py`, which #3492 does not modify. It can be squashed into #3491 if preferred, since it changes the semantics of the routing mode that PR introduces. Follow-up (separate PR): aggregate metrics grouped by `_ng_environment_server` instead of `agent_ref.name`, and native `failure` replies written to the failures sidecar, so identity also persists through `gym eval aggregate` and retries of native episodes. ## Validation - `pytest tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_global_config.py -q` → 383 passed. - Adversarial review (four lenses, two independent refuters per finding, each reproduced against the code): the two surviving findings attributable to this PR are fixed in the second commit. - New tests in `TestEnvironmentServerRouting`: a mixed batch dispatches the native row to its taskset's route as an episode request and the flat row to the server fronting its agent as today's flat body; a materialized row without a route fails before dispatch; `legacy` mode stamps flat rows with `environment_server_name` and materialized rows by taskset, then dispatches both through `run_examples` against a `legacy_agent` server that binds no resources server; `num_repeats_add_seed` on a materialized row fails before dispatch; `taskset` mode still rejects flat rows. - `ruff check` and `ruff format --check` pass. ## Compatibility and benchmark impact Default behavior for flat-only batches is unchanged. Materialized rows in `agent` mode previously had no route and could not be dispatched; they now require `environment_server_routes`, which is what `taskset` mode already required. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Adil Asif <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
…tive failures, retries and aggregation A native environment-server reply (`BaseEpisodeResponse`) is projected when the collector persists it: a handled `failure` becomes a failures-sidecar row with `_ng_failure_class=environment_server_failed`, `_ng_failure_terminal` from the reply, and the row's `_ng_environment_server` stamp, so resume retries a non-terminal failure on the same server and never a terminal one; a `result` keeps the native record and gains the top-level `reward` and mask flag that progress accounting and the health check read. `/aggregate_metrics` is grouped by the environment server stamped on each row, falling back to the server that fronts the row's agent as before, and native records are unwrapped to their `result.verification` before scoring. Each entry in `_aggregate_metrics.json` now names its `_ng_environment_server` beside the `agent_ref` label, and `gym eval aggregate` inherits the grouping because result rows carry the stamp across shards. A run that configures `environment_server_routes` sets up the environment-server client even in the default routing mode, so stamped rows resolve against the merged config. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
…agent observations, keep aggregate labels distinct Projection of a BaseEpisodeResponse now happens only for rows the collector dispatched as native episode requests, and the shape check requires object identities, so a legacy verify reply that echoes identity fields is never turned into a sidecar row. A non-object `failure` fails with the episode named instead of an AttributeError outside the dispatch guard. A native result lifts `result.agent_observations` to `ng_agent_observations`, as the legacy adapter does, so trajectory capture and the health check see the agent's evidence. Collector-stamped `ng_perf` travels with the unwrapped record into `/aggregate_metrics`. Aggregation labels: two environment servers bound to one agent (a native server and its legacy_agent twin) produced duplicate `agent_ref` entries, which `gym eval compare` rejects; the second is now labelled by its own name. A stamped server missing from the aggregate-time config fails naming the server and the available ones instead of an omegaconf KeyError. The end-to-end resume test no longer installs a global-config fallback, so it fails if a run with routes does not set up the environment-server client. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
Contributor
Author
|
Closing to recreate the remaining Environment Server work as one correctly ordered GitHub Stack. Branch commits are preserved; a replacement PR will follow. |
This branch was successfully 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.
What does this PR do?
Adds mixed compatibility and native taskset routing, then carries the selected Environment Server identity through persistence, retries, failures, and aggregation.
task_id.tasksetthroughenvironment_server_routesand are posted as native episode requests._ng_environment_server, unwraps native verification responses, and rejects stale server stamps.*_failures.jsonlsidecars.This is the single-agent-turn collection flow; other Environment Server protocols may use different request and result shapes. Previous: #3715. Next: #3492.
No issue is linked because this is one layer of the existing Environment Server stack.
Validation
uv run pytest tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_global_config.py tests/unit_tests/test_reward_profile.py tests/unit_tests/test_episode_types.py -q— 422 passeduv run pytest tests/unit_tests/test_rollout_collection.py::TestExpandInputGlob -q— 9 passedRollouts
See the final integration PR for end-to-end rollout evidence.
Compatibility and benchmark impact
Flat-only batches retain existing behavior. Materialized rows require an explicit taskset route. Result artifacts gain the Environment Server stamp; native failures are no longer misclassified as zero-reward successes.