nemo_automodel.components.checkpoint.lifecycle
nemo_automodel.components.checkpoint.lifecycle
Checkpoint directory publication and retention lifecycle.
Module Contents
Classes
Data
API
Own checkpoint reservation, publication, pointers, and retention.
The lifecycle is built with the same process group as its Checkpointer.
Filesystem work runs on that group’s rank 0 and failures are reduced over the
same participants, so every participating rank either continues or raises.
Parameters:
Declarative checkpoint configuration.
Optional model-local group participating in checkpointing.
Return whether any checkpoint process-group participant reported a condition.
Synchronize checkpoint participants when distributed is initialized.
Initialize best-metric state from the current complete LOWEST_VAL target.
Return whether this rank coordinates lifecycle filesystem work.
Prune checkpoint directories according to the configured recent window.
Advance LATEST and commit a filesystem checkpoint’s marker.
Remove a checkpoint pointer symlink and fallback text file.
Remove a checkpoint pointer whose target no longer exists.
Update LOWEST_VAL when a finite validation metric improves.
Atomically update a checkpoint-root pointer.
Publish a completed async checkpoint and apply pointer retention.
Record an async checkpoint for publication after its writes complete.
Parameters:
Checkpoint directory being written asynchronously.
Optional validation value eligible for LOWEST_VAL.
Validation metric key stored in checkpoint loss metadata.
Publish a synchronous checkpoint, update pointers, and apply retention.
Parameters:
Fully written checkpoint directory.
Optional validation value eligible for LOWEST_VAL.
Validation metric key stored in checkpoint loss metadata.
Reserve path for a save, replacing only an interrupted checkpoint.
Local checkpoint directories are created under a marked staging name and
atomically renamed into place. An existing marked directory can be
replaced, while an unmarked published checkpoint is never overwritten.
msc:// roots retain their existing local recipe-metadata shadow but do
not use filesystem lifecycle markers.
Parameters:
Checkpoint directory for the current step.
Raises:
FileExistsError: Ifpathalready holds a published checkpoint.RuntimeError: If the directory could not be prepared.
Run one coordinator operation and report any failure to all participants.
Parameters:
Work to run on process-group rank 0.
Step name used for logging and collective error reporting.
Raises:
RuntimeError: If the coordinator could not complete the operation.
Validate a resolved restore directory collectively.
Parameters:
Resolved checkpoint directory.
User-provided restore selector.
Raises:
FileNotFoundError: Ifckpt_dirdoes not exist.
Best-checkpoint pointer update deferred until an async save completes.