Repository navigation
fix(rollout_health): see the failed calls and empty turn lists it was skipping - #3427
Conversation
| stays healthy -- the signal is that the rollout ENDED on a failure, which is | ||
| what makes its reward indistinguishable from a genuine zero. | ||
| """ | ||
| calls = _normalized_trajectory_calls(trajectory) |
There was a problem hiding this comment.
These calls also include unowned auxiliary/judge requests. In a local fixture, policy 403 followed by an unrelated auxiliary 200 changes the verdict from unhealthy to unobserved, hiding the policy failure. Could recovery be determined within the same policy/invocation chain instead of across all captured calls?
There was a problem hiding this comment.
@yaoyu-33 Fixed. Calls are now grouped by model_ref and each model's own last
call is judged, so a judge 200 landing after a policy 403 no longer reads as the
policy recovering. One finding per model, naming which.
One thing I could not do as literally asked. Scoping to the policy chain needs
to know which model is the policy, and when every policy call fails there is
nothing that says so - a failed call has no response id, so the trajectory
references nothing, and the schema carries no policy identity otherwise.
|
|
||
| def _ended_on_failed_call(calls: Sequence[dict[str, Any]]) -> bool: | ||
| """Whether the rollout's last observed model call failed.""" | ||
| return bool(calls and _is_failed(calls[-1])) |
There was a problem hiding this comment.
The canonical list is not necessarily chronological. If the producer already contains the successful retry, _build_trajectory_record() merges capture [failed attempt, successful retry] into [successful retry, failed attempt]. I reproduced an unhealthy verdict despite the retry succeeding. Could we resolve execution order before relying on the last element?
|
/ok to test f3b26b5 |
… skipping Two blind spots made a run whose model calls all failed report `0 healthy, 0 unhealthy, N unobserved` with reward 0 -- indistinguishable from a model scoring zero. Measured on a run with an invalid API key: six `403 auth` rows in the capture, nothing flagged. Every per-call check reads bound calls, and binding resolves a reference by `(model_ref, response_id)` or `model_call_id`. A failed call comes back with none of them, so it can never bind. Adds `rollout_ended_on_failed_model_call`, which reads the captured calls directly. Only the last call is judged, so a failure the client retried successfully stays healthy; reading the capture rather than a reference also covers the 45 of 47 agents that publish no trajectory. `turns_unavailable` was appended whenever the turn list was empty, and the AGENT_TURNS gate then skipped `rollout_missing_agent_turns` -- the check exists to catch a rollout with no turns, and was disabled in exactly that case. Now recorded only when no producer published a trajectory at all, so an agent that publishes one and reports no turns produces a finding. Agents that publish nothing stay unobserved as before. Same invalid-key run, before and after: before: 2 checked, 0 healthy, 0 unhealthy, 2 unobserved after: 2 checked, 0 healthy, 2 unhealthy, 0 unobserved Verified on a passing run too, with both a publishing and a non-publishing agent: no verdict changed. Signed-off-by: Wojciech Prazuch <[email protected]>
The digest already computed `bool(calls and _is_failed(calls[-1]))` and reported it as the `ended_on_error` statistic while the verdict stayed unobserved -- the gate knew the rollout ended on a failure and said nothing. The new check repeated that expression; both now call `_ended_on_failed_call`, so the statistic and the finding cannot disagree. Signed-off-by: Wojciech Prazuch <[email protected]>
Two problems with judging the last element of the canonical call list. The list is not chronological: _build_trajectory_record puts producer calls first and appends unmatched capture rows, so a successful retry can precede the attempt it retried and the rollout reads as ending on a failure. Order by started_at instead. A chain that mixes failures and successes and carries no timestamps cannot be ordered, so it produces no finding. The list also spans every model: a judge request landing after a failed policy call read as the policy recovering. Group by model_ref and judge each model's own last call, one finding per model. Signed-off-by: Wojciech Prazuch <[email protected]>
f3b26b5 to
faba34d
Compare
|
/ok to test faba34d |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/36851804703 |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/36999531071 |
A model call that fails and is then retried successfully can still make a rollout unhealthy because `model_call_failed` flags every bound failure. Remove that check and use `rollout_ended_on_failed_model_call` from NVIDIA-NeMo#3427 unchanged. Earlier failures remain in diagnostic counts. Existing ignore settings using `model_call_failed` map to the retained check. Keep the explicit context-overflow exemptions from this follow-up to NVIDIA-NeMo#3761: rejected requests do not trigger missing-token, zero-completion-token, or runaway-generation findings. The vLLM adapter records the rejection category with propagation enabled or disabled; HTTP behavior is unchanged. A final rejection still counts as a failure under the retained check. Its existing per-model semantics apply, including to subagent and auxiliary calls. No separate issue is needed for this focused follow-up. Rewards and benchmark scores are unchanged. Validation: - `python -m pytest tests/unit_tests/test_rollout_health.py responses_api_agents/opencode_agent/tests/test_trajectory.py tests/unit_tests/test_fern_docs_links.py --no-cov -q`: 173 passed, 17 subtests passed. - `python -m pytest responses_api_models/vllm_model/tests/test_app.py -k context_overflow_propagation_flag --no-cov -q`: 4 passed. - `python -m pre_commit run --all-files`: passed. - `cd fern && npm run check`: passed (0 errors, 1 warning). - MiniSWE/Terminus observability tests are delegated to full server CI; the combined local harness test command could not collect because `minisweagent` is not installed in the core environment. - [GitHub CI](https://github.com/NVIDIA-NeMo/Gym/actions/runs/37276179587) on rebased head `0dbbd3772`: passed, including the core coverage gate and all eight server shards. No unresolved CodeRabbit review threads. Live-model rollout: N/A. Changes are limited to postprocessing and captured error metadata; inference and agent execution behavior are unchanged. Signed-off-by: Giulio Lovisotto <[email protected]>
A rollout whose model calls all failed reports
0 healthy, 0 unhealthy, N unobservedand reward 0 — indistinguishable from a model that scored zero. The gate already knew:rollout_health.pycomputesended_on_errorfor the digest and reports it as a statistic, while the verdict staysunobserved.0 healthy, 0 unhealthy, 2 unobserved0 healthy, 2 unhealthy, 0 unobservedTwo independent causes.
Failed calls cannot bind. Every per-call check reads bound calls, and binding resolves a reference by
(model_ref, response_id)ormodel_call_id— a failed call has none of them. Addsrollout_ended_on_failed_model_call, reading the captured calls directly. It shares_ended_on_failed_callwith the existingended_on_errorstatistic, so the two cannot disagree. Reading the capture rather than a reference also covers the 45 of 47 agents that publish no trajectory.Only the last call is judged. The capture records every HTTP attempt, so flagging any failed call would turn ordinary retries unhealthy.
rollout_missing_agent_turnswas skipped when turns were missing.turns_unavailablewas appended whenever the turn list was empty, and the AGENT_TURNS gate then dropped the check. Now recorded only when no producer published a trajectory, so an agent that publishes one and reports no turns produces a finding; agents that publish nothing stay unobserved.Testing
End-to-end
gym eval run, 2 tasks, observability on:0/0/2 unobserved0/2 unhealthy/00/0/2 unobserved0/2 unhealthy/00/0/2 unobserved2 healthy/0/0Also replayed over five stored rollouts from earlier real runs, two of which contain a genuine
error_category: exceptioncall mid-rollout followed by successful calls. Verdicts are byte-identical tomain— the retry tolerance holds on real captured data, not just a fixture.6 unit tests, each mutation-checked: the invariant was broken in the source and the test confirmed to fail.
pre-commit --all-filesclean.tests/unit_tests/has 13 pre-existing sandbox-provider failures, identical on unmodifiedmain.Context
Found while closing the agent-side half in #3403. That PR makes
verifiers_agentpublish the evidence; this one lets the gate act on evidence it already had. They are independent — each is useful alone.Real impact: a 600-task run had 75 failed calls across 61 rollouts, 25 of which ended on error, all reported as ordinary zeros.