Skip to navigation

nemo_gym.rollouts.rollout_outcomes

View as Markdown

Shared failure record for evaluation collectors and other run owners.

Module Contents

Classes

NameDescription
InvalidRolloutResultAn agent returned a body that cannot represent a completed result.
RolloutFailureRecordAssociate one observed failure with a run and an episode attempt.
StaleRolloutResultA response from another attempt may be transient after a transport retry.

Data

RolloutFailure

API

class nemo_gym.rollouts.rollout_outcomes.InvalidRolloutResult()

Bases: ValueError

An agent returned a body that cannot represent a completed result.

class nemo_gym.rollouts.rollout_outcomes.RolloutFailureRecord()

Bases: BaseModel

Associate one observed failure with a run and an episode attempt.

source identifies who reported the failure, not where it happened: collector is rollout collection recording what it observed, and the failure’s own events carry the causal FailureBoundary (a collector record can name a model, agent or collection boundary). delivery describes the collector’s evidence about delivery to the Environment Server: not_sent requires evidence that the request was not sent, possibly_delivered covers an uncertain outcome, and delivered means delivery was established. It does not promise exactly-once execution or authorize transport replay. A failure reported by the Environment Server requires delivery="delivered".

The nested failure uses the wire contract, not a second set of reason/stage fields. Protocol-specific diagnostics, partial responses, and training data belong outside this record. No reward is inferred from a failure. Persistence, conversion from legacy markers, and retry budgets belong to the caller.

schema_version identifies the entire saved record, including nested contracts. Missing versions are treated as version 1 for pre-version records. Changes that older readers cannot parse (including added fields) require a version bump. Readers reject unsupported versions and unknown fields; callers must report an incompatible record or explicitly migrate it, never silently drop fields or reinterpret it as a completed rollout.

delivery
Literal['not_sent', 'possibly_delivered', 'delivered']
episode_id
EpisodeId
exception_type
str | None = Field(default=None, max_length=2000)
failure
EpisodeFailure
http_status
int | None = Field(default=None, ge=100, le=599)
model_config
= ConfigDict(extra='forbid', frozen=True)
run_id
str = Field(min_length=1)
schema_version
Literal[1] = 1
sidecar_failure_class
str

Route unclassified failures without inventing a canonical failure kind.

source
Literal['environment', 'collector']
nemo_gym.rollouts.rollout_outcomes.RolloutFailureRecord.validate_delivery() -> typing_extensions.Self

Require established delivery for failures reported by the environment.

class nemo_gym.rollouts.rollout_outcomes.StaleRolloutResult()

Bases: InvalidRolloutResult

A response from another attempt may be transient after a transport retry.

nemo_gym.rollouts.rollout_outcomes.RolloutFailure = RolloutFailureRecord