Skip to main content

torch-atomic-save

Pytest License: MIT

An asynchronous, atomic checkpointing utility for PyTorch, optimized for Slurm and Lustre/NFS environments.

Key Features

  • Atomic Moves: Prevents corrupted checkpoints during Slurm preemption.
  • Non-Blocking: Offloads I/O to a background thread pool.
  • Race Condition Protection: Automatically clones tensors to CPU before background saving.
  • Cross-FS Support: Handles moves between local SSD and network storage safely.

Installation

pip install torch-atomic-save

Usage

from torch_atomic_save import SlurmAtomicManager

# Initialize the manager
manager = SlurmAtomicManager(max_workers=4)

# In your training loop:
if epoch % save_interval == 0:
    manager.save(model, "path/to/checkpoints/model.pt", tmp_dir="/scratch/user/tmp")

# Ensure all I/O is finished before exiting
manager.wait_for_all()

Attribution

If you use this software in your research, please cite it using the "Cite this repository" button or the provided CITATION.cff.

Metadata

Release files for torch-atomic-save 0.1.2

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-atomic-save 0.1.2
File Size Uploaded Provenance
torch_atomic_save-0.1.2.tar.gz 9.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for torch-atomic-save 0.1.2
File Interpreter ABI Platform
torch_atomic_save-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.3 kB

Release files / torch_atomic_save-0.1.2.tar.gz

Download URL torch_atomic_save-0.1.2.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f9deed4c9bbf4ae18f050332891fd5243f6000e0d8273b5af3274d29fa4aaddb
BLAKE2b-256 checksum
How to use checksums
f40c242ea888d3d3e913c198898bb614d017861422625fb040f0a94935cedda2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / torch_atomic_save-0.1.2-py3-none-any.whl

Download URL torch_atomic_save-0.1.2-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d84461a6350db6b376195d59d3c2e50ae26a15063eca44614a1a456483eeda55
BLAKE2b-256 checksum
How to use checksums
93ce39e924183ddb8e55c4d04b55cb376661bc64051908ea033880f8a85b628f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for torch-atomic-save 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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