Skip to content
STIRUP

TECHNOLOGY INTELLIGENCE

Understand what's next.

Amazon SageMaker Inference Now Supports Multi-Instance GPU Partitioning

Amazon SageMaker Inference now supports Multi-Instance GPU (MIG) partitioning, allowing users to allocate specific portions of a GPU to different models for improved performance and cost efficiency.

Share
AI-generated conceptual illustration accompanying: Amazon SageMaker Inference Now Supports Multi-Instance GPU Partitioning
AI-generated editorial illustration of the article topic; not a photograph, product screenshot or measured result.

Introduction to Multi-Instance GPU Support in SageMaker Inference

Amazon SageMaker Inference now supports Multi-Instance GPU (MIG) to maximize GPU utilization for model endpoints AWS Machine Learning. This feature allows users to partition a single physical GPU into independent partitions, enabling more efficient resource allocation across multiple models deployed on a single endpoint AWS Machine Learning. Previously, the smallest unit of GPU that could be requested was one whole accelerator. With MIG, users can now allocate specific portions of a GPU to different models, improving overall performance and cost efficiency. This capability is available for endpoints that use inference components, which allow multiple models to be deployed on a single endpoint with customizable compute resources AWS Machine Learning. This advancement provides greater flexibility for developers managing complex machine learning workloads.

Limitations and Use Cases for GPU Partitioning

Limitations and Use Cases for GPU Partitioning in SageMaker Inference highlight scenarios where GPU partitioning may not be applicable or optimal. According to AWS Machine Learning, single-model endpoints, serverless endpoints, and heterogeneous instance pools cannot be partitioned, restricting the flexibility of GPU resource allocation in these cases. AWS Machine Learning suggests that running fewer, larger endpoints and batching more requests can improve GPU utilization, but this strategy is only effective when models are interchangeable. Finally, AWS Machine Learning recommends using multi-model endpoints, which allow loading and unloading models from a shared GPU on demand, making them well-suited for sparse, bursty traffic patterns. These use cases illustrate that while GPU partitioning can enhance efficiency, it is not universally applicable and must be carefully considered based on workload characteristics.

Implementation Details of GPU Partitioning

AWS SageMaker Inference now supports Multi-Instance GPU (MIG) partitioning to optimize GPU utilization for model endpoints. Implementation details reveal that MIG allows layout changes only when partitions are idle, which on SageMaker AI means selecting a layout during endpoint creation. The AcceleratorPartitionLayouts parameter in CreateEndpointConfig defines how accelerators are divided across production variants. For example, an A100 GPU has seven compute slices available for partitioning. Each inference component can then be assigned a specific partition type, such as mig-4g.20gb, ensuring that the model runs on the designated partition. This approach enables efficient resource allocation and maximizes GPU utilization for distributed inference workloads.

Driver and Image Requirements for P4d Instances

When deploying model endpoints on P4d instances with SageMaker Inference, specific driver and image requirements must be met to ensure compatibility and performance. The mig-1g.10gb configuration on P4d instances requires an NVIDIA driver version R525 or newer, as noted in the driver requirements. The default P4d image includes the 470.256.02 driver version. For users needing a more recent driver, setting InferenceAmiVersion to al2023-ami-sagemaker-inference-gpu-4-1 on the production variant provides an image with a driver version in the 580 series, as stated in the configuration guidelines. Workloads typically do not utilize only one GPU, so the focus should be on selecting a combination that aligns with the specific use case, as highlighted by the research and privacy statement.

Multi-Stage Pipelines and Performance Testing

A key aspect of SageMaker Inference's support for Multi-Instance GPU (MIG) is its ability to optimize GPU utilization in multi-stage pipelines. These pipelines often involve sequential model execution, such as combining a transcription model, a diarization model, and a language model, or an embedder, a reranker, and a generator. In performance testing, genai-bench was used to generate load, ensuring that both endpoints were driven from the same client, making the GPU the only variable. Both endpoints ran Llama-3.1-8B-Instruct on production SageMaker real-time endpoints, with one model replica each, using identical container images, tokenizers, and client configurations. This setup allowed for a direct comparison of performance under identical conditions, highlighting the benefits of MIG in maximizing GPU utilization for complex inference workloads.

Sources and reporting notes

Based on published source material. No independent hands-on testing is claimed.

Read more