概念
Scaling GPU and LLM workloads
Size GPU memory, scale model copies, and plan for capacity and scale to zero.
このレッスンはまだ翻訳されていないため、英語で表示しています。
- 1Requests rise.
- 2Concurrent requests per copy goes above the target.
- 3SageMaker AI adds copies, and managed instance scaling adds instances if the copies need room.
Concurrent requests
- Good for
- LLMs where requests run long
- Catch
- Needs a target from load tests
GPU utilization
- Good for
- A simple compute signal
- Catch
- Can be busy with few requests
Scale to zero
- Good for
- Idle models cost nothing
- Catch
- First requests wait minutes
Training plan
- Good for
- Guaranteed GPUs for a period
- Catch
- Paid for the whole period
| Choice | Good for | Catch |
|---|---|---|
| Concurrent requests | LLMs where requests run long | Needs a target from load tests |
| GPU utilization | A simple compute signal | Can be busy with few requests |
| Scale to zero | Idle models cost nothing | First requests wait minutes |
| Training plan | Guaranteed GPUs for a period | Paid for the whole period |
1 / 2
Concurrent requests
- Good for
- LLMs where requests run long
- Catch
- Needs a target from load tests
GPU utilization
- Good for
- A simple compute signal
- Catch
- Can be busy with few requests
Scale to zero
- Good for
- Idle models cost nothing
- Catch
- First requests wait minutes
| Choice | Good for | Catch |
|---|---|---|
| Concurrent requests | LLMs where requests run long | Needs a target from load tests |
| GPU utilization | A simple compute signal | Can be busy with few requests |
| Scale to zero | Idle models cost nothing | First requests wait minutes |
2 / 2
Training plan
- Good for
- Guaranteed GPUs for a period
- Catch
- Paid for the whole period
| Choice | Good for | Catch |
|---|---|---|
| Training plan | Guaranteed GPUs for a period | Paid for the whole period |
概要
A GPU instance has a fixed amount of GPU memory, so size by memory first. The weights, plus the attention cache that grows with the number of concurrent requests and their length, must fit. If they do not, use a larger instance, spread the model over more GPUs, or quantize it. An instance with several GPUs can hold several copies of a small model.
概要
Inference components make this explicit. For each model you declare the accelerators and memory one copy needs and a number of copies. SageMaker AI places copies on the instances of the endpoint. Scale the copies per model with a policy on concurrent requests per copy, which is more direct than GPU utilization. An endpoint with managed instance scaling then adds or removes instances as copies need room. GPU and GPU memory utilization from CloudWatch also work as custom metrics, but a GPU can look busy with few requests, so test them.
概要
GPU capacity can run short. A SageMaker AI training plan can reserve p-family GPU capacity for an inference endpoint for 1 to 182 days, which suits planned launches. Scale to zero saves money on idle models. It needs inference components, with the minimum set to zero. The catch is time: bringing an instance back takes minutes, and requests in that time fail with no-capacity errors. Buffer them in a queue such as Amazon SQS. AWS Inferentia and AWS Trainium are other ways to get capacity and lower cost, after a Neuron compile.
覚えること
- Weights plus attention cache must fit in GPU memory.
- Inference components: set accelerators, memory and copies for each model.
- Scale copies on concurrent requests per copy. Managed instance scaling adds instances.
- GPU utilization can mislead. Load test any metric you choose.
覚えること
- Training plans reserve GPU capacity for endpoints for 1 to 182 days.
- Scale to zero needs inference components. Scale-out takes minutes, so buffer requests.
試験では
- “Several LLMs on one endpoint, each scaled on its own” points to inference components with a policy per model.
- “Guaranteed GPUs for a planned product launch” points to a training plan for the endpoint.
- “Rarely used model must cost nothing when idle” points to inference components scaled to zero, with a queue for the first requests.
このタスクの内容 · 3.2
- Provisioned vs on-demand resources
- IaC for ML: CloudFormation, CDK and Service Catalog
- Containers for ML: images, ECR and own containers
- ECS, EKS and Batch for ML workloads
- SageMaker endpoints in a VPC
- Auto scaling endpoints and choosing metrics
- Scaling GPU and LLM workloads
Knowledge Bases
- Retrieval pipelines
- Agent state and memory management
- Agentic workflow infrastructure