nemo_rl.models.generation.prefix_recovery.progress#
The backend-specific seam: reading how far each live call has decoded.
Module Contents#
Classes#
One call’s generated tokens past a cut’s start, read at an output boundary. |
|
Progress per model call ID, and how long the read held the engine up. |
|
Reads every named call’s new tokens at one engine output boundary. |
API#
- class nemo_rl.models.generation.prefix_recovery.progress.GenerationProgress#
One call’s generated tokens past a cut’s start, read at an output boundary.
logprobsis the engine’s own append-only container; positions up tostart + len(token_ids)were published when the tokens were copied.- token_ids: list[int]#
None
- logprobs: Any#
None
- finish_reason: str | None#
None
- stop_reason: str | int | None#
None
- route_pieces: list[Any] | None#
None
- class nemo_rl.models.generation.prefix_recovery.progress.ProgressRead#
Progress per model call ID, and how long the read held the engine up.
A call the engine does not hold (not yet submitted, aborted, or not a single engine request) is missing from
progress.- progress: collections.abc.Mapping[str, nemo_rl.models.generation.prefix_recovery.progress.GenerationProgress]#
None
- wait_seconds: float#
None
- hold_seconds: float#
None
- class nemo_rl.models.generation.prefix_recovery.progress.ProgressReader#
Bases:
typing.ProtocolReads every named call’s new tokens at one engine output boundary.
- read(
- calls: collections.abc.Sequence[tuple[str, int]],
- *,
- timeout_s: float | None,
- route_calls: frozenset[str] = frozenset(),
Read
(model_call_id, start)calls; raise TimeoutError pasttimeout_s.Calls named in
route_callsalso get their route pieces copied.
- logprobs(
- token_ids: collections.abc.Sequence[int],
- logprobs: Any,
- *,
- start: int,
The sampled log probability of each token, from the engine’s container.
Raises RuntimeError, TypeError or ValueError when they do not line up.