Skip to content

fix(orchestration): fail evaluations with incomplete samples - #3716

Merged
Glorf merged 5 commits into
mainfrom
mbien/fix/orchestrated-eval-completeness
Sep 29, 2026
Merged

Glorf merged 5 commits into
mainfrom
mbien/fix/orchestrated-eval-completeness

Conversation

@Glorf

@Glorf Glorf commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fail a submitted benchmark job when fewer samples finish than expected, even if the collector returns normally. Submission enables require_complete by default; set driver.benchmarks.<name>.run.require_complete: false to opt out. Standalone runs retain their current default behavior.

Uses the collector's existing expected count and persisted results. Zero-reward results count as finished; duplicates and failure records do not. Checks run after partial artifacts and metrics are saved. GDPVal uses its stage counts, including the original plans for cached stages. Interrupted runs also exit nonzero when require_complete is enabled.

No separate issue: this fixes false-success job status. Regression checks reuse existing tests. There are no new files or dependencies.

Validation

At 673e9a46, 808 affected tests passed, including collector, orchestration, CLI, and GDPVal tests. GDPVal's 42 tests were rerun after the final cached-plan edit. Exact suite command using the shared development venv and this checkout's server namespace:

../nemo-gym-venv-setup-race/.venv/bin/python -c 'from pathlib import Path; import sys, resources_servers; resources_servers.__path__ = [str(Path.cwd() / "resources_servers")]; import pytest; sys.exit(pytest.main(sys.argv[1:]))' \
  tests/unit_tests/test_rollout_collection.py \
  tests/unit_tests/test_slurm_script.py \
  tests/unit_tests/test_orchestration_otel.py \
  tests/unit_tests/test_orchestration_api.py \
  tests/unit_tests/test_slurm_executor.py \
  tests/unit_tests/test_cli_eval_submit.py \
  tests/unit_tests/test_cli_eval.py \
  tests/unit_tests/test_cli_main.py \
  resources_servers/gdpval/tests/test_multistage_orchestrator.py \
  --override-ini addopts='' -q
../nemo-gym-venv-setup-race/.venv/bin/python -m pre_commit run --all-files
git diff --cached --check

Local generated-shell smoke checks returned 0 for complete standard/GDPVal runs and 1 for incomplete/interrupted runs. Slurm and service startup were substituted locally; the collection entrypoints and completion checks were real. Disabling the check makes the partial-collection regression fail with DID NOT RAISE.

At the current head (51e3ffe0), all five targeted submission/collection cases passed: the default, explicit enablement, explicit opt-out, and partial collection with the check enabled/disabled. The opt-out case failed before the change. Pre-commit checks on all three changed files and git diff --check passed. The earlier full suite was not rerun for this change.

Full CI (core, sandbox, eight server shards) and live Slurm execution were not run locally.

Rollouts

N/A for model rollouts: this changes completion accounting and exit status, not agent or verifier behavior.

Compatibility and benchmark impact

Failure is per submitted benchmark job. Partial metrics remain available, and scoring is unchanged. Submitted drivers need an updated Gym installation. NEL launches bypass Gym submission and must explicitly pass ++require_complete=true to opt in. Custom collection drivers must honor require_complete by calling check_completion with their full expected count; the built-in GDPVal driver does so. Collector cleanup and exit propagation from #3610 remain unchanged.

Checklist

  • Contributing guidelines read; change focused.
  • Relevant tests and pre-commit checks pass as detailed above.
  • Config behavior documented in its field description and method docstring.
  • No new source files or dependencies.
  • All commits have DCO sign-off.

@Glorf Glorf added bug Something isn't working area:orchestration Job submission, deployment, services, and lifecycle management labels Sep 28, 2026
@copy-pr-bot

copy-pr-bot Bot commented Sep 28, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@Glorf
Glorf marked this pull request as ready for review September 28, 2026 15:56
@Glorf

