From 8b62250fcd8b975b7ae2d1f059d00eed18109b57 Mon Sep 17 00:00:00 2001 From: manashgoswami Date: Wed, 4 Aug 2021 16:51:15 -0700 Subject: [PATCH] Manashgoswami gh pages (#8091) * Update ort-training.md * Update index.md * Update index.md * Update ort-training.md * Update index.md * Update install.md * Update index.md --- docs/how-to/install.md | 18 ++++++++++++++---- docs/index.md | 20 ++++++++++++++++++++ docs/tutorials/training/index.md | 1 + docs/tutorials/training/ort-training.md | 1 + 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/docs/how-to/install.md b/docs/how-to/install.md index b071d21975..1fd53e4e4c 100644 --- a/docs/how-to/install.md +++ b/docs/how-to/install.md @@ -59,12 +59,22 @@ by running `locale-gen en_US.UTF-8` and `update-locale LANG=en_US.UTF-8` ## Training - -||Official build|Nightly build| + +ONNX Runtime Training packages are available for different versions of PyTorch, CUDA and ROCm versions. + +The install command is: +```cmd +pip3 install torch-ort [-f location] +python 3 -m torch_ort.configure +``` + +The _location_ needs to be specified for any specific version other than the default combination. The location for the different configurations are below: + +||Official build (location)|Nightly build (location)| |---|---|---| |PyTorch 1.8.1 (CUDA 10.2)|[**onnxruntime_stable_torch181.cu102**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_torch181.cu102.html)|[onnxruntime_nightly_torch181.cu102](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch181.cu102.html)| |PyTorch 1.8.1 (CUDA 11.1)|[**onnxruntime_stable_torch181.cu111**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_torch181.cu111.html )|[onnxruntime_nightly_torch181.cu111](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch181.cu111.html)| -|PyTorch 1.9 (CUDA 10.2)|[**onnxruntime-training**](https://pypi.org/project/onnxruntime-training/)|[onnxruntime_nightly_torch190.cu102](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch190.cu102.html)| +|PyTorch 1.9 (CUDA 10.2) **Default**|[**onnxruntime-training**](https://pypi.org/project/onnxruntime-training/)|[onnxruntime_nightly_torch190.cu102](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch190.cu102.html)| |PyTorch 1.9 (CUDA 11.1)|[**onnxruntime_stable_torch190.cu111**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_torch190.cu111.html)|[onnxruntime_nightly_torch190.cu111](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch190.cu111.html)| |[*Preview*] PyTorch 1.8.1 (ROCm 4.2)|[**onnxruntime_stable_torch181.rocm42**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_torch181.rocm42.html)|[onnxruntime_nightly_torch181.rocm42](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch181.rocm42.html)| -|[*Preview*] PyTorch 1.9 (ROCm 4.2)|[**onnxruntime_stable_torch190.rocm42**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_torch190.rocm42.html)|[onnxruntime_nightly_torch190.rocm42](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch190.rocm42.html)| +|[*Preview*] PyTorch 1.9 (ROCm 4.2)|[**onnxruntime_stable_torch190.rocm42**](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_stable_torch190.rocm42.html)|[onnxruntime_nightly_torch190.rocm42](https://onnxruntimepackages.z14.web.core.windows.net/onnxruntime_nightly_torch190.rocm42.html)| \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 7fb08ef3ea..9e2fc83fbf 100644 --- a/docs/index.md +++ b/docs/index.md @@ -55,6 +55,26 @@ Released in April 2021, ONNX Runtime Training provides a one-line addition for e Using the ORTModule class wrapper, ONNX Runtime for PyTorch runs the forward and backward passes of the training script using an optimized automatically-exported ONNX computation graph. ORT Training uses the same graph optimizations as ORT Inferencing, allowing for model training acceleration. +The ORTModule is instantiated from [`torch-ort`](https://github.com/pytorch/ort) backend in PyTorch. This new interface enables a seamless integration for ONNX Runtime training in a PyTorch training code with minimal changes to the existing code. + +### Install ONNX Runtime Training package + +`pip install torch-ort +python -m torch_ort.configure` + +**Note**: This installs the default version of the `torch-ort` and `onnxruntime-training` packages that are mapped to specific versions of the CUDA libraries. Refer to the install options in [ONNXRUNTIME.ai](https://onnxruntime.ai). + +### Add ORTModule in the `train.py` + +```python + from torch_ort import ORTModule + . + . + . + model = ORTModule(model) +``` + +**Note**: the `model` where ORTModule is wrapped needs to be a derived from the `torch.nn.Module` class. diff --git a/docs/tutorials/training/index.md b/docs/tutorials/training/index.md index ece0fe851e..0b2e7a5f47 100644 --- a/docs/tutorials/training/index.md +++ b/docs/tutorials/training/index.md @@ -6,3 +6,4 @@ nav_order: 2 --- # Tutorials: ORT Training +## [Finetuning acceleration for Hugging Face Transformers with ONNX Runtime](https://github.com/microsoft/onnxruntime-training-examples/tree/master/huggingface). \ No newline at end of file diff --git a/docs/tutorials/training/ort-training.md b/docs/tutorials/training/ort-training.md index 463f1398c1..5e7f0b5277 100644 --- a/docs/tutorials/training/ort-training.md +++ b/docs/tutorials/training/ort-training.md @@ -16,4 +16,5 @@ nav_order: 1 * [Accelerate fine tuning of Huggingface GPT2 model](https://github.com/microsoft/onnxruntime-training-examples/tree/master/orttrainer/huggingface-gpt2) + * *More coming soon!*