nemo_gym.rollouts.rollout_store
nemo_gym.rollouts.rollout_store
Persist evaluation outcomes and reserve execution identities for its controller.
The controller holds run_lock across preparation, optional checkpoint restoration, collection and reporting. Results and sidecars contain outcomes; the manifest owns execution numbers. There is no dispatch journal or second outcome commit.
Module Contents
Classes
Functions
Data
API
Saved outcomes shared by the evaluation controller and offline readers.
Every rollout’s attempt cap: the saved max_rollout_attempts plus the recorded extension.
Attempts an explicit recovery added to every rollout’s saved cap (--extend-attempts).
Durably admit a judge-only re-judgment of the selected judge failure before its judge call.
The caller holds run_lock. Only the manifest changes: the failure stays selected with its debit, and no model
attempt is reserved. failure may also be a selected saved result whose grading is re-verified from its
saved answer: a failed re-verification of it saves nothing, so it spends no failure attempt and needs none.
Durably reserve the next execution number before dispatch or restore.
The controller passes the returned number to checkpoint restore; restore must not increment it. A failed restore reserves a new number before a fresh execution. Reservations do not consume the failure retry budget.
Reserve one admitted batch atomically before any of its requests start.
Return the row that would settle failure (None when already saved); raise when it cannot settle it.
Close an admission once the selected outcome carries its operation id (the outcome is already fsynced).
Return the newest allocated attempt’s disposition for this rollout.
Export saved failure totals with current outcome selection and retry budgets.
Failed-attempt totals retain history across resubmissions. Budget exhaustion uses only eligible failures since the most recent reset and the manifest’s saved cap, rather than the exporting process’s configuration.
Latest failure payloads, including terminal skips classified as omitted.
Load a managed run so judge-only re-judgments can settle its judge failures; the caller holds run_lock.
Select unfinished work, retaining the saved timeout policy unless explicitly changed.
The controller holds the writer lock while updating a run’s policy. A read-only store can preview an explicit override without changing files.
Read selected outcomes without modifying files or acquiring a writer lock.
Managed runs use their saved timeout policy. retry_terminal_timeouts
applies only to legacy artifacts without a manifest. skip_keys (see RolloutRecords.load) is for a
selection that reads no trajectory: its records read back without those values.
Reserve once for this controller’s request; no dispatch event is stored.
Reserve requests admitted together with one durable manifest write.
Save intentional omissions separately from scored results and failures.
Append the outcome once; a complete JSONL row is the recovery record.
Settle the selected judge failure failure with its re-judged result for the same attempt.
The result keeps the failure’s run, rollout and attempt identity and its saved answer, so no model attempt is added and the failure stays in the sidecar with its debit. Returns False when that settlement is already saved.
Save record_omitted_rollouts evidence for a row the dispatch budget never started.
It is not an outcome: the history skips it on load, and resume still runs the rollout.
The logical rollouts this Store would run again under some attempt cap: its replay rule without the cap.
A recovery that asks for more attempts reads which exhausted rollouts the extension would make pending.
The logical rollouts whose selected result is a masked one an operator approved to run again
(--rerun-masked-without-artifact): each counts one failed attempt and a later attempt supersedes it.
Load selected payloads; use selected_records for metadata-only access.
Map selected rollout/attempt identities to their original file slices.
Prepare or validate a run while its controller holds the run lock.
Identities with an admitted re-judgment whose outcome is not saved: whether its judge ran is unknown.
Withdraw the admission of a saved result’s re-verification that answered without a grade.
The verifier answered, so its outcome is known; nothing is saved and the saved result stays selected as it
was. Only a saved-result admission can be withdrawn: a judge failure’s re-judgment saves its failed outcome.
With unsaved_judge_failure the caller saves no outcome for this judge failure’s re-judgment (its verifier
answered without a grade or a judge failure, or its pass raised before it answered), so its admission is
withdrawn too: the failure stays selected, and a later pass judges its saved answer again.
Measure the persisted outcome bytes, including their JSONL newline.
Whether an existing row-oriented reader can read this run without filtering.
A manifest alone does not require a different reader. Superseded rows, including answers superseded by interrupted attempts, do. Validate the whole run, but compare only the artifacts the caller actually reads when supplied.