Skip to main content

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 hashes)

Uploaded Source

Built Distribution

torchsnapshot-0.0.2-py3-none-any.whl (26.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page