A library for persisting PyTorch program state
Project description
torchsnapshot
a lightweight library for fault tolerance to PyTorch programs through program state persistence
Install
Requires Python >= 3.7.
From pip:
pip install torchsnapshot
Usage
import torchsnapshot
# Define the program state
app_state = {"model": model, "optimizer": optimizer"}
# At an appropriate time, persist the program state as a snapshot
snapshot = Snapshot.take(path=path, app_state=app_state)
# On resuming, restore the program state from a snapshot
snapshot.restore(app_state)
License
torchsnapshot is BSD licensed, as found in the LICENSE file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
torchsnapshot-0.0.2.tar.gz
(19.5 kB
view details)
Built Distribution
File details
Details for the file torchsnapshot-0.0.2.tar.gz
.
File metadata
- Download URL: torchsnapshot-0.0.2.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16bffaa49d9d8b27c8ed2805ee11e4be8018c9f936b66954322bc0927e6ae23b |
|
MD5 | 77b730ac75daff845813f4236e0139b5 |
|
BLAKE2b-256 | dcd6a5c9d3f8f666ad7c225f02edc17284ab932629a5ae6602de4ec9b72563e2 |
Provenance
File details
Details for the file torchsnapshot-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: torchsnapshot-0.0.2-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63ba22726f4ed8360e93990820f9e7e23013eaadeab502bb8b4c5b5c45d9c3b4 |
|
MD5 | a139b778bcdec4fd1f224a26f9910035 |
|
BLAKE2b-256 | b2e4d33869a931f478a3238a14fbe62465ef7608d0b7a0ec10e06c993a03aa5f |