Home icon

Fast model loading for AI inference on Amazon EKS

Containers Blog



This article explains how to dramatically reduce cold-start time for AI inference workloads on Amazon EKS by optimizing model loading and compilation caching.

  • Identified bottlenecks: weights loading from S3 (35% for 64 GiB models, 92% for 203 GiB models) and torch.compile (65% for smaller models)
  • Recommend 4 GiB chunk size for Run:ai Model Streamer instead of smaller chunks with higher parallelism, reducing serial round-trips
  • Add aggressive timeout and retry logic to handle S3 request tail latency and stalled connections
  • Cache torch.compile artifacts on NVMe persistent volumes to eliminate 53-second recompilation on subsequent pod starts
  • Achieved 80% reduction in startup time: 82s→16s for 67 GiB model, 457s→32s for 203 GiB model on p5.48xlarge
  • All optimizations require only environment variables and configuration changes, no code modifications needed

Configuration-only tuning plus upstream contributions to Run:ai Model Streamer enable fast model loading across EKS, EC2, ECS, and SageMaker without additional infrastructure overhead.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Sep 4
2025
How to run AI model inference with GPUs on Amazon EKS Auto Mode
May 29
2025
Introducing AI on EKS: powering scalable AI workloads with Amazon EKS
Aug 12
2026
Hybrid ML inferencing on Amazon EKS with Amazon FSx for NetApp ONTAP and on-premises NetApp
Jul 15
2025
Accelerate generative AI inference with NVIDIA Dynamo and Amazon EKS

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.