Cost-optimizing AssemblyAI speech-to-text inference on AWS with Amazon EC2 Spot
AssemblyAI built a cost‑optimized speech‑to‑text inference platform on AWS by mixing Amazon EC2 Spot and On‑Demand GPU instances within Amazon ECS clusters and using an Amazon SQS‑based retry loop to survive Spot interruptions. The fleet runs thousands of GPUs across multiple instance families (g4dn.xlarge, g4dn.2xlarge, g5.xlarge, g5.4xlarge, g6.2xlarge) in both US West (us‑west‑2) and Europe (eu‑west‑2) to meet latency SLAs while keeping data residency. This architecture delivers significant cost savings without compromising availability, enabling engineers to run large‑scale GPU inference workloads affordably.
⚡ Key Takeaways
- Instance families used: g4dn.xlarge, g4dn.2xlarge, g5.xlarge, g5.4xlarge, g6.2xlarge.
- ECS capacity providers blend Spot and On‑Demand capacity for resilient scheduling.
- Spot interruptions are handled via an EventBridge‑triggered SQS retry mechanism.
- Deployment spans US West (us‑west‑2) and Europe (eu‑west‑2) to satisfy data‑residency requirements.
🔧 Tools & Libraries
Engineers can achieve dramatic GPU cost reductions for latency‑sensitive inference by combining Spot diversification, ECS capacity providers, and queue‑driven retries, while still honoring regional compliance constraints.
✅ Practical Steps
- Configure an Amazon ECS cluster with capacity providers that specify both Spot and On‑Demand GPU instance types (g4dn.xlarge, g4dn.2xlarge, g5.xlarge, g5.4xlarge, g6.2xlarge).
- Set up an Amazon SQS queue and an EventBridge rule that captures Spot interruption notices and re‑queues in‑flight jobs for retry.
- Deploy the ECS tasks in the required AWS Regions (us‑west‑2 and eu‑west‑2) to enforce data residency.
Want the full story? Read the original article.
Read on AWS ML Blog ↗