Glorf commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 673e9a4

@Glorf

Glorf commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

/claude review

@claude

claude Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

SHIP WITH CARE — sound change, no blockers.

What this does: adds a require_complete flag (default False, forced True by eval submit) so a submitted eval that didn't produce every expected rollout fails loudly with a retained partial artifact, instead of silently reporting a score over fewer rollouts than were dispatched. Correct direction for a training/eval pipeline — a silently-short score is exactly the corruption the on-call reviewer worries about.

Correctness reviewed and looks right:

  • check_completion de-dupes on (stage_index, task_index, rollout_index) and excludes failure/no-persist rows, so a duplicated row can't paper over a missing repeat. The gdpval test (results.append(results[0]) → still 15/16) verifies exactly that.
  • The gdpval _resume_complete_stage fix is the subtle one and it's correct: num_rollouts for a cached stage now counts from rows_by_task (the materialized truth) rather than len(cached_rows), which can under-count when a stage was marked complete but persisted fewer rows. Without it, expected would be understated and an incomplete resumed run could pass check_completion falsely. The plan[...] → plan[index]/plan["task_ids"] tightening from .get() is fine given a complete stage always has a recorded plan.
  • KeyboardInterrupt path re-raises under require_complete so an interrupted submit is treated as failed, not silently completed.

Coverage: both parametrized branches (require_complete on/off) and the incomplete-resume case are tested end-to-end through the real dispatch/aggregation path; slurm script test asserts +require_complete=True is rendered. Good.

One NOTE left inline re: the interaction between require_complete and count_failure_classes_as_zero — orthogonal by design, but worth a doc line. Author's call.

{
(r.get("stage_index"), r[TASK_INDEX_KEY_NAME], r[ROLLOUT_INDEX_KEY_NAME])
for r in results
if r.get(NG_FAILURE_CLASS_KEY) is None and not r.get(NG_NO_PERSIST_KEY)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: check_completion counts only persisted_results and excludes any row with NG_FAILURE_CLASS_KEY, so count_failure_classes_as_zero rows never count toward completed. WHAT THIS MEANS: because eval submit now forces require_complete=True on every submitted job (slurm_script.py:839), a run that deliberately configures count_failure_classes_as_zero=[agent_run_error] to fold those failures into the score as zeros will still hard-fail with EVAL FAILED: N/M. The test at test_rollout_collection.py:1539 confirms this is intended, but the two flags are orthogonal in a way an operator may not expect: "score these failures as zero" no longer implies "tolerate them." BLAST RADIUS: any submitted eval with a tolerated failure class errors out instead of reporting; partial artifacts are retained. If that's the intended contract, a one-line note in the require_complete field description would save an operator a debugging session.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think those are complimentary, not orthogonal. You can have evaluation with count_failure_classes_as_zero that you sometime deem complete or incomplete. Example: safety benchmarks that use judge model which sometimes might refuse to judge. We're not able to change proxy settings so we might run with require_complete=True first and then turn it off

@yaoyu-33 yaoyu-33 added complexity:medium Single-domain change with interacting parts or a moderate review surface needs-review PR is ready for code review and waiting on a reviewer labels Sep 28, 2026
@Glorf

Glorf commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test df85759

@Glorf

Glorf commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test ef0fe68

@Glorf
Glorf added this pull request to the merge queue Sep 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/36556261090

Merged via the queue into main with commit ae277a8 Sep 29, 2026
41 checks passed
@Glorf
Glorf deleted the mbien/fix/orchestrated-eval-completeness branch September 29, 2026 10:46

This branch was previously deployed

1 inactive deployment
public — ef0fe68c Deployed Sep 29, 2026 by copy-pr-bot[bot] via release / finalize / notify #3883
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:orchestration Job submission, deployment, services, and lifecycle management bug Something isn't working complexity:medium Single-domain change with interacting parts or a moderate review surface needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants