Skip to content

feat(eval): add gym eval reverify to recompute rewards from stored ro…#2078

Open
mpatel31415 wants to merge 30 commits into
mainfrom
mpatelka/compute-reward-from-existing-rollouts
Open

feat(eval): add gym eval reverify to recompute rewards from stored ro…#2078
mpatel31415 wants to merge 30 commits into
mainfrom
mpatelka/compute-reward-from-existing-rollouts

Conversation

@mpatel31415

@mpatel31415 mpatel31415 commented Jul 19, 2026

Copy link
Copy Markdown

What & why

Adds gym eval reverify — recompute rewards from collected rollouts by re-running only the verifier, no model or agent inference. Use it when you change a verifier (grading mode, threshold, judge prompt) and want fresh rewards on existing rollouts, or to compare verifier configs on the same rollouts without sampling noise.

How it works

Pairs each rollout with its materialized input on (_ng_task_index, _ng_rollout_index) and POSTs input_row | {"response": ...} to the server's /verify — no /seed_session, no session cookie. Writes recomputed-reward rows, a <output>_failures.jsonl sidecar, and (unless --disable-aggregation) <output>_aggregate_metrics.json.

Safety: REVERIFY_MODE

Replaying /verify against a fresh session is only correct when the reward is a pure function of request body + config. New ReverifyMode enum (STATELESS / UNSUPPORTED) as a REVERIFY_MODE ClassVar on BaseResourcesServerConfig (default UNSUPPORTED), served at GET /reverify_mode. Reverify queries it per server and refuses on UNSUPPORTED (reward depends on gone session state → silently wrong); --force overrides and prefixes outputs unsafe_. Servers opt in with REVERIFY_MODE: ClassVar[ReverifyMode] = ReverifyMode.STATELESS.

…llouts

Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 19, 2026

Copy link
Copy Markdown

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.

@github-actions

Copy link
Copy Markdown

mpatel31415 and others added 10 commits July 19, 2026 23:41
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
…reward-from-existing-rollouts' into mpatelka/compute-reward-from-existing-rollouts

Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
…he code

Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Jul 21, 2026
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
Comment thread nemo_gym/path_utils.py
from pathlib import Path


def failures_path_for(output_fpath: Path) -> Path:

@mpatel31415 mpatel31415 Jul 23, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This file has only single function. I hope it's fine, since I was not able to find a better place for it. Maybe rollout_common if we decide to add it. (but actually it's used also in resources_servers/gdpval/tests/test_multistage_orchestrator.py so I'd keep it here)

Signed-off-by: Martyna Patelka <mpatelka@nvidia.com>
mpatel31415

This comment was marked as low quality.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can you recompute reward using existing rollout and a new verifier?

2 participants