nemo_rl.algorithms.single_controller_utils.rollout_checkpoint#
Filesystem contract for frequent Single Controller rollout snapshots.
Module Contents#
Classes#
Identity binding one rollout-state cut to reconstructable trainer state. |
|
A committed rollout snapshot selected for startup recovery. |
|
Rollout-semantic inputs that must match a trainer-version-zero cut. |
Functions#
Return whether one segmented dotpath pattern matches a concrete path. |
|
Recursively remove denylisted mapping paths from a JSON config dump. |
|
Flush one completed regular file to its backing filesystem. |
|
Flush directory-entry updates such as rename and replace. |
|
Flush every snapshot payload before publishing its directory. |
|
Remove explicitly operational paths from the fail-closed run identity. |
|
Hash rollout-semantic inputs needed to reuse a bootstrap snapshot. |
|
Format one redacted compatibility value without flooding an error. |
|
Describe changed compatibility leaves using user-facing dotpaths. |
|
Build the bootstrap manifest from one self-consistent identity. |
|
Remove trainer-version-zero snapshots once a trainer checkpoint exists. |
|
Create or validate the lightweight trainer-version-zero anchor. |
|
Validate a bootstrap anchor without modifying checkpoint state. |
|
Allocate the next temporary/final snapshot directory pair. |
|
Atomically publish one validated snapshot and retain recent fallbacks. |
|
Select the newest complete snapshot compatible with its trainer anchor. |
Data#
API#
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.ROLLOUT_SNAPSHOT_SCHEMA_VERSION#
3
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.BOOTSTRAP_COMPATIBILITY_SCHEMA_VERSION#
7
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.BOOTSTRAP_DIRNAME#
‘bootstrap’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.BOOTSTRAP_MANIFEST_FILENAME#
‘manifest.json’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.ROLLOUT_SNAPSHOTS_DIRNAME#
‘rollout_snapshots’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.ROLLOUT_SNAPSHOT_MANIFEST_FILENAME#
‘manifest.json’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.RolloutCheckpointAttemptOutcome#
None
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.ROLLOUT_CHECKPOINT_ATTEMPT_OUTCOMES: tuple[nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.RolloutCheckpointAttemptOutcome, ...]#
‘get_args(…)’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.RolloutCheckpointAttemptReason#
None
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.ROLLOUT_CHECKPOINT_ATTEMPT_REASONS: tuple[nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.RolloutCheckpointAttemptReason, ...]#
‘get_args(…)’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._SNAPSHOT_RE#
‘compile(…)’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._TMP_SNAPSHOT_RE#
‘compile(…)’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._TRASH_SNAPSHOT_RE#
‘compile(…)’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._BOOTSTRAP_FINGERPRINT_EXCLUDED_PATHS#
‘frozenset(…)’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._path_matches(pattern: tuple[str, ...], path: tuple[str, ...]) bool#
Return whether one segmented dotpath pattern matches a concrete path.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._drop_excluded_paths(
- value: Any,
- *,
- excluded_paths: tuple[tuple[str, ...], ...],
- path: tuple[str, ...] = (),
Recursively remove denylisted mapping paths from a JSON config dump.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._fsync_file(path: pathlib.Path) None#
Flush one completed regular file to its backing filesystem.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._fsync_directory(path: pathlib.Path) None#
Flush directory-entry updates such as rename and replace.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._fsync_tree(root: pathlib.Path) None#
Flush every snapshot payload before publishing its directory.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._snapshot_sequence(path: pathlib.Path) int#
- class nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.RolloutSnapshotManifest#
Identity binding one rollout-state cut to reconstructable trainer state.
- schema_version: int#
None
- base_train_step: int#
None
- trainer_version: int#
None
- current_epoch: int#
None
- sampler_dispatch_index: int#
None
- mutation_version: int#
None
- rolled_back_train_group_count: int#
None
- bootstrap_fingerprint: Optional[str]#
None
- classmethod from_mapping(
- raw: Mapping[str, Any],
Parse and validate a committed snapshot manifest.
- to_dict() dict[str, Any]#
- class nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.ResolvedRolloutCheckpoint#
A committed rollout snapshot selected for startup recovery.
- path: pathlib.Path#
None
- class nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.BootstrapCompatibilityIdentity#
Rollout-semantic inputs that must match a trainer-version-zero cut.
- schema_version: int#
None
- excluded_paths: tuple[str, ...]#
None
- config: Mapping[str, Any]#
None
- to_dict() dict[str, Any]#
- fingerprint() str#
Return the canonical digest stored in snapshot manifests.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.bootstrap_compatibility_identity(
- master_config: nemo_rl.algorithms.single_controller_utils.config.MasterConfig,
Remove explicitly operational paths from the fail-closed run identity.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.bootstrap_fingerprint(
- master_config: nemo_rl.algorithms.single_controller_utils.config.MasterConfig,
Hash rollout-semantic inputs needed to reuse a bootstrap snapshot.
This is a compatibility guard, not a hash of the full training recipe. Operational settings are deliberately excluded so a restart may use a different cluster shape, checkpoint interval, or logging destination.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._MISSING#
‘object(…)’
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._format_changed_value(value: Any) str#
Format one redacted compatibility value without flooding an error.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._compatibility_differences(
- checkpoint: Any,
- expected: Any,
- *,
- path: tuple[str, ...] = (),
Describe changed compatibility leaves using user-facing dotpaths.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint._bootstrap_anchor_manifest(
- identity: nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.BootstrapCompatibilityIdentity,
Build the bootstrap manifest from one self-consistent identity.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.prune_bootstrap_snapshots(
- checkpoint_dir: pathlib.Path,
- *,
- durable_trainer_checkpoint: pathlib.Path,
Remove trainer-version-zero snapshots once a trainer checkpoint exists.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.ensure_bootstrap_anchor(
- checkpoint_dir: pathlib.Path,
- *,
- identity: nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.BootstrapCompatibilityIdentity,
Create or validate the lightweight trainer-version-zero anchor.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.validate_bootstrap_anchor(
- anchor: pathlib.Path,
- *,
- identity: nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.BootstrapCompatibilityIdentity,
Validate a bootstrap anchor without modifying checkpoint state.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.prepare_snapshot_paths(
- anchor: pathlib.Path,
Allocate the next temporary/final snapshot directory pair.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.commit_snapshot(
- tmp_path: pathlib.Path,
- final_path: pathlib.Path,
- *,
- keep_latest_k: int,
Atomically publish one validated snapshot and retain recent fallbacks.
- nemo_rl.algorithms.single_controller_utils.rollout_checkpoint.resolve_latest_snapshot(
- anchor: pathlib.Path,
- *,
- expected_train_step: int,
- expected_trainer_version: int,
- expected_bootstrap_fingerprint: Optional[str],
Select the newest complete snapshot compatible with its trainer anchor.