Hugging Face Optimum integrates with ONNX Runtime for training and inference, offering significant speedups and optimizations for popular Hugging Face models. This includes leveraging ONNX Runtime's memory and compute optimizations, fused optimizers, mixed-precision training, and integration with DeepSpeed ZeRO Stage 1. The ORTTrainer API provides a seamless transition for users familiar with the Transformers Trainer API. This post details the conversion of Transformers models to ONNX format using `torch.onnx`, `transformers.onnx`, and the high-level Optimum library, enabling accelerated inference and further optimization steps like quantization and TensorRT conversion.
All Hugging Face trails