ckpt-policy
Version 0.25.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, World, Saves
g = Governor("/ckpt/job-1", world=World(ranks=8), saves=Saves(), start_engine=True)
# ... 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, ["rank-00.bin", "..."])
start_engine=True starts the engine for that directory; close() (or with Governor(...)) stops it.
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.25.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ckpt_policy-0.25.0-py3-none-manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for ckpt_policy-0.25.0-py3-none-manylinux_2_17_x86_64.whl |
Release files / ckpt_policy-0.25.0-py3-none-manylinux_2_17_x86_64.whl
| Download URL | ckpt_policy-0.25.0-py3-none-manylinux_2_17_x86_64.whl |
|---|---|
| Size | 6.3 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
f8696ae83e52b76b65f5e1b169390c45d66110c4deeb656b0c3aae9c2bea0746
|
|
BLAKE2b-256 checksum How to use checksums |
dfdfdbb71031d7e58e61340624e601e9c9dae8429e700185224c186127a2f82b
|
| 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 logSecurity for ckpt-policy 0.25.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.25.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 logA 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.