Repository navigation
feat(eval): export failure classes, retry counts and resumes to exporters - #4852
Conversation
…ters
gym eval run and gym eval aggregate now add coverage/failed/<class> and
retries/{attempts,rollouts_retried,at_cap,max_attempts} to the coverage
metrics they export. The counts come from the failures sidecars, so a
resumed run reports totals for the whole run. MLflowExporter.setup counts
each reopen of a run in a gym_resume_count tag.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Adam Rajfer <[email protected]>
|
/ok to test 637dca0 |
|
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. |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
HOLD — two RISK defects make resumed and offline tracker summaries inaccurate.
Inspected all four changed files and traced the affected cache, aggregation, and exporter paths. Findings are based on source inspection; tests were not executed in this read-only review.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
Review finding 4338960567 on NVIDIA-NeMo#4852. A resumed run reopens its tracking run, which keeps the last value of every metric it was sent. When a rollout that had failed later landed, or its last attempt failed with another class, coverage/failed/<class> was left out of the export and the old count stayed. Every class the sidecars name is now exported, at 0 when no unresolved rollout has it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
Review finding 4338960587 (follow-up to NVIDIA-NeMo#4852). Offline aggregation compared each rollout's failed attempts with the attempt cap of the process doing the aggregating, so a run collected with cap 1 and aggregated in a fresh shell reported max_attempts 3 and nothing at the cap. Collection now records its cap on each failures-sidecar row (_ng_failure_max_attempts, kept out of the metrics like the other _ng_failure_ fields), and retries/at_cap holds each rollout to the cap on its last attempt. retries/max_attempts is that cap, and is left out when the rollouts were collected with different caps. A row written before the cap was recorded uses the current cap, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
A resumed or resubmitted run reopens the MLflow run it recorded, and _log_config logged every config value as a param again. MLflow refuses to change a logged param, so each later segment failed with INVALID_PARAMETER_VALUE (the policy server's host and port move between segments), its config was never recorded, and the guard logged a warning. On a reopened run the exporter now reads the run's logged params and logs only keys that are new, so it never tries to change one. The first segment's global_config.json stays as is, and the segment's full config goes to config/segment_<UTC start>_<content digest>.json. The name needs no read of the run's artifacts and cannot collide: the start time orders segments and the digest separates two that start in the same second. A first segment behaves as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/39760212720 |
NVIDIA-NeMo#4852 landed on main as one squashed commit, which also holds its later MLflow fix. This merge takes main's version of the files NVIDIA-NeMo#4852 changed and keeps this branch's own change on top, so the PR targets main and shows only that change: report retries at the cap a run was collected with. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
…-NeMo#4873) * feat(eval): export failure classes, retry counts and resumes to exporters gym eval run and gym eval aggregate now add coverage/failed/<class> and retries/{attempts,rollouts_retried,at_cap,max_attempts} to the coverage metrics they export. The counts come from the failures sidecars, so a resumed run reports totals for the whole run. MLflowExporter.setup counts each reopen of a run in a gym_resume_count tag. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]> * fix(eval): export 0 for a failure class a resume cleared Review finding 4338960567 on NVIDIA-NeMo#4852. A resumed run reopens its tracking run, which keeps the last value of every metric it was sent. When a rollout that had failed later landed, or its last attempt failed with another class, coverage/failed/<class> was left out of the export and the old count stayed. Every class the sidecars name is now exported, at 0 when no unresolved rollout has it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]> * fix(eval): report retries at the cap a run was collected with Review finding 4338960587 (follow-up to NVIDIA-NeMo#4852). Offline aggregation compared each rollout's failed attempts with the attempt cap of the process doing the aggregating, so a run collected with cap 1 and aggregated in a fresh shell reported max_attempts 3 and nothing at the cap. Collection now records its cap on each failures-sidecar row (_ng_failure_max_attempts, kept out of the metrics like the other _ng_failure_ fields), and retries/at_cap holds each rollout to the cap on its last attempt. retries/max_attempts is that cap, and is left out when the rollouts were collected with different caps. A row written before the cap was recorded uses the current cap, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]> --------- Signed-off-by: Adam Rajfer <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
Brings in the run health counts (NVIDIA-NeMo#4788) and the exporter changes (NVIDIA-NeMo#4852, NVIDIA-NeMo#4873), which the time-limit diagnostics now build on. No conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Adam Rajfer <[email protected]>
A run's exported metrics say how many rollouts were expected, scored and missing, but not why rollouts failed, how many were retried, or how often the run was resumed. Reading a run from its tracker alone needs those.
gym eval runandgym eval aggregatenow add these keys next to the coverage metrics they export:coverage/failed/<class>: failed rollouts per failure class.retries/attempts,retries/rollouts_retried,retries/at_capandretries/max_attempts.The counts come from the
_failures.jsonlsidecars, so a resumed run reports totals for the whole run, not only for its last job. A rollout that failed and then landed on a later resume is not counted as failed.MLflowExporter.setupcounts each reopen of a run in agym_resume_counttag. A failure class that a resume cleared is exported as 0, so a reopened MLflow or W&B run does not keep the old count.A reopened run also stops re-logging its config. MLflow refuses to change a logged param, and the policy server's host and port move between segments, so every later segment logged
INVALID_PARAMETER_VALUEand its params were not all logged, while its config overwrote the first segment'sglobal_config.json. On a reopened run the exporter now logs only params that are not logged yet, and writes the segment's full config toconfig/segment_<UTC start>_<content digest>.json. A first segment behaves as before.Training is not affected:
run_examplesandgym env starthave no diff.Validation:
test_a_resumed_run_exports_its_failures_and_retriesandtest_run_from_config_exports_failures_and_retries_of_every_shardintests/unit_tests/test_rollout_collection.py, andtest_each_reopen_counts_one_more_resume,test_a_resumed_segment_with_a_moved_server_logs_no_error_or_warning,test_a_resumed_segment_logs_only_params_that_are_not_logged_yet,test_a_resumed_segment_records_its_changed_config_in_an_artifact_of_its_ownandtest_each_resumed_segment_gets_its_own_config_artifactintests/unit_tests/test_exporters.py. Each fails without its change.TestFailureExportMetricsintests/unit_tests/test_rollout_collection.pychecks that a class cleared by a resume or replaced by a later attempt is exported as 0, and that no sidecar rows export no class.pytest tests/unit_tests/test_rollout_collection.py tests/unit_tests/test_exporters.py: pass.ruff check,ruff format.Compatibility: adds metric keys, one tag and one config artifact per resumed segment. Existing keys do not change.
🤖 Generated with Claude Code