This release is a pre-release and may not be stable for production use.
Train PyTorch models with ONNX Runtime
PyTorch/ORT is a Python package that uses ONNX Runtime to accelerate PyTorch model training.
Pre-requisites
You need a machine with at least one NVDIA GPU to run PyTorch/ORT.
You can install run PyTorch/ORT in your local environment, or with Docker. If you are using Docker, the following base image is suitable: nvidia/cuda:11.1.1-cudnn8-devel-ubuntu18.04.
Install
-
Install CUDA
-
Install CuDNN
-
Install PyTorch/ORT and dependencies
pip install onnx ninjapip install --pre torch -f https://download.pytorch.org/whl/nightly/cu111/torch_nightly.htmlpip install --pre onnxruntime-training -f https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly.htmlpip install torch-ort
to install release package of onnxruntime-training:
pip install onnxruntime-training
Test your installation
- Clone this repo
git clone git@github.com:pytorch/ort.git
- Install extra dependencies
pip install wget pandas sklearn transformers
- Run the training script
python ./ort/tests/bert_for_sequence_classification.py
Add PyTorch/ORT to your PyTorch training script
import onnxruntime
from torch_ort import ORTModule
model = ORTModule(model)
# PyTorch training script follows
Versioning
CUDA
The PyTorch/ORT package was built with CUDA 11.1. If you have a different version of CUDA installed, you should install the CUDA 11.1 toolkit.
This is a limitation that will be removed in the next release.
Metadata
Release files for torch-ort 0.0.10.dev20210419
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| torch_ort-0.0.10.dev20210419-py3-none-any.whl | Python 3 | none | any | Details for torch_ort-0.0.10.dev20210419-py3-none-any.whl |
Release files / torch_ort-0.0.10.dev20210419-py3-none-any.whl
| Download URL | torch_ort-0.0.10.dev20210419-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fda80edbb1bd9e495966d5c570e45232c956b4900eb31bd35c4b3bd2eebcc42d
|
|
BLAKE2b-256 checksum How to use checksums |
c1badb190e5beee462e55972012315da199dfd3320017b27ec1381c29a723f61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.5
|
Security for torch-ort 0.0.10.dev20210419
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.