Repository navigation
feat(eval): check selected attempts in rollout health reports - #3881
Conversation
bc7eef6 to
1322d2c
Compare
|
/ok to test 1322d2c |
f14cb90 to
922ee26
Compare
922ee26 to
01ddac3
Compare
|
/ok to test 01ddac3 |
|
/ok to test 0d06b64 |
Main now carries #5343 as one squashed commit, while this branch carries its original history. Two places conflicted where this branch adds lines that #5343 never had (an import in nemo_gym/cli/eval.py and the `gym eval status` tests); both keep this branch's text. The merged tree is identical to this branch's previous tree: no content changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Brings in the base branch's merge of main, which now carries #5343 as one squashed commit. The tree is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test ee83176 |
run_examples records a shard on copies of the rows that name the shard's run, but the copies kept the row's own rollout id, and with it the capture key the model calls are staged under. Capture files are kept by default, so a later shard that dispatched the same task and rollout (a row an earlier shard returned, fed back, or indices numbered again each step) merged the earlier shard's calls into its own records. Each dispatched copy of a recorded shard now carries the row's own id (its _ng_rollout_id, or <task>-<rollout>) prefixed with the shard's run id. A row an earlier shard returned has that prefix replaced, not nested. The capture key is that id with the usual attempt suffix, so capture_key and the /ng-rollout/<capture key> path keep their form; only the key is now the shard's own. The Store, the manifest, the records and the returned rows use the same id, so a caller reads a capture's key from the returned row. enrich_results without recording keeps the caller's keys. Tests: two shards that dispatch the same task and rollout, with the row fed back or the indices numbered again, each record only their own calls (they fail without the change). The shard tests stage captures under the dispatched key, as the model server does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
A recorded shard's manifest hashed the caller's rows and the recording
options, while the manifest gym eval run computes on resume hashes the
source file's bytes and the resolved configuration. Resuming a shard with
resume_from_cache was therefore refused for its source dataset and its
configuration. The earlier test passed the saved manifest in as the current
one, so it never compared the two.
The writer now builds the shard's manifest with RunManifest.create, the
identity function collection uses. Its inputs are the shard's materialized
inputs as the source file, the rows as dispatched, a collection config that
names the shard's input and output paths and leaves every other setting at
its default, and the call's server configuration. The identity file is
saved beside the manifest, as for any run, and replaced with the shard. So
gym eval run +input_jsonl_fpath=<dir>/rollouts-<shard>_materialized_inputs.jsonl
+output_jsonl_fpath=<dir>/rollouts-<shard>.jsonl +resume_from_cache=true
verifies and runs only what the shard still lacks. An operational
difference resumes with the usual drift note, and a semantic one is refused
and named. If the running configuration gives no identity (for example it
does not name the rows' agent), the shard is still recorded, with a
warning, and a resume refuses it and says why.
Tests: a shard recorded with one failure resumes through run_from_config,
dispatches only the failed row and ends with both rows scored; a shard
without a configuration identity is recorded and warns. Both fail without
the change.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
The training-framework section now says that a recorded shard dispatches each row under its rollout id prefixed with the shard's run id, so a capture's key is read from the returned row, and that a shard resumes with gym eval run on its materialized inputs and its rollouts file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
…apture keys Only a recorded shard prefixes its rollout ids with its run id. A plain gym eval run and run_examples with enrich_results alone dispatch every row under the id Gym derived before: <task>-<rollout>, or the row's own _ng_rollout_id. The saved results carry the same ids, so recovery and re-verification of such runs read the identities they always did. The test passes before and after the shard change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
…nkept omitted row With record_omitted_rollouts left off, the shard writer returned for an omitted row before its status write. When that row was the last one expected and status writes were throttled, the final counts never reached the status file: with two scored rows and an omitted third, gym eval status reported one completed result instead of two. Closing the iterator corrected it, but iterating to the end does not close it. The early return now flushes the status when it handles the last expected row. As with any flush, a writer that another writer superseded leaves the newer status alone. The saved results do not change. Test: the throttled status test also writes two scored rows and an unkept omitted row, and expects two completed and one remaining (it reports one completed without the change). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
…e shard A recorded shard prefixes each row's rollout id with its run id, after removing the prefix an earlier shard put on a row it returned. A row fed back as `<earlier run>.0` and a new row whose own id is `0` therefore both became `<this run>.0` in the same call. They would then share capture files and one manifest identity. A training framework hits this when a step resubmits a returned row next to fresh rows whose numbering restarted. run_examples now refuses such a call before dispatch, and before the existing shard is replaced. The error names both rows and both of their own ids, so the caller can give each row a distinct _ng_rollout_id or distinct task and rollout indices. Test: `<earlier run>.0` beside `0` is refused with both ids named, nothing is dispatched and the existing shard is kept. `<earlier run>.0` beside `1` still dispatches, as `<run>.0` and `<run>.1`. It fails without the change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
The capture key, a rollout id with its attempt suffix, also names the model server's capture files. The longest of them is `<key>.capture.incomplete`, and a file name holds at most 255 bytes. A recorded shard adds a 33-character run-id prefix to each row's id, so a long explicit id could pass that limit and fail only when the first model call was captured, mid-rollout. A shared check, check_rollout_id_length in nemo_gym.core.episode_context, allows a rollout id of up to 230 bytes. That leaves room for attempt suffixes up to -a9999 and the longest capture file suffix, and also keeps a key under a 256-character id limit. run_examples applies it to each recorded row's id after the prefix is added, before dispatch and before the existing shard is replaced. The error names the id, its length and the limit. Test: an id one byte over the limit, after the prefix, is refused with nothing dispatched and no shard written. The longest id that fits dispatches, and its capture file name at attempt 9999 is exactly 255 bytes. It fails without the change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
The library reference page generated from the judge_profile module failed
to parse: its module docstring wrote the pool node variable as
``${GYM_POOL_<POOL>_NODES}``, and the generated MDX read `<POOL>` as a tag.
The docs preview of any change that rebuilds the full reference failed on
it.
The docstring now names the variable as ``GYM_POOL_*_NODES``. No other
docstring combines a ${...} reference with an angle-bracket placeholder,
and the other pages built from docstrings parsed in the same build.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
…stant
The library reference page for the judge_profile module failed to parse.
The page generator writes each field's default into an MDX attribute as
its Python repr, and JudgeExecutionProfile.qos_source defaulted to the
string "the partition's default". Because of the apostrophe, the repr is
double-quoted, so the generated line was
<ParamField path="qos_source" type="str = "the partition's default"">
and MDX stopped at the `'` ("Unexpected character `'` in attribute name").
The default is now the module constant PARTITION_DEFAULT_QOS, with the same
text, so the page shows `str = PARTITION_DEFAULT_QOS`, as it does for
`kind: str = CPU_PROFILE`. The two other places that set the same source
use the constant too. The text in the operator's log does not change. No
other plain string default in nemo_gym contains an apostrophe.
Verified by generating the page locally with the docs CLI and compiling it
with MDX 3: the old page fails with the error above, the new one compiles.
The judge profile tests pass unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
|
Rechecked Core, sandbox and server CI passed. The remaining docs-preview and nonblocking conformance failures also occur on the immediate base; the docs error is in the library reference generated from main. @AdamRajfer, this looks ready for your final review. Thanks! |
AdamRajfer
left a comment
There was a problem hiding this comment.
I ran this and read the health change. The tests are real: the health, store, records and recovery-review files pass on this head (1,777), and 47 of them fail against the current health module, so they pin the new behaviour (selected-offset reads from the original shards, replaced-file detection while appends stay allowed, a late success of a superseded attempt staying out, the aggregation cases).
The design reads right to me. Workers read the selected byte ranges from the histories that own selection, aggregation hands in its own snapshots so coverage and selection cannot drift apart, and the guard that refused superseded histories is gone. I looked for other users of the removed selected_projection and JournalHealthUnavailable: the only one left is a compatibility branch in cli/eval.py that checks whether the parameter exists, so it switches itself off with this change. Two small things inline.
…recovery-health Brings in the #5443 commits that landed after this branch last merged it, so the merge with main sees the shared history. No conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
…ealth No conflicts; git merged every file on its own. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test 163203e |
|
Merged main after #5443 landed. The resolution kept main's manifest helpers and carried the digests: this PR's own diff against main is unchanged, and git merged every file on its own. |
Signed-off-by: Yuhe Zhang <[email protected]>
|
/ok to test dd8348d |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41884267839 |
No conflicts; git merged every file on its own, following the test files #5589 moved. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Main now mirrors nemo_gym's packages in tests/unit_tests (#5589). The journal health test covers nemo_gym/rollouts/rollout_health.py, so it moves to tests/unit_tests/rollouts/, and its import of the re-judge test helpers follows that module to tests/unit_tests/eval/. Without the import change the settled-judge-answer test fails with ModuleNotFoundError on the merged tree. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test ddeb7ed |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/41891393402 |
What does this PR do?
Health reports now inspect the same completed attempts selected for evaluation scoring, including after resume or judge-only recovery. An older success cannot reappear after a newer failed or interrupted attempt. Reports read selected records directly from the original run files, so a separate merged projection is unnecessary.
Stacked on #5443 in Adam's failure and recovery stack, which includes #5072 and #5343. Follow-up to #3302 for #2135. #3879 adds ordinary re-scoring above this PR.
Aggregation passes its exact scoring-history snapshots into health checks. Record checks, coverage and selected-failure timing therefore remain consistent if a collector appends while metrics are computed. Standalone checks read current history. Workers validate file identity and rollout/attempt identity before reading saved byte ranges; imported attempts keep their assigned execution numbers.
The integration preserves the stack's failure observations, artifact-digest binding, disabled/provisional reports, model-call-capture reads, persisted limits and shard-report entry points. Loose JSONL and explicit failure sidecars retain their diagnostic reading behavior. Scores and retry decisions are unchanged.
Validation
Python 3.13.14, Linux, dedicated CPU allocation:
--force; it is not judge-accuracy or production-workload validation. Captured training-token traces and execution checkpoint restoration were not exercised.Full sandbox/server CI remains pending for this rewritten head.
Compatibility and scope
Removes the temporary health guard against superseded histories and its obsolete internal projection argument. Existing report schema and policy remain in place. Judge-only recovery comes from #5343; execution checkpoint restoration remains outside this PR under #3024/#3893.
Checklist