Skip to main content

ckpt-policy

Version 0.28.0 — the same number as the release tag (decision 0029).

The training loop's half of the contract: one install, three lines, no runtime dependencies, and the shards stay with whatever library you already use.

pip install ckpt-policy        # manylinux x86_64; the engine is inside the wheel

From a checkout, the same wheel:

make wheel                     # from the repository root: the wheel carries the Go engine
python3 -m pip install dist/wheels/ckpt_policy-*.whl
from ckpt_policy import Governor

g = Governor("/ckpt/job-1", start_engine=True)   # torchrun's RANK/WORLD_SIZE are read

# ... load the latest checkpoint, then say what you adopted (one call)
g.resumed(gen=7, step=512, seconds=load_seconds)

for step, batch in loader:
    g.step(step)
    if g.should_save():               # the plan asked; the whole write side, one line
        gen = g.generation()          # write into gen-<gen>/, with your library
        g.sealed(gen, step, [f"rank{r}.pt" for r in range(g.world.ranks)])

start_engine=True starts the engine for that directory on rank 0; close() (or with Governor(...)) stops it. Several ranks: docs/multi-rank.md, and the runnable examples/two_ranks.py. If the engine dies, the plan ages out and should_save() answers false — the caller's fallback is the end-of-training write and the announced stop. The decision stays in Go; this package does not re-implement it.

To see the two arms without Go on PATH:

python -m ckpt_policy.demo

What it writes, and what it never writes

we write you write
step, step-rate, stopping, seconds-left, ending the shards of a checkpoint
manifest.json (sizes and hashes of your shards) —
resume.json (what a restore would get) —
resumed-generation, resumed-step, load-seconds —

A shard is never written, repaired or deleted by this package: governed.sealed() only reads the files your save() left and records what they claim (decision 0025).

resumed() is the one call people forget

Without it, a job that came back and started at step 0 looks exactly like a job that resumed, and the ckptctl resumed verdict can only say not adopted: step 3, newest sealed 512. With it, the receipt says adopted gen 7 (step 512), load 9.1s (decision 0026).

Tests

Standard library only:

python3 -m unittest discover -s contrib/ckpt-policy/tests -q

torch appears only in examples/, because that example has to be a real training loop to be worth reading.

Metadata

Release files for ckpt-policy 0.28.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ckpt-policy 0.28.0
File Interpreter ABI Platform Actions
ckpt_policy-0.28.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for ckpt_policy-0.28.0-py3-none-manylinux_2_17_x86_64.whl

Release files / ckpt_policy-0.28.0-py3-none-manylinux_2_17_x86_64.whl

Download URL ckpt_policy-0.28.0-py3-none-manylinux_2_17_x86_64.whl
Size 6.5 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
94c4fb0d25740c7792ba75588db086016c8dceb9746d7e5013e4e22d6a360c9f
BLAKE2b-256 checksum
How to use checksums
e63d788f7f0ba31ea88967f6a621d232d269501373c249be4715b25db842f6e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for ckpt-policy 0.28.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for ckpt_policy-0.28.0-py3-none-manylinux_2_17_x86_64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page