Checkpoints
A checkpoint_dir is managed by a manifest.json. Reading that manifest tells
a caller which checkpoints can be resumed from. The tier rules are under
Parameter tiers and resuming.
| Name | Summary |
|---|---|
kd.load_checkpoint_manifest(directory) |
Load + fully verify a directory's manifest, returning entries in order. |
kd.CheckpointManifestEntry(filename, kind[, ...]) |
A frozen, JSON-safe manifest entry (kd-ckptman-v1). |
kd.CheckpointManifestError |
Raised on any kd-ckptman-v1 manifest contract violation. |
kd.KIND_FINAL |
— |
kd.FINAL_STATUS_COMPLETED |
— |
kd.resolve_checkpoint(checkpoint_dir, iteration) |
The archive under checkpoint_dir for iteration (the latest when None). |
kd.eligible_checkpoint_iterations(checkpoint_dir) |
The iterations that can be resumed from checkpoint_dir, ascending, unique. |
kd.ResolvedCheckpoint(path, iteration) |
The archive file a segment restores and the iteration it holds. |
kd.CheckpointSelectionError |
No eligible archive answers the request. |
load_checkpoint_manifest
load_checkpoint_manifest(
directory: str | Path,
) -> tuple[CheckpointManifestEntry, ...]
Load + fully verify a directory's manifest, returning entries in order.
CheckpointManifestEntry
dataclass
A frozen, JSON-safe manifest entry (kd-ckptman-v1).
from_dict
classmethod
from_dict(data: object) -> CheckpointManifestEntry
Strictly reconstruct an entry, rejecting any wire drift.
to_dict
to_dict() -> dict[str, Any]
Return a JSON-safe dict, iterating the frozen scheme key table.
CheckpointManifestError
Bases: RecordSchemaError
Raised on any kd-ckptman-v1 manifest contract violation.
KIND_FINAL
module-attribute
KIND_FINAL: Final[str] = 'final'
FINAL_STATUS_COMPLETED
module-attribute
FINAL_STATUS_COMPLETED: Final[str] = 'completed'
resolve_checkpoint
resolve_checkpoint(
checkpoint_dir: Path | str, iteration: int | None = None
) -> ResolvedCheckpoint
The archive under checkpoint_dir for iteration (the latest when None).
eligible_checkpoint_iterations
eligible_checkpoint_iterations(
checkpoint_dir: Path | str,
) -> tuple[int, ...]
The iterations that can be resumed from checkpoint_dir, ascending, unique.
ResolvedCheckpoint
dataclass
The archive file a segment restores and the iteration it holds.
CheckpointSelectionError
Bases: ValueError
No eligible archive answers the request.