nemo_rl.models.generation.rollout_result#

One rollout’s result and its JSON wire form, for every generation backend.

An engine served through Dynamo sends the result to the driver in engine_data; the vLLM worker builds it with request_pipeline.rollout_result.

Module Contents#

Classes#

RolloutResult

One rollout’s outcome, independent of where its output is assembled.

Functions#

rollout_result_to_wire

JSON-safe form of result, for engines that answer over HTTP.

rollout_result_from_wire

Inverse of :func:rollout_result_to_wire; routes keep their own dtype.

API#

class nemo_rl.models.generation.rollout_result.RolloutResult#

One rollout’s outcome, independent of where its output is assembled.

token_ids: list[int]#

None

logprobs: list[float]#

None

truncated: bool#

None

routed_experts: Optional[torch.Tensor]#

None

r3_stats: Optional[dict[str, int]]#

None

classmethod nothing_generated() → nemo_rl.models.generation.rollout_result.RolloutResult#

The result when no new token fits: the prompt alone, untruncated.

nemo_rl.models.generation.rollout_result.rollout_result_to_wire(
result: nemo_rl.models.generation.rollout_result.RolloutResult,
) → dict[str, Any]#

JSON-safe form of result, for engines that answer over HTTP.

nemo_rl.models.generation.rollout_result.rollout_result_from_wire(
wire: dict[str, Any],
) → nemo_rl.models.generation.rollout_result.RolloutResult#

Inverse of :func:rollout_result_to_wire; routes keep their own dtype.