nemo_gym.health.checks
nemo_gym.health.checks
Artifact normalization and single-rollout health checks.
Module Contents
Functions
Data
API
Normalize canonical TrajectoryTurn records for structural checks.
Bind turn-only and turn-or-invocation references with shared indexes and resolutions.
Whether this model’s own last call, in time, failed.
Per model rather than across every captured call: a judge or auxiliary request landing after a failed policy call would otherwise read as the rollout recovering, and hide the failure.
Without timestamps a multi-call chain cannot be ordered — call_index is
the position in the merged trajectory list, so a producer-supplied retry
can precede the attempt it retried. Say nothing rather than call a
recovered rollout unhealthy.
Whether any model’s own last call failed.
Exclude only explicit upstream context rejections, never inferred empty generations.
A failed model call that returned no finished response, so it has no usage to account for.
Covers HTTP error replies and calls cut by a cancellation or timeout. This does not mean
nothing was generated: the server may have spent tokens on a cut call, and a cut stream may
have delivered part of its output first. Gym cannot tell which from the capture (the first
streamed event can arrive before any token), so these calls are skipped rather than guessed
at; run.stats.model_call_errors.usage_unknown counts them. Whether the rollout recovered is
rollout_ended_on_failed_model_call’s question.
A failed call that did finish (it has a finish reason) keeps the token checks, as does a body capture could not parse, which is a capture defect rather than a failed call.
Return usable model-call references from turns or invocations.
Group calls by the model they went to.
Flag a model whose own last call in the rollout failed.
The bound-call checks cannot see this: binding resolves a reference by
(model_ref, response_id) or model_call_id, and a call that failed came
back with none of them, so it is absent from matched_calls no matter what
the producer claims. Reading the captured calls directly also covers the
agents that publish no trajectory at all.
Judged per model and in time order — see _chain_ended_on_failure. Only
the chain’s last call counts, so a failure the client retried successfully
stays healthy; the signal is that the rollout ENDED on a failure, which is
what makes its reward indistinguishable from a genuine zero.
Normalize and validate check IDs supplied by library, CLI, or Hydra config.