Skip to content

fix(eval): check metric support before failed rollouts count as zero - #3819

Draft
RainieLLM wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
RainieLLM:codex/guard-imputed-metrics-3593
Draft

RainieLLM wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
RainieLLM:codex/guard-imputed-metrics-3593

Conversation

@RainieLLM

Copy link
Copy Markdown

What does this PR do?

When a failed rollout has no reward, count_failure_classes_as_zero adds a zero for the metrics. The row may lack fields that custom metrics need, so a custom hook can crash or report the wrong score.

This PR checks support before a new or resumed run, and before an offline merge. If custom metrics do not support these rows, the run stops with an error that names the server and option. The metric endpoint also checks marked rows sent directly to it. GDPVal checks all stages before it selects the last one for the base reward stats.

Fixes #3593.

Validation

543 tests and 17 subtests passed:

.venv/bin/python -m pytest \
  tests/unit_tests/test_aggregate_metrics.py \
  tests/unit_tests/test_rollout_collection.py \
  tests/unit_tests/test_reward_profile.py \
  tests/unit_tests/test_base_resources_server.py \
  tests/unit_tests/test_base_responses_api_agent.py \
  tests/unit_tests/test_fern_docs_links.py \
  environment_servers/legacy_agent/tests/test_app.py \
  environment_servers/single_agent_turn/tests/test_app.py \
  environment_servers/single_agent_turn_legacy/tests/test_app.py \
  responses_api_agents/simple_agent/tests/test_app.py \
  resources_servers/gdpval/tests/test_app.py \
  --import-mode=importlib --override-ini addopts='' -q

pre-commit run --all-files and git diff --check passed. npm run check in fern/ reported zero errors and one warning.

Tests cover real zero scores, added zeros, custom metric support, and checks before a run or merge. They also check that a rejected run leaves existing files unchanged. An ASGI test confirms that the error reaches the caller through the environment, Simple Agent, and ASR servers. Eight tests fail as expected when the new check is disabled.

The full CI suite was not run locally.

Rollouts

N/A. This change checks metric support before execution. Model calls, agent behavior, and score formulas stay the same. Tests use local servers and fixed data, so no model run was needed.

Compatibility and benchmark impact

The option stays off by default. Default reward statistics still accept added zeros. Custom benchmarks must define and test how each metric handles these rows before they set supports_imputed_zero_rewards = True.

A failed row with a real reward keeps its value. Added zeros and their marker are used only for metrics; they are never saved to rollout or failure files. With disable_aggregation=True, Gym skips the check during rollout collection and runs it when you use gym eval aggregate.

Suggested labels: bug, area:evaluation, needs-review.

Checklist

  • I have read the contributing guidelines.
  • The change is focused.
  • The tests above pass locally.
  • Documentation is updated.
  • Pre-commit checks pass locally.
  • No new source files or dependencies.
  • All commits have DCO sign-off.

@copy-pr-bot

copy-pr-bot Bot commented Sep 30, 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.

@nemo-automation-bot nemo-automation-bot Bot added the community-request Issue reported or requested by someone from the community label Sep 30, 2026
@yaoyu-33 yaoyu-33 added area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters bug Something isn't working complexity:high Cross-component or shared-contract change with a large review surface needs-review PR is ready for code review and waiting on a reviewer labels Sep 30, 2026
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 1, 2026

@yaoyu-33 yaoyu-33 left a comment

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.

LGTM.

@yaoyu-33 yaoyu-33 added ready-to-merge PR is approved, current, and waiting for final CI or merge and removed needs-review PR is ready for code review and waiting on a reviewer labels Oct 2, 2026
@github-actions github-actions Bot removed the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 2, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added the waiting-on-customer Waiting on the original author to respond label Oct 2, 2026
@yaoyu-33 yaoyu-33 removed the ready-to-merge PR is approved, current, and waiting for final CI or merge label Oct 2, 2026
@svcnvidia-nemo-ci svcnvidia-nemo-ci added waiting-on-maintainers Waiting on maintainers to respond and removed waiting-on-customer Waiting on the original author to respond labels Oct 4, 2026
@yaoyu-33
yaoyu-33 marked this pull request as draft November 18, 2026 01:56
@yaoyu-33

Copy link
Copy Markdown
Contributor

We’re doing some cleanup of the open PR list. This PR has had no activity for over a month, so I’ve moved it back to draft.

If this change is still needed, please resolve any merge conflicts and mark the PR ready for review again when it’s ready to merge. Thanks!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:evaluation Evaluation, rollout collection, reward profiling, comparison, and exporters bug Something isn't working community-request Issue reported or requested by someone from the community complexity:high Cross-component or shared-contract change with a large review surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mputed zero rows crash some metric hooks and are silently scored by others

3 participants