๐ค Optimum Habana is the interface between the ๐ค Transformers library and Habanaโs Gaudi processor (HPU). It provides a set of tools enabling easy model loading and fine-tuning on single- and multi-HPU settings for different downstream tasks. The list of officially validated models and tasks is available here. Users can try other models and tasks with only few changes.
Quote from the Hugging Face blog post:
Habana Gaudi training solutions, which power Amazonโs EC2 DL1 instances and Supermicroโs X12 Gaudi AI Training Server, deliver price/performance up to 40% lower than comparable training solutions and enable customers to train more while spending less. The integration of ten 100 Gigabit Ethernet ports onto every Gaudi processor enables system scaling from 1 to thousands of Gaudis with ease and cost-efficiency. Habanaโs SynapseAIยฎ is optimizedโat inceptionโto enable Gaudi performance and usability, supports TensorFlow and PyTorch frameworks, with a focus on computer vision and natural language processing applications.
pip install optimum[habana]Run the following command if you want to use DeepSpeed on HPUs:
pip install optimum[habana-deepspeed]
Optimum Habana is a fast-moving project, and you may want to install it from source:
pip install git+https://github.com/huggingface/optimum-habana.gitLast but not least, donโt forget to install requirements for every example:
cd <example-folder>
pip install -r requirements.txtAlternatively, you can install the package without pip as follows:
git clone https://github.com/huggingface/optimum-habana.git
cd optimum-habana
python setup.py installThe following model architectures, tasks and device distributions have been validated for ๐ค Optimum Habana:
| Text Classification | Question Answering | Language Modeling | Summarization | Translation | Image Classification | Single Card | Multi Card | DeepSpeed | |
|---|---|---|---|---|---|---|---|---|---|
| BERT | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| RoBERTa | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| ALBERT | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| DistilBERT | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| GPT2 | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| T5 | โ | โ | โ | โ | โ | โ | โ | โ | โ |
| ViT | โ | โ | โ | โ | โ | โ | โ | โ | โ |
Other models and tasks supported by the ๐ค Transformers library may also work. You can refer to this section for using them with ๐ค Optimum Habana. Besides, this page explains how to modify any example from the ๐ค Transformers library to make it work with ๐ค Optimum Habana.
If you find any issue while using those, please open an issue or a pull request in the Github repository of the project.
Please refer to Habana Gaudiโs official installation guide.
Tests should be run in a Docker container based on Habana Docker images.