Optimum documentation

Installation

You are viewing v1.18.1 version. A newer version v1.20.0 is available.
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Installation

🤗 Optimum can be installed using pip as follows:

python -m pip install optimum

If you’d like to use the accelerator-specific features of 🤗 Optimum, you can install the required dependencies according to the table below:

Accelerator Installation
ONNX runtime pip install --upgrade-strategy eager install optimum[onnxruntime]
Intel Neural Compressor (INC) pip install --upgrade-strategy eager optimum[neural-compressor]
Intel OpenVINO pip install --upgrade-strategy eager optimum[openvino,nncf]
AMD Instinct GPUs and Ryzen AI NPU pip install --upgrade-strategy eager optimum[amd]
Habana Gaudi Processor (HPU) pip install --upgrade-strategy eager optimum[habana]
FuriosaAI pip install --upgrade-strategy eager optimum[furiosa]

The --upgrade-strategy eager option is needed to ensure the different packages are upgraded to the latest possible version.

If you’d like to play with the examples or need the bleeding edge of the code and can’t wait for a new release, you can install the base library from source as follows:

python -m pip install git+https://github.com/huggingface/optimum.git

For the accelerator-specific features, you can install them by appending optimum[accelerator_type] to the pip command, e.g.

python -m pip install optimum[onnxruntime]@git+https://github.com/huggingface/optimum.git