Repository navigation
feat(orchestration): add --resolve-only to gym eval submit - #3524
Merged
iguehring-nvidia merged 3 commits intoSep 18, 2026
Merged
Conversation
`gym eval submit` already composes, resolves, and validates a SubmitConfig before deciding whether to dry-run or submit, but a caller could not observe that object without side effects: --dry-run renders executor scripts and returns None, and only a real submission persists the resolved config (BaseExecutor.persist -> resolved-config.yaml). --resolve-only stops right after validation and prints the resolved config, in the same YAML serialization persist() writes (or JSON with --json), so a caller can obtain or diff the exact config a submission would run without queueing a job or opening a connection to the cluster. It is registered in a mutually exclusive group with --dry-run: the two stop at different depths and combining them has no meaning. Motivation: downstream certification tooling (EFB Evergreen) needs a compose-only path to reproduce a certified hash from a leaf config. NEL and NEL Next expose that through their Python APIs; Gym did not. Part of #1640. Signed-off-by: Ingo Guehring <[email protected]>
|
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. |
7 tasks done
…esolve-only Signed-off-by: Ingo Guehring <[email protected]>
Drop the mutually exclusive group. Both flags mean "do not submit" and --resolve-only stops earlier, so the pair is redundant, not contradictory; accepting it matches how --json is already accepted and inert under --dry-run on this command. Removes the registration helper and keeps --resolve-only a plain Flag like its neighbours. Signed-off-by: Ingo Guehring <[email protected]>
iguehring-nvidia
marked this pull request as ready for review
September 18, 2026 11:39
iguehring-nvidia
enabled auto-merge
September 18, 2026 11:43
marta-sd
approved these changes
Sep 18, 2026
Contributor
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/35347263545 |
iguehring-nvidia
deleted the
iguehring/eval-submit-resolve-only-signed
branch
September 18, 2026 13:09
7 tasks done
reinainblood
pushed a commit
to reinainblood/Gym
that referenced
this pull request
Sep 21, 2026
…n record (NVIDIA-NeMo#3529) ## What does this PR do? `gym-job.json` records `gym_version`, which repeats across every commit between two version bumps. A reader that needs to reinstall the exact Gym that wrote a record — to recompose the submission's config with `gym eval submit --resolve-only` (NVIDIA-NeMo#3524) and compare it against what it expects — cannot pin that from the version alone. This adds `SubmissionRecord.gym_commit`: the commit of the nemo-gym that wrote the record. - A git install (`pip install git+…@<sha>`) records the commit in the distribution's PEP 610 `direct_url.json` as `vcs_info.commit_id`; that is used when present. - Otherwise the checkout the running `nemo_gym` package is tracked in is asked directly (`git ls-files --error-unmatch` on the package, then `rev-parse HEAD` / `status --porcelain`): its HEAD when clean, `<HEAD>-dirty` when it has uncommitted changes. This does not depend on install metadata at all, so an editable install whose venv lacks `nemo-gym` dist-info (uv can produce that) and a plain source tree on `sys.path` both work. - A package no checkout tracks — a wheel in `site-packages`, even when the venv sits inside a clone — yields `None`; so does a missing `git`. Every `None` is logged with its reason. An index wheel needs no commit anyway: a published version is immutable, so `gym_version` already identifies it. Added with a default, as `jobs.py`'s compatibility rule requires of a same-version change: records written before this still load under `schema_version: 1`. `jobs.py` stays executor-agnostic (no new imports from `executors/`). Consumer: NVIDIA's eval-factory certification layer (Evergreen) pins the Gym it recomposes with from this field instead of from its own toolchain pin. ## Validation ``` .venv/bin/python -m pytest tests/unit_tests/test_orchestration_jobs.py tests/unit_tests/test_slurm_executor.py tests/unit_tests/test_cli_eval_submit.py # 62 passed pre-commit run --files nemo_gym/orchestration/jobs.py nemo_gym/orchestration/executors/slurm.py tests/unit_tests/test_orchestration_jobs.py # all hooks pass ``` Against real installs: in a venv created with `pip install "nemo-gym @ git+https://github.com/NVIDIA-NeMo/gym.git@c41584d1…"`, `direct_url.json` reads `{"vcs_info": {"commit_id": "c41584d1…"}}` and the helper returns it; in this editable checkout with local edits it returns `<HEAD>-dirty`, and the same source tree on `PYTHONPATH` in a venv with no `nemo-gym` dist-info (where `distribution("nemo-gym")` raises `PackageNotFoundError`) returns the same. End to end on a Slurm cluster: `pip install "nemo-gym @ git+…gym.git@4636cd3…"` into a fresh venv, `gym eval submit` a real config (job cancelled right after enqueue), `gym-job.json` reads `"gym_commit": "4636cd35d33675551bfb6e3ba91295a1b03874fe"`. Install scenarios exercised for real against this branch's head (`29bf4f61`), beyond the unit tests: | How nemo-gym is running | `direct_url.json` | `gym_commit` | |---|---|---| | `pip install "nemo-gym @ git+…@29bf4f61"` into a fresh venv on a Slurm login node, real `gym eval submit` (job cancelled at enqueue) | `vcs_info.commit_id` | `29bf4f61…` | | `uv pip install -e <clean clone>` | `dir_info.editable` | `29bf4f61…` | | same editable venv, checkout with an uncommitted edit | `dir_info.editable` | `29bf4f61…-dirty` | | clean clone on `PYTHONPATH`, no nemo-gym dist-info at all (`distribution()` raises) | — | `29bf4f61…` | | same, checkout dirty | — | `29bf4f61…-dirty` | | wheel built from the clone, installed into a `.venv` **inside** the clone | `archive_info` | `None` (not tracked in a checkout) | | clone on `PYTHONPATH`, `git` not on `PATH` | — | `None` (git is not available) | ## Rollouts N/A — orchestration metadata only; no environment or agent code. ## Compatibility and benchmark impact Additive, defaulted field on `gym-job.json`; no schema version bump needed and older records load unchanged. No benchmark-result effect. ## Checklist - [x] I have read the [contributing guidelines](https://github.com/NVIDIA-NeMo/Gym/blob/main/CONTRIBUTING.md). - [x] The change is focused; unrelated "drive-by" edits are tracked as separate issues/PRs. - [x] Tests added or updated and pass locally, or N/A for docs-only / non-code changes (so CI unit/server checks pass when applicable). - [x] Documentation added or updated, or N/A with justification — the field is documented in `SubmissionRecord`'s docstring, where the other fields are. - [x] Pre-commit checks pass locally (`pre-commit run --all-files`) (so CI lint/format checks pass). - [x] New source files include the required Apache-2.0 SPDX header — no new files. - [x] All commits have DCO sign-off (`git commit -s`) (so the DCO check passes). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Ingo Guehring <[email protected]>
2 tasks done
This branch was previously 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
--resolve-onlytogym eval submit: compose, resolve, and validate the submit config, print the resultingSubmitConfig, and stop — no job script is rendered, nothing is submitted, and no connection tocompute.hostnameis opened._eval_submitalready builds exactly this object before callingsubmit(); the flag makes it observable. The YAML output is the same serializationBaseExecutor.persist()writes asresolved-config.yaml, so it diffs cleanly against a real run's persisted config. With--jsonit emits the config as JSON instead.--dry-runmay be passed alongside it and is inert: both flags mean "do not submit" and--resolve-onlystops earlier, matching how--jsonis already accepted and inert under--dry-run.Why: downstream certification tooling (EFB Evergreen) needs to reproduce a leaf config's resolved form without submitting it. NEL and NEL Next expose that through their Python APIs (
RunConfig.from_hydra,_load_config); Gym had no equivalent, and--dry-rundoes not serve — it prints renderedjob.shtext and never reachespersist().Part of #1640. No dedicated issue: a small additive flag on an existing experimental command. Design points open for discussion on this draft: flag on
submitvs. a separate subcommand; YAML default with--jsonopt-in; inert vs. rejected--dry-runalongside it (inert chosen for consistency with--jsonunder--dry-run).Validation
Run against the final diff:
pytest tests/unit_tests/test_cli_eval_submit.py— 38 passed (31 existing + 7 new)pytest tests/unit_tests/test_cli.py tests/unit_tests/test_cli_endpoint_readiness.py— 99 passedruff check/ruff format --checkon both changed files — cleanpre-commit run --files nemo_gym/cli/main.py tests/unit_tests/test_cli_eval_submit.py— all hooks passgym eval submit --config <wrapper> --resolve-onlyagainst a real multi-fragment Hydra composition (an EFB gym-native leaf: cluster + model + benchmark fragments,hydra.searchpathoverrides,~cluster). Output is structurally identical to theresolved-config.yamlthat a real submission of the same leaf persisted on the cluster;runtime:-prefixed env values are left unresolved as expected.--resolve-only --jsonparses as JSON.New tests assert observable contracts:
submit()is never called; stdout is byte-identical to whatBaseExecutor.persist()writes (asserted against the realpersist(), not a re-derivation of its serialization); Hydra overrides apply;--jsonemits JSON; an invalid config fails through the identicalConfigErrorpath; through the real CLI (main()with argv) stdout parses whole and no executor is ever instantiated, with and without a redundant--dry-run.Rollouts
N/A — CLI-only change. No environment, agent, model, or executor behavior changes;
--resolve-onlyreturns before any executor is instantiated.Compatibility and benchmark impact
Additive; existing invocations are unchanged.
--jsonnow also applies to--resolve-onlyoutput (help text updated). No benchmark-result impact.Docs: N/A — no Fern page documents
gym eval submitflags beyond a release-notes bullet;--helpis the reference and is updated by this change.Checklist
pre-commit run --all-files) (so CI lint/format checks pass).git commit -s) (so the DCO check passes).🤖 Generated with Claude Code