Repository navigation
feat(orchestration): run a Harbor task target from gym eval submit - #5978
Conversation
|
/ok to test 27cd525 |
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE — two RISK findings in the submitted Harbor target workflow.
The automatic preparation can reject a correctly configured run, and resumable Slurm jobs using gym_install can reject unchanged tasks after the checkout location changes.
I inspected all 11 changed files and traced the affected CLI, configuration, rendering and resume contracts. This was a read-only source review; I didn't execute tests or cluster jobs. The acceptance checks below are proposed, not reported results.
Inline comments (escaped v1):
-
nemo_gym/orchestration/executors/slurm_script.pyline 1117: RISK — The forced preparation ignores settings that make the target runnable.For a minimal case, use a valid task dataset declaring
allowed_agents = ["hermes_agent"], then submittarget: /data/tasks,agent: opencode_agent,prepare: {}andrun: {allow_unsupported_pairing: true}. The generated preliminary command lacks the waiver, so preparation rejects the harness andset -eprevents the permitted run from starting. A direct target run receives the waiver through _prepare_target_run and passes the admission check. Run-only registry credentials, volume mappings and build settings can encounter the same configuration split.The smallest correction is to run a separate preparation only when explicitly configured;
run_targetalready prepares with its effective run settings. Restore this condition here and at the equivalent Kubernetes branch:if benchmark.prepare:This preserves explicit non-empty preparation, target/agent/sandbox forwarding, and ordinary benchmarks' separate prepare/run settings. It removes only the extra, less-configured step. Update the empty-prepare test accordingly.
Proposed acceptance: for both executors, render and exercise the waived-pairing setup above. With empty
prepare, no separate preparation command should run, and the target run should pass admission. Without the waiver, admission must still reject the harness. Retain explicit non-empty preparation, quoted target arguments and unchanged no-target rendering. Verify the suggested change before adopting it; these checks weren't executed. -
nemo_gym/data/tasks/harbor/materialize.pyline 261: RISK — Generated dataset paths prevent submitted target runs from resuming across fresh checkouts.The new Slurm target invocation supports
resumable: true, butdriver.gym_installcreates and enters a new/tmp/gym-install-XXXXXX/gymcheckout for each allocation in render_driver_entrypoint. Harbor preparation writes its rows relative to that checkout, and this line embeds their absolute location in the generated agent'sdatasetslist.After a partial run in checkout A, the next allocation prepares identical tasks in checkout B. Its
datasets[].jsonl_fpaththerefore differs. The collector retains that list in its configuration identity, and _is_semantic treats changes beneathdatasetsas semantic. The continuation is refused as incompatible configuration instead of retaining completed work and running the unfinished tasks. This affects automatic continuation and manual resubmission with a fresh installed checkout.Could you give submitted Harbor preparation a stable, benchmark-specific location under the mounted job directory, or narrowly normalize this generated row location during identity comparison while retaining content and dataset-contract checks? The exact patch depends on that placement decision. Don't make all dataset differences operational or enable unsafe resume: genuine task and dataset changes must remain protected.
Preserve: standalone target preparation's documented output location; the submit job's absolute rollout output; isolation between benchmarks using the same taskset; rejection of changed task digests, selection, repeats and semantic dataset settings.
Proposed acceptance: save a partial two-task target run from checkout A, then continue identical tasks/settings from checkout B. Resume should retain the successful rollout and dispatch only unfinished work. Change a task digest and assert refusal before dispatch. Also retain the assertion that changing
num_repeatsfrom 4 to 8 raises a semantic-drift error in the existing regression test. This finding is based on source tracing, not an executed cluster run.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
27cd525 to
01dd931
Compare
|
/ok to test 01dd931 |
|
/review reset=True |
1 similar comment
|
/review reset=True |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE — three RISK findings in submitted Harbor target runs.
Both failures from the previous review remain in the current source: automatic preparation can reject a permitted run, and fresh installed checkouts prevent unchanged Slurm runs from resuming. Submitted targets also leave verifier evidence outside durable job storage, including on non-resumable runs.
I inspected all 11 changed files and traced the affected CLI, configuration, rendering, storage and resume contracts. This was a read-only source review; I didn't execute tests or cluster jobs. The acceptance checks below are proposed, not reported results.
Inline comments (escaped v1):
-
nemo_gym/orchestration/executors/slurm_script.pyline 1117: RISK — The forced preparation ignores settings that make the target runnable.The first finding from review 5851387697 remains unresolved. For a minimal case, use a valid task dataset declaring
allowed_agents = ["hermes_agent"], then submittarget: /data/tasks,agent: opencode_agent,prepare: {}andrun: {allow_unsupported_pairing: true}. This branch emits a preliminary preparation without the waiver, so admission rejects the harness, and the entrypoint'sset -eprevents the permitted run from starting. Run-only registry credentials, volume mappings and build settings encounter the same configuration split.Could you run separate preparation only when explicitly configured?
run_targetalready prepares with its effective run settings. Replace this condition, and the equivalent Kubernetes condition, with:if benchmark.prepare:This removes only the implicit, less-configured step. Preserve explicit non-empty preparation, target/agent/sandbox forwarding, shell quoting, and ordinary benchmarks' separate prepare/run settings. Update the empty-prepare test, which currently requires the failure-producing command.
Proposed acceptance: for both executors, render and exercise the waived-pairing setup above. With empty
prepare, no separate preparation command should run, and the target run should pass admission. Without the waiver, admission must still reject the harness. Retain explicit non-empty preparation, a target containing spaces, and unchanged no-target rendering. Verify the suggested change before adopting it; these checks weren't executed. -
nemo_gym/data/tasks/harbor/materialize.pyline 261: RISK — Submitted targets still cannot resume across fresh installed checkouts.The second finding from review 5851387697 remains unresolved. Submit a two-task target at a stable mounted
/data/dswithdriver.gym_install,resumable: trueandrun: {reuse_existing_data_preparation: true}; let allocation A save one completed rollout. Each allocation creates and enters a fresh temporary checkout. The new submitted target invocation prepares rows relative to that checkout, and this line embeds their absolute location indatasets.Allocation B generates identical rows at another path. The collector retains the selected agent's datasets in configuration identity, treats
datasetsas semantic, and refuses continuation. Without input reuse, the persisted split metrics also retain the old dataset path and can reject preparation earlier. Unchanged tasks should instead retain completed work and dispatch only unfinished work.Could you give submitted preparation a stable, benchmark-specific root under mounted job storage?
prepare_targetalready acceptsoutput_root; that placement needs plumbing through_prepare_target_runand the submitted commands. Fetched and rendered task folders also need stable placement or narrowly defined location normalization: their generatedtasksets.*.folderotherwise changes too. The interface choice isn't clear enough for a safe exact patch. Don't make all dataset/taskset differences operational or enable unsafe resume.Preserve: standalone preparation's documented location; submit's absolute rollout output; isolation between benchmarks sharing a target; and rejection of changed task digests, selection, repeats and semantic dataset settings.
Proposed acceptance: save one of two tasks from checkout A, then continue identical settings from checkout B, both with and without
reuse_existing_data_preparation. Retain the completed rollout and dispatch only the unfinished task. Repeat for fetched and parameterized targets. Changed task digests or selection must still refuse before dispatch; retain the existing assertion that changing repeats from 4 to 8 raises semantic drift. These checks weren't executed. -
nemo_gym/data/tasks/harbor/materialize.pyline 315: RISK — Completed submitted targets leave verifier evidence in the disposable checkout.This also affects non-resumable runs. Submit a target available inside the driver container with
driver.gym_installand complete one episode. Installation changes into a temporary checkout, while preparation uses the relativeresults/harbordefault. This generatedartifacts_dirtherefore points into/tmp/gym-install-…/gym/results/harbor/<taskset>/verifier, not the durable benchmark directory.The server downloads verifier rewards and logs there and records the absolute directory in the result. Slurm automatically mounts the benchmark directory, while Kubernetes mounts the output PVC. The rollout JSONL survives, but verifier files, prepared rows and the generated run config remain outside that storage. Their saved summary paths stop resolving after the container is discarded, removing evidence needed to inspect a wrong reward or verifier failure.
Could you place submitted preparation outputs and the generated Harbor
artifacts_dirunder the mounted benchmark directory in both executors? A target-specific preparation-root contract through_prepare_target_runandprepare_targetcan do this without changing standalone defaults. Keep the generated config, result paths and summary pointing to the durable files; copying only the rollout JSONL isn't sufficient. The placement interface needs a decision, so I haven't supplied an exact patch.Preserve: standalone target preparation/run locations, separate output directories for benchmark leaves sharing a target, unique per-verification folders, collected artifacts, and submit's existing absolute rollout output.
Proposed acceptance: complete one target episode through each executor, retain only mounted output storage, and assert that the saved summary's rows, run-config and verifier paths still resolve. Verify that the verifier directory retains
reward.txtorreward.json,test-stdout.txtandtrajectory.json; include a separate-verifier task and retain its collectedartifacts/. Two benchmark leaves using one target must not replace each other's evidence. Retain the summary regression's concrete file/path assertions. These checks weren't executed.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
01dd931 to
608e2c8
Compare
|
/ok to test 608e2c8 |
|
/review reset=True |
A submitted benchmark can set `target`, `agent` and `sandbox`. The driver passes them to `gym eval run` as its TARGET, `--agent` and `--sandbox`, ahead of the `run` overrides, and adds `+harbor_output_root=<job>/artifacts/harbor` so the rows, run config and verifier logs stay in the job directory rather than the fresh checkout of each allocation. `prepare` still runs exactly as configured, so a dataset adapter can write the task folders the target names. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
…nd refuse settings a target ignores - `gym eval run TARGET --agent harbor_oracle_agent` prepares through the validation path; it now reads `+harbor_output_root` too, so a submitted oracle run does not write into the checkout. - A submitted `target` refuses `only_tasks`, `exclude_tasks` and `skip_unloadable` under `run`: `gym eval run` reads them only as command-line flags, so they would be ignored. - An empty `target`, `agent` or `sandbox` is refused at submit time. - `render_target_args` takes its same-typed settings as keyword arguments. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
428c463 to
b633ea3
Compare
gym eval prepare and gym eval submitgym eval submit
|
/ok to test b633ea3 |
|
/review reset=True |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP — LGTM; no concerns found.
I inspected all 12 changed files and traced configuration validation and serialization, CLI preparation, executor rendering, durable storage and resume identity. Two delegated reports weren't available, so I covered their CLI/preparation and executor topics directly.
The documented resume contract requires the target folder to stay stable across allocations. Within that contract, prepared rows and verifier artifacts use benchmark-local storage, while separate preparation keeps its configured adapter settings. The oracle path also uses the selected output root.
This was a read-only source review. I didn't execute tests or cluster jobs, so I haven't independently reproduced the validation and Slurm continuation reported in the PR.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
|
@giuliolovisotto can you help review this ? Thanks |
Resolve tests/unit_tests/orchestration/test_slurm_script.py: keep main's planned_log_sources tests and append this branch's task-target tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adil Asif <[email protected]>
|
/ok to test aea7be1 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/44602267361 |
Main's `_omit_unset_target` (#5978) and this branch's `_omit_unset_node_local` were both model_serializers on BenchmarkRunConfig. Pydantic keeps only one, so saved configs gained `target`, `agent` and `sandbox` set to None. One serializer now omits all four unset fields. Signed-off-by: Wojciech Prazuch <[email protected]>
What changed
gym eval submitcan run a Harbor task target. A benchmark underdriver.benchmarkscan settarget,agentandsandbox. The Slurm and Kubernetes drivers put them first on thegym eval runline:gym eval run <target> --agent <agent> --sandbox <sandbox> +harbor_output_root=<job>/artifacts/harbor +output_jsonl_fpath=... <run settings>+harbor_output_root=DIRmoves a task target's rows, run config,skipped.json,images.jsonandverifier/from the working-directory-relativeresults/harbor/<taskset>/toDIR/<taskset>/. It works on the command line too. The oracle path (--agent harbor_oracle_agent) honours it, keeping itsvalidation/subfolder.prepare:is unchanged frommain. It runs exactly as configured, before the run. A dataset adapter can therefore write the task folders the target names: the adapter runs inprepare, then the run prepares and runs the target.targetwithoutagentagentorsandboxwithouttargettargetwithcommandtargetwithonly_tasks,exclude_tasksorskip_unloadableunderrun.gym eval runreads those only as command-line flags, so it would ignore them.Why
EFB launches benchmarks through
gym eval submit, and onmaina submitted job cannot run a Harbor task target:runonly carries+key=valuetokens. They cannot express the positionalTARGETor--agent/--sandbox.--benchmark NAME. It refuses a preset passed with+config_paths, and its own error message points togym eval run <harbor_target> --agent <harness>. This PR is the submit form of that command.command:cannot be combined withresumable.mainalso writes a target's rows relative to the working directory. A submitted job's working directory is a fresh checkout on every allocation, and the rows path is part of the resume identity (datasets[].jsonl_fpath), so a continuation would be refused.+harbor_output_rootkeeps those files in the job directory.No issue is filed. This came from an EFB user moving BioMysteryBench off the deprecated
harbor_agent_generalonto the task-folder path.Changes since the earlier version of this PR
This PR was rebuilt on
mainafter the Harbor-backed benchmark config PR (#5794) merged. It drops:gym eval prepare TARGETand the preparation refactor.main's_prepare_for_agentcovers the shared part.prepare. That madepreparedo Harbor preparation and skip a configured dataset adapter.fix(rollouts)PR. An absolute target on shared storage does not need it.Validation
pytest tests/unit_tests/{orchestration,cli,data/tasks/harbor,rollouts,environment} -n 8: 7397 passed, 15 failed. The same 15 fail on unmodifiedmainwith the same venv: they needmlfloworjinja2, which are not installed there, or a different OpenTelemetry version. CI runs the full suite.test_slurm_script.py: target rendering, prepare unchanged, quoting, Hydra round trip of the output root, and validationtest_kubernetes_executor.py: target renderingtest_harbor_tasks.py::TestHarborOutputRoot: the same run config from two working directories, a quoted root, an invalid root, and the oracle path. The oracle test fails without its fix.pre-commit runon the changed files: passed. Commits are signed off.Rollout evidence
I submitted a real job with
gym eval submiton an internal Slurm cluster. It ran the first commit (1d856c451, before the rebase). The second commit changes only the oracle path and validation, which this run does not use.gym_benchmark.yaml) inprepare.target: /data,agent: opencode_agent,sandbox: opensandbox.What happened:
prepareran the adapter into the empty mounted/data(Adapted 2 tasks to /data). The run wrote its run config, rows and verifier logs under<job>/artifacts/harbor/data/. A 25-minute walltime ended the allocation with 3 of 4 rows saved.prepareskipped the cached dataset, the run kept the 3 saved rows and collected the remaining one, and the chain ended with "the Store covers all 4 expected rollouts".Compatibility
targetrenders and saves exactly as before: the serializer omits the unset fields.target, because benchmark configs areextra=forbid. A launcher must run this version or later to submit or recover such a job.🤖 Generated with Claude Code