Skip to content

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

Merged
ritaneves merged 41 commits into
mainfrom
mpatelka/compute-reward-from-existing-rollouts
Jul 29, 2026
Merged

ritaneves merged 41 commits into
mainfrom
mpatelka/compute-reward-from-existing-rollouts

Conversation

@mpatel31415

@mpatel31415 mpatel31415 commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

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.

@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 github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Jul 21, 2026
mpatel31415

This comment was marked as low quality.

@marta-sd
marta-sd requested a review from lbliii July 24, 2026 08:48
@ritaneves
ritaneves requested a review from e-dobrowolska July 27, 2026 08:35
@github-actions github-actions Bot added the sla:review-overdue Review response is over the one-business-day SLA label Jul 27, 2026
mpatel31415 and others added 3 commits July 27, 2026 13:39
…reward-from-existing-rollouts' into mpatelka/compute-reward-from-existing-rollouts

Signed-off-by: Martyna Patelka <[email protected]>
Comment thread nemo_gym/rollout_reverification.py Outdated


def _agent_to_rs_mapping_from_agent_blocks(
global_conflict_dict: Union[Dict[str, Any], "DictConfig"],

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.

is global_conflict_dict instead of global_config_dict here intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no, good call, fixed

@e-dobrowolska

Copy link
Copy Markdown
Contributor

Have you tested the resources-server-only scenario? Will it work well and respect the stateless/unsupported/unknown mode safety checks?

Comment on lines +115 to +120
Before starting, `gym eval reverify` calls `GET /reverify_mode` on each resources server it will use. Servers report one of two modes:

| Mode | Meaning |
| --- | --- |
| `stateless` | Reverification is safe. The verifier is a pure function of `(request body, server config)`. This is the default for most resources servers. |
| `unsupported` | Reverification is not safe. The verifier reads per-rollout session state that was seeded during the original run and is no longer present. Results would be silently wrong. |

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.

Aren't there three values? Stateless, unsupported, unknown

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, I forgot to change the documentation, fixed


| Mode | Meaning |
| --- | --- |
| `stateless` | Reverification is safe. The verifier is a pure function of `(request body, server config)`. This is the default for most resources servers. |

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.

Isn't the default unknown currently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, I forgot to change the documentation, fixed

@copy-pr-bot

copy-pr-bot Bot commented Jul 29, 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.

Signed-off-by: Rita Fernandes Neves <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sla:review-overdue Review response is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants