optimum
π Accelerate inference and training of π€ Transformers, Diffusers, TIMM and Sentence Transformers with easy to use hardware optimization tools
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
βCITATION.cff file
-
βcodemeta.json file
Found codemeta.json file -
β.zenodo.json file
Found .zenodo.json file -
βDOI references
-
βAcademic publication links
-
βCommitters with academic emails
5 of 145 committers (3.4%) from academic institutions -
βInstitutional organization owner
-
βJOSS paper metadata
-
βScientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
π Accelerate inference and training of π€ Transformers, Diffusers, TIMM and Sentence Transformers with easy to use hardware optimization tools
Basic Info
- Host: GitHub
- Owner: huggingface
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://huggingface.co/docs/optimum/main/
- Size: 5.48 MB
Statistics
- Stars: 3,056
- Watchers: 57
- Forks: 580
- Open Issues: 280
- Releases: 75
Topics
Metadata Files
README.md
π€ Optimum
Optimum is an extension of Transformers π€ Diffusers 𧨠TIMM πΌοΈ and Sentence-Transformers π€, providing a set of optimization tools and enabling maximum efficiency to train and run models on targeted hardware, while keeping things easy to use.
Installation
Optimum can be installed using pip as follows:
bash
python -m pip install optimum
If you'd like to use the accelerator-specific features of Optimum, you can check the documentation and install the required dependencies according to the table below:
| Accelerator | Installation |
| :---------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| ONNX | pip install --upgrade --upgrade-strategy eager optimum[onnx] |
| Intel Neural Compressor | pip install --upgrade --upgrade-strategy eager optimum[neural-compressor] |
| OpenVINO | pip install --upgrade --upgrade-strategy eager optimum[openvino] |
| IPEX | pip install --upgrade --upgrade-strategy eager optimum[ipex] |
| NVIDIA TensorRT-LLM | docker run -it --gpus all --ipc host huggingface/optimum-nvidia |
| AMD Instinct GPUs and Ryzen AI NPU | pip install --upgrade --upgrade-strategy eager optimum[amd] |
| AWS Trainum & Inferentia | pip install --upgrade --upgrade-strategy eager optimum[neuronx] |
| Intel Gaudi Accelerators (HPU) | pip install --upgrade --upgrade-strategy eager optimum[habana] |
| FuriosaAI | pip install --upgrade --upgrade-strategy eager optimum[furiosa] |
The --upgrade --upgrade-strategy eager option is needed to ensure the different packages are upgraded to the latest possible version.
To install from source:
bash
python -m pip install git+https://github.com/huggingface/optimum.git
For the accelerator-specific features, append optimum[accelerator_type] to the above command:
bash
python -m pip install optimum[onnxruntime]@git+https://github.com/huggingface/optimum.git
Accelerated Inference
Optimum provides multiple tools to export and run optimized models on various ecosystems:
- ONNX / ONNX Runtime, one of the most popular open formats for model export, and a high-performance inference engine for deployment.
- OpenVINO, a toolkit for optimizing, quantizing and deploying deep learning models on Intel hardware.
- ExecuTorch, PyTorchβs native solution for on-device inference across mobile and edge devices.
- Intel Gaudi Accelerators enabling optimal performance on first-gen Gaudi, Gaudi2 and Gaudi3.
- AWS Inferentia for accelerated inference on Inf2 and Inf1 instances.
- NVIDIA TensorRT-LLM.
The export and optimizations can be done both programmatically and with a command line.
ONNX + ONNX Runtime
π¨π¨π¨ ONNX integration moving to optimum-onnx so make sure to follow the installation instructions π¨π¨π¨
Before you begin, make sure you have all the necessary libraries installed :
bash
pip install --upgrade --upgrade-strategy eager optimum[onnx]
It is possible to export Transformers, Diffusers, Sentence Transformers and timm models to the ONNX format and perform graph optimization as well as quantization easily.
For more information on the ONNX export, please check the documentation.
Once the model is exported to the ONNX format, we provide Python classes enabling you to run the exported ONNX model in a seemless manner using ONNX Runtime in the backend.
For this make sure you have ONNX Runtime installed, fore more information check out the installation instructions.
More details on how to run ONNX models with ORTModelForXXX classes here.
Intel (OpenVINO + Neural Compressor + IPEX)
Before you begin, make sure you have all the necessary libraries installed.
You can find more information on the different integration in our documentation and in the examples of optimum-intel.
ExecuTorch
Before you begin, make sure you have all the necessary libraries installed :
bash
pip install optimum-executorch@git+https://github.com/huggingface/optimum-executorch.git
Users can export Transformers models to ExecuTorch and run inference on edge devices within PyTorch's ecosystem.
For more information about export Transformers to ExecuTorch, please check the doc for Optimum-ExecuTorch.
Quanto
Quanto is a pytorch quantization backend which allows you to quantize a model either using the python API or the optimum-cli.
You can see more details and examples in the Quanto repository.
Accelerated training
Optimum provides wrappers around the original Transformers Trainer to enable training on powerful hardware easily. We support many providers:
- Intel Gaudi Accelerators (HPU) enabling optimal performance on first-gen Gaudi, Gaudi2 and Gaudi3.
- AWS Trainium for accelerated training on Trn1 and Trn1n instances.
- ONNX Runtime (optimized for GPUs).
Intel Gaudi Accelerators
Before you begin, make sure you have all the necessary libraries installed :
bash
pip install --upgrade --upgrade-strategy eager optimum[habana]
You can find examples in the documentation and in the examples.
AWS Trainium
Before you begin, make sure you have all the necessary libraries installed :
bash
pip install --upgrade --upgrade-strategy eager optimum[neuronx]
You can find examples in the documentation and in the tutorials.
ONNX Runtime
Before you begin, make sure you have all the necessary libraries installed :
bash
pip install optimum[onnxruntime-training]
You can find examples in the documentation and in the examples.
Owner
- Name: Hugging Face
- Login: huggingface
- Kind: organization
- Location: NYC + Paris
- Website: https://huggingface.co/
- Twitter: huggingface
- Repositories: 344
- Profile: https://github.com/huggingface
The AI community building the future.
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| fxmarty | 9****y | 336 |
| Ella Charlaix | 8****x | 268 |
| Jingya HUANG | 4****g | 97 |
| regisss | 1****s | 73 |
| Michael Benayoun | m****n@g****m | 53 |
| Ilyas Moutawwakil | 5****l | 43 |
| Mohit Sharma | m****s@g****m | 34 |
| lewtun | l****l@g****m | 22 |
| Younes Belkada | 4****a | 20 |
| FranΓ§ois Lagunas | f****s@g****m | 20 |
| Marc Sun | 5****c | 16 |
| Funtowicz Morgan | m****z | 16 |
| Joshua Lochner | a****n@x****m | 15 |
| Bas Krahmer | b****r@g****m | 12 |
| Philipp Schmid | 3****d | 10 |
| Ekaterina Aidova | e****a@i****m | 9 |
| Adam Louly | a****3@g****m | 8 |
| Prathik Rao | p****o@g****m | 8 |
| Mishig | m****j@c****u | 6 |
| Longjie Zheng | 3****x | 4 |
| Wang, Chang | c****g@i****m | 4 |
| jiqing-feng | j****g@i****m | 3 |
| BADAOUI Abdennacer | 1****i | 3 |
| David Corvoysier | d****r@g****m | 3 |
| Ryan Russell | r****l | 3 |
| Tom Aarsen | 3****n | 3 |
| jingyanwangms | 4****s | 3 |
| kunal-vaishnavi | 1****i | 3 |
| LRL-ModelCloud | 1****d | 2 |
| Luc Georges | M****e | 2 |
| and 115 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 559
- Total pull requests: 1,019
- Average time to close issues: 6 months
- Average time to close pull requests: about 2 months
- Total issue authors: 432
- Total pull request authors: 172
- Average comments per issue: 2.13
- Average comments per pull request: 1.85
- Merged pull requests: 637
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 113
- Pull requests: 348
- Average time to close issues: 28 days
- Average time to close pull requests: 19 days
- Issue authors: 99
- Pull request authors: 59
- Average comments per issue: 0.77
- Average comments per pull request: 1.72
- Merged pull requests: 213
- Bot issues: 0
- Bot pull requests: 1
Top Authors
Issue Authors
- fxmarty (25)
- xenova (15)
- gidzr (8)
- IlyasMoutawwakil (6)
- michaelbenayoun (6)
- AdamLouly (5)
- JingyaHuang (4)
- Harini-Vemula-2382 (4)
- prathikr (4)
- pradeepdev-1995 (4)
- michaelroyzen (4)
- tomaarsen (3)
- Kaya-P (3)
- jyangliu (3)
- ZeusFSX (3)
Pull Request Authors
- echarlaix (211)
- fxmarty (149)
- IlyasMoutawwakil (86)
- xenova (53)
- JingyaHuang (36)
- regisss (36)
- mht-sharma (28)
- eaidova (20)
- SunMarc (17)
- baskrahmer (17)
- jiqing-feng (12)
- Abdennacer-Badaoui (12)
- zhenglongjiepheonix (10)
- changwangss (10)
- michaelbenayoun (9)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 4
-
Total downloads:
- pypi 1,337,008 last-month
- Total docker downloads: 14,124
-
Total dependent packages: 84
(may contain duplicates) -
Total dependent repositories: 715
(may contain duplicates) - Total versions: 173
- Total maintainers: 7
pypi.org: optimum
Optimum Library is an extension of the Hugging Face Transformers library, providing a framework to integrate third-party libraries from Hardware Partners and interface with their specific functionality.
- Homepage: https://github.com/huggingface/optimum
- Documentation: https://optimum.readthedocs.io/
- License: Apache
-
Latest release: 1.27.0
published 7 months ago
Rankings
Maintainers (7)
proxy.golang.org: github.com/huggingface/optimum
- Documentation: https://pkg.go.dev/github.com/huggingface/optimum#section-documentation
- License: apache-2.0
-
Latest release: v1.27.0
published 7 months ago
Rankings
conda-forge.org: optimum
π€ Optimum is an extension of π€ Transformers, providing a set of performance optimization tools enabling maximum efficiency to train and run models on targeted hardware. The AI ecosystem evolves quickly and more and more specialized hardware along with their own optimizations are emerging every day. As such, Optimum enables users to efficiently use any of these platforms with the same ease inherent to transformers. PyPI: [https://pypi.org/project/optimum/](https://pypi.org/project/optimum/)
- Homepage: https://huggingface.co/hardware
- License: Apache-2.0
-
Latest release: 1.3.0
published over 3 years ago
Rankings
anaconda.org: optimum
π€ Optimum is an extension of Transformers that provides a set of performance optimization tools to train and run models on targeted hardware with maximum efficiency. The AI ecosystem evolves quickly, and more and more specialized hardware along with their own optimizations are emerging every day. As such, Optimum enables developers to efficiently use any of these platforms with the same ease inherent to Transformers.
- Homepage: https://github.com/huggingface/optimum
- License: Apache-2.0
-
Latest release: 1.24.0
published 12 months ago
Rankings
Dependencies
- actions/checkout v2 composite
- actions/checkout v2 composite
- actions/upload-artifact v3 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- aws-actions/configure-aws-credentials v1 composite
- philschmid/philschmid-ec2-github-runner main composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- aws-actions/configure-aws-credentials v1 composite
- philschmid/philschmid-ec2-github-runner main composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- aws-actions/configure-aws-credentials v1 composite
- philschmid/philschmid-ec2-github-runner main composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- aws-actions/configure-aws-credentials v1 composite
- philschmid/philschmid-ec2-github-runner main composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- aws-actions/configure-aws-credentials v1 composite
- philschmid/philschmid-ec2-github-runner main composite
- actions/checkout v2 composite
- aws-actions/configure-aws-credentials v1 composite
- philschmid/philschmid-ec2-github-runner main composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
- nikolaik/python-nodejs python3.8-nodejs18 build
- datasets >=1.8.0
- onnx *
- onnxruntime >=1.9.0
- protobuf *
- scikit-learn *
- scipy *
- sentencepiece *
- torch >=1.9
- datasets >=1.8.0
- onnx *
- onnxruntime >=1.9.0
- torch >=1.9.0
- datasets >=1.8.0
- onnx *
- onnxruntime >=1.9.0
- protobuf *
- scikit-learn *
- scipy *
- sentencepiece *
- torch >=1.9
- datasets >=1.18.0
- onnx *
- onnxruntime >=1.9.0
- seqeval *
- torch >=1.9
- datasets >=1.17.0
- torch >=1.5.0
- torchvision >=0.6.0
- datasets >=1.8.0
- onnx *
- onnxruntime >=1.9.0
- protobuf *
- scikit-learn *
- scipy *
- sentencepiece *
- torch >=1.9
- datasets >=1.8.0
- onnx *
- onnxruntime >=1.9.0
- torch >=1.9.0
- datasets >=1.8.0
- onnx *
- onnxruntime >=1.9.0
- protobuf *
- scikit-learn *
- scipy *
- sentencepiece *
- torch >=1.9
- datasets >=1.8.0
- onnx *
- onnxruntime >=1.9.0
- seqeval *
- torch >=1.9
- accelerate >=0.12.0
- datasets >=1.17.0
- evaluate *
- onnx >=1.9.0
- onnxruntime-training >=1.9.0
- torch >=1.5.0
- torch-ort *
- torchvision >=0.6.0
- datasets >=1.8.0
- onnx >=1.9.0
- onnxruntime-training >=1.9.0
- protobuf ==3.20.2
- scikit-learn *
- scipy *
- sentencepiece *
- torch >=1.9.0
- torch-ort *
- transformers >=4.16.0
- datasets >=1.8.0
- protobuf *
- scikit-learn *
- scipy *
- sentencepiece *
- torch >=1.9.0
- torch-ort *
- Jinja2 *
- accelerate >=0.16.0
- datasets *
- ftfy *
- tensorboard *
- transformers >=4.25.1
- accelerate *
- datasets >=1.8.0
- evaluate *
- nltk *
- protobuf *
- py7zr *
- rouge-score *
- scikit-learn *
- scipy *
- sentencepiece *
- torch >=1.9.0
- torch-ort *
- datasets >=1.8.0
- protobuf *
- scikit-learn *
- scipy *
- sentencepiece *
- datasets >=1.18.3
- scikit-learn *
- scipy *
- sentencepiece *
- seqeval *
- torch >=1.8.1
- torch >=1.9
- torch-ort *
- datasets >=1.18.0
- protobuf *
- py7zr *
- sacrebleu >=1.4.12
- sentencepiece *
- torch >=1.8
- actions/checkout v2 composite
- actions/setup-python v2 composite