Optimum+ONNX Runtime - Easier, Faster training for your Hugging Face models
Jan 24, 2023
Summary
This post details the integration of ONNX Runtime for training within Hugging Face's Optimum library. It introduces the `ORTTrainer` and `ORTTrainingArguments` APIs as replacements for the standard `Trainer` and `TrainingArguments`, enabling users to leverage ONNX Runtime's training optimizations with minimal code changes. Performance benchmarks demonstrate significant training speedups (39%-130%) when using ONNX Runtime with DeepSpeed ZeRO Stage 1 compared to PyTorch baseline. The post also outlines ONNX Runtime's underlying memory and compute optimizations, such as fused Adam optimizer and mixed-precision training, and discusses future plans for optimizing larger models and edge training.
More from the IPU-Ready Transformers Optimization trail
- Accelerating PyTorch Transformers with Intel Sapphire Rapids - part 2
- Accelerating PyTorch Transformers with Intel Sapphire Rapids - part 1
- Accelerate your models with 🤗 Optimum Intel and OpenVINO
- Pre-Train BERT with Hugging Face Transformers and Habana Gaudi
- Deep Dive: Vision Transformers On Hugging Face Optimum Graphcore