Рет қаралды 4,074
In this video, I show you how to accelerate Transformer inference with Optimum, an open-source library by Hugging Face, and Better Transformer, a PyTorch extension available since PyTorch 1.12.
Using an AWS instance equipped with an NVIDIA V100 GPU, I start from a couple of models that I previously fine-tuned: a DistilBERT model for text classification and a Vision Transformer model for image classification. I first benchmark the original models, then I use Optimum and Better Transformer to optimize them with a single line of code, and I benchmark them again. This simple process delivers a 20-30% percent speedup with no accuracy drop!
⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️
⭐️⭐️⭐️ Want to buy me a coffee? I can always use more :) www.buymeacoffee.com/julsimon ⭐️⭐️⭐️
- Optimum v1.5.0 : github.com/huggingface/optimu...
- Optimum docs: huggingface.co/docs/optimum/o...
- Better Transformer blog post: pytorch.org/blog/a-better-tra...
- DistilBERT model: huggingface.co/juliensimon/di...
- Vision Transformer model: huggingface.co/juliensimon/au...
- Code: gitlab.com/juliensimon/huggin...