Skip to main content

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 CheckpointManager drives 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.11.

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 CheckpointManager for 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 / StorageConfig interface; 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, and resharder via ItemSpec.
  • 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 / StorageConfig interface 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.

Metadata

Release files for torch-checkpointing 0.1.1

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

Source distribution (sdist)

Source distribution for torch-checkpointing 0.1.1
File Size Uploaded Provenance Actions
torch_checkpointing-0.1.1.tar.gz 246.4 kB With provenance Details for torch_checkpointing-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torch-checkpointing 0.1.1
File Interpreter ABI Platform Actions
torch_checkpointing-0.1.1-py3-none-any.whl Python 3 none any Details for torch_checkpointing-0.1.1-py3-none-any.whl

Total release size: 397.5 kB

Release files / torch_checkpointing-0.1.1.tar.gz

Download URL torch_checkpointing-0.1.1.tar.gz
Size 246.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2fe62fc62100af5059a54f158c741aa1a50255e6ea03d0a1c8f4f8de03f136a0
BLAKE2b-256 checksum
How to use checksums
2277c833760280db5a2dd2618c1d30d64d18ca87bd4349fe9e418575bedeca8f
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 Oct 23, 2026.

Transparency log

Release files / torch_checkpointing-0.1.1-py3-none-any.whl

Download URL torch_checkpointing-0.1.1-py3-none-any.whl
Size 151.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e9e1c7754196bc73c9db00037d03aea63fc858f8080fae65b273c4a8d82f5ca
BLAKE2b-256 checksum
How to use checksums
0290306c38cf00cee9832ad6a6ee7847b72e7780806738dae159abef5760d441
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 Oct 23, 2026.

Transparency log

Security for torch-checkpointing 0.1.1

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for torch_checkpointing-0.1.1.tar.gz

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 Oct 23, 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

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