Cost effective deployment of vision-language models for pet behavior detection on AWS Inferentia2

· Source: Artificial Intelligence · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cloud Computing & IT Infrastructure · Depth: Intermediate, medium

Summary

Tomofun, the pet-tech startup behind the Furbo Pet Camera, successfully migrated its vision-language model (VLM) inference workloads from GPU-based Amazon EC2 instances to AWS Inferentia2-powered EC2 Inf2 instances, achieving an 83% cost reduction. The company uses the Bootstrapping Language-image Pre-Training (BLIP) model for real-time pet behavior detection, which previously incurred high costs due to always-on inference requirements. The migration involved breaking the BLIP model into its Image Encoder, Text Encoder, and Text Decoder components, compiling each independently with the Neuron SDK, and using lightweight Python wrappers to manage input/output formatting without altering the original PyTorch model logic. This architecture allows dynamic switching between GPU and Inferentia2 backends, maintaining high availability and throughput for hundreds of thousands of devices.

Key takeaway

For AI Architects and MLOps Engineers managing large-scale, real-time vision-language model inference, consider migrating to AWS Inferentia2. Your teams can achieve significant cost savings, potentially 83% as demonstrated by Tomofun, by leveraging purpose-built AI accelerators. This transition can be streamlined using modular compilation and lightweight I/O wrappers, preserving your existing model architecture and PyTorch code. Evaluate Inferentia2 for workloads beyond VLMs, such as audio event detection, to further optimize infrastructure costs.

Key insights

Migrating VLM inference to AWS Inferentia2 can drastically cut costs while preserving model performance and architecture.

Principles

Method

To deploy PyTorch models on Inferentia2, isolate submodules, provide pseudo input tensors, compile with `torch_neuronx.trace()`, and save as TorchScript artifacts. Use wrapper classes for I/O formatting during deployment.

In practice

Topics

Best for: MLOps Engineer, AI Engineer, AI Architect

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Artificial Intelligence.