Checkpointing

Divi provides checkpointing support for saving and resuming optimization state. CheckpointConfig controls where and how often state is written; CheckpointInfo describes a single checkpoint on disk.

divi.qprog.checkpointing Module

Functions

cleanup_old_checkpoints(main_dir, keep_last_n)

Remove old checkpoints, keeping only the most recent N.

get_checkpoint_info(checkpoint_path)

Get information about a checkpoint.

get_latest_checkpoint(main_dir)

Get the path to the latest checkpoint.

list_checkpoints(main_dir)

List all checkpoints in a main checkpoint directory.

resolve_checkpoint_path(main_dir[, subdirectory])

Resolve the path to a checkpoint subdirectory.

Classes

CheckpointConfig([checkpoint_dir, ...])

Configuration for checkpointing during optimization.

CheckpointCorruptedError(message[, ...])

Raised when a checkpoint file is corrupted or invalid.

CheckpointError

Base exception for checkpoint-related errors.

CheckpointInfo(path, iteration, timestamp, ...)

Information about a checkpoint.

CheckpointNotFoundError(message[, main_dir, ...])

Raised when a checkpoint directory or file is not found.