torch_checkpointing
High-performance asynchronous checkpointing for PyTorch. It takes checkpoint saving off your training loop's critical path:
- Zero-overhead saves —
save()returns immediately; model state is staged off the training device and written by a background process while your training step keeps running. - Save and load through one API — a single
CheckpointManagerdrives both; you pass plain{name: value}dicts and decide when to block on a save (for example, before exit). - Single-rank to distributed — the same API scales from one process to large distributed jobs, and reshards across different parallelism layouts on load.
You interact with one object, CheckpointManager: save(checkpoint_id, {...})
and load(checkpoint_id, into={...}) over a pluggable storage backend. A
checkpoint_id is a string interpreted by that backend; the default local
filesystem backend treats it as the path to a checkpoint directory. Rank,
storage, sharding metadata, and per-item copy/reshard behavior are configured
for you. Power users can still swap in bespoke components — storage backends,
resharders, cross-rank coordination — through the
extension points.
Experimental and pre-1.0. The public API may still change.
Installation
pip install torch_checkpointing
Requires Python >= 3.10 and torch >= 2.6.
Saving is asynchronous by default. The optimized async staging defaults currently require CUDA; CPU-only users should use the explicit configuration in Troubleshooting.
Key features
- Non-blocking async saves overlapped with training (host-side staging + a background-process write).
- One high-level
CheckpointManagerfor both save and load, with auto-detected rank, storage, and metadata. - Plain-dict payloads:
save(id, {...})/load(id, into={...})— tensors restored in place (identity preserved), scalars and JSON/bytes are first-class top-level items. - Resharding on load across different distributed layouts (mesh / placement changes), wired automatically when an item declares a resharder.
- Pluggable storage behind the
Storage/StorageConfiginterface; a local filesystem backend ships in the package.
Documentation
Getting started
- Tutorial — checkpoint and resume a complete training loop.
- Overview — what the library does and how the pieces fit together.
- Key concepts — the
CheckpointManager, the payload/into=model, and how async save and load work. - Configuring checkpoints — per-item
layout,requires_copy, andresharderviaItemSpec. - Troubleshooting & FAQ — common errors and how to fix them.
- API reference — the public symbols at a glance.
Building bespoke components (power users)
- Extensibility — the extension points, and how to plug in your own infrastructure.
- Storage — the
Storage/StorageConfiginterface and writing a custom backend. - Distributed and resharding — multi-rank saves and custom resharding across mesh/placement changes.
- Design & internals — the async staging and background-write architecture.
Contributing
- Contributing — development setup, testing, and pull-request guidance.
License
BSD 3-Clause License. See LICENSE.
Release files for torch-checkpointing 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| torch_checkpointing-0.1.0.tar.gz | 181.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| torch_checkpointing-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 303.1 kB
Release files / torch_checkpointing-0.1.0.tar.gz
| Download URL | torch_checkpointing-0.1.0.tar.gz |
|---|---|
| Size | 181.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
304725d78f7c110c521cfdb92357df371a423a0168d38f367cede63c122aea73
|
|
BLAKE2b-256 checksum How to use checksums |
85f7c16752b0fe0c4f79dc5d23f8eecb0d0ab4a7c2a348d2dd27edc17ee89bd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 13, 2026.
Transparency logRelease files / torch_checkpointing-0.1.0-py3-none-any.whl
| Download URL | torch_checkpointing-0.1.0-py3-none-any.whl |
|---|---|
| Size | 121.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a0944c88adcdbe88f4a68870d0d88b5a1c9e421cc5b604c84eda7c17d719164
|
|
BLAKE2b-256 checksum How to use checksums |
ebe1184f1abad2fa8f3090376772a99af4ee552bf939cde979332d203cb7c77e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 13, 2026.
Transparency log