aws AWS Containers Blog ·

Run GPU batch inference on ECS with scale-to-zero managed instances

blogaiinfraawsengineeraws-ecsaws-sqs
announcement

This post details how to deploy a GPU batch inference pipeline on Amazon ECS using Managed Instances, which automates instance provisioning and management. The solution leverages Amazon SQS for job buffering and AWS Application Auto Scaling to scale the service down to zero instances when idle, resulting in zero idle cost. It demonstrates deploying a generative AI model for text-to-speech inference, highlighting the cost savings for bursty workloads and the simplified operational overhead compared to self-managed EC2 instances.

  • Scale-to-zero GPU inference pipeline with SQS and Application Auto Scaling
  • Attribute-based instance selection for cost-effective GPU provisioning
  • Simplified GPU inference with ECS Managed Instances
  • Automated GPU health monitoring and native CloudWatch metrics
  • Baked model weights and CUDA compatibility for improved reliability
Features (2)
  • Scale-to-zero GPU inference pipeline with SQS and Application Auto Scaling

    A reference architecture deploys a GPU batch inference pipeline on ECS using Managed Instances, SQS for job buffering, and AWS Application Auto Scaling. The service automatically scales down to zero tasks and instances when the SQS queue is empty, ensuring users pay only for active inference time.

  • Attribute-based instance selection for cost-effective GPU provisioning

    The ECS Managed Instances capacity provider uses attribute-based instance selection to provision On-Demand GPU instances based on specified requirements like manufacturer (NVIDIA), minimum GPU memory (20 GB), and single-GPU constraint, selecting the most cost-effective instance type.

Enhancements (2)
  • Automated GPU health monitoring and native CloudWatch metrics

    The system includes GPU health monitoring that automatically detects and replaces instances with hardware failures via DCGM. Native GPU metrics in Amazon CloudWatch Container Insights provide visibility into device-level utilization, memory, and thermal conditions.

  • Baked model weights and CUDA compatibility for improved reliability

    Model weights are baked into container images during the build process, enabling offline operation and reducing cold start variability. A CUDA compatibility layer helps prevent version mismatches between the container image and host drivers, enhancing reliability during driver updates.

Notes (2)
  • Simplified GPU inference with ECS Managed Instances

    Amazon ECS Managed Instances now simplify GPU batch inference by handling instance provisioning, AMI updates, driver management, and security patching, removing the need for self-managed EC2 instances and complex Auto Scaling configurations.

  • Cost benefits of scale-to-zero GPU inference

    The primary cost advantage is eliminating idle costs by scaling down to zero instances when no jobs are present. Reduced GPU management fees on ECS Managed Instances further enhance cost-effectiveness, especially for bursty job arrival patterns.

Read the original announcement →

https://aws.amazon.com/blogs/containers/run-gpu-batch-inference-on-amazon-ecs-managed-instances-with-scale-to-zero/

Related releases