Accelerating Transformers with Optimum Neuron, AWS Trainium and AWS Inferentia2 @juliensimonfr
Accelerating Transformers with Optimum Neuron, AWS Trainium and AWS Inferentia2  @juliensimonfr
Uploaded May 2023 | Updated September 2026, 2 weeks ago
In this video, I show you how to accelerate Transformer training and inference with the Hugging Face Optimum Neuron library, a hardware acceleration library dedicated to AWS Trainium and AWS Inferentia 2, two custom AI chips designed by AWS.

First, changing a single line of code, I show you how to train a Vision Transformer model on the food101 datasets (75K training images). On a trn1.32xlarge instance, the model trains in under a minute per epoch.

Then, I show you how to export a DistilBERT model from the hub to Inferentia2. Running a benchmark on a inf2.xlarge instance, we get over 2000 predictions per second and P99 1-millisecond latency!

⭐️⭐️⭐️ Don't forget to subscribe to be notified of future videos ⭐️⭐️⭐️

- Amazon EC2 Trn1: aws.amazon.com/ec2/instance-types/trn1
- Amazon EC2 Inf2: aws.amazon.com/ec2/instance-types/inf2
- Hugging Face Neuron AMI: aws.amazon.com/marketplace/pp/prodview-gr3e6yiscria2
- Optimum Neuron documentation: huggingface.co/docs/optimum-neuron
- Optimum Neuron Github: github.com/huggingface/optimum-neuron
- Code: gitlab.com/juliensimon/huggingface-demos/-/tree/main/optimum/neuron
Accelerating Transformers with Optimum Neuron, AWS Trainium and AWS Inferentia2Why Small Language Models are Game-ChangingDeploying Hugging Face models with Amazon SageMaker and AWS Inferentia2Building a RAG chatbot with LangChain, Chroma, Hugging Face, and Arcee ConductorNo Cloud, No API Keys: Local Open-Source Coding with Trinity Mini, OpenCode, and MLXHugging Face / AWS roadshow - Day 2, MadridAI at the edge - live from Cisco Live in San Diego, CA!Arcee Agent, a 7B model for function calls and tools #ai #largelanguagemodels #chatbot #opensourceThe Stunning Speed of Local Small Language ModelsArcee Blitz 24B - A better Mistral Small 3 modelCreative Writing with AI: A New FrontierDeep Dive: Model Distillation with DistillKit
Julien Simon |

Accelerating Transformers with Optimum Neuron, AWS Trainium and AWS Inferentia2

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER