Installation#

We recommend installing Olive in a virtual environment or a conda environment. Olive is installed using pip.

Create a virtual/conda environment with the desired version of Python and activate it.

You will need to install a build of onnxruntime. You can install the desired build separately but public versions of onnxruntime can also be installed as extra dependencies during Olive installation.

Install with pip#

Olive is available for installation from PyPI.

pip install olive-ai[auto-opt,finetune,capture-onnx-graph,bnb]
pip install transformers datasets onnxscript

Optional Dependencies#

Olive has optional dependencies that can be installed to enable additional features. Please refer to Olive package config for the list of extras and their dependencies.

Install from source#

Install the latest main version of Olive from source. Please note that this is a development version and may not be stable.

pip install git+https://github.com/microsoft/Olive

With onnxruntime (Default CPU):

pip install git+https://github.com/microsoft/Olive#egg=olive-ai[cpu]

With onnxruntime-gpu:

pip install git+https://github.com/microsoft/Olive#egg=olive-ai[gpu]

With onnxruntime-directml:

pip install git+https://github.com/microsoft/Olive#egg=olive-ai[directml]

Editable install#

If you want contribute to Olive and test your code, you can install Olive in editable mode.

Clone the repository and install Olive with the following commands:

git clone https://github.com/microsoft/Olive
cd Olive
pip install -e .