| name | gpu-resource-management |
| description | Design GPU orchestration on EKS using Karpenter v1.2+ NodePools, KEDA scale-to-zero, and DRA 1.35 GA for multi-instance GPU (MIG) partitioning. Right-size NodePool for p5/g6e/trn2 instance mix, spot/on-demand split, consolidation, and topology-aware scheduling. |
| argument-hint | [workload profile โ training/inference, GPU mix, QPS pattern] |
| user-invocable | true |
| model | claude-sonnet-4-6 |
| allowed-tools | Read,Write,Edit,Bash,Grep,Glob,mcp__eks,mcp__aws-pricing,mcp__aws-documentation,mcp__prometheus |
When to Use
- GPU NodePool ์ค๊ณ ๋ฐ Karpenter v1.2+ consolidation ์ ์ฑ
์กฐ์ ์ด ํ์ํ ๋
- KEDA ๋ก scale-to-zero, HPA ๋ก Pod ์์ค ์ค์ผ์ผ๋ง ์ ์ฑ
์ ์๋ฆฝํ ๋
- DRA 1.35 GA ๋ก MIG(Multi-Instance GPU) ํํฐ์
๋์ ์ ์ฉํ ๋
- Spot vs On-Demand ๋น์จ, Reserved Instance vs Savings Plans ๊ตฌ์ฑ ๊ฒํ
When NOT to Use
- CPU-only ์ํฌ๋ก๋ โ ๋ณธ ์คํฌ์ GPU ์ ์ฉ
- Managed ํ๊ฒฝ(SageMaker endpoints) ์ฌ์ฉ ์ค โ ๋ณ๋ ์คํฌ
- GPU Operator ๋ฏธ์ค์น โ
agentic-eks-bootstrap ์ ํ
Preconditions
- EKS 1.32+, Kubernetes DRA 1.35 GA ํ์ฑ(
--feature-gates=DynamicResourceAllocation=true)
- Karpenter v1.2+, NVIDIA GPU Operator, DCGM Exporter, Prometheus ์ค์น
- ๋์ ๋ฆฌ์ ์์ p5/g6e/trn2 ์ฟผํฐ ํ์ธ ์๋ฃ
Procedure
Step 1. NodePool ์ค๊ณ
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: gpu-inference-pool
spec:
template:
metadata:
labels:
node-type: gpu-inference
workload: genai
spec:
requirements:
- key: kubernetes.io/arch
operator: In
values: ["amd64"]
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand", "spot"]
- key: node.kubernetes.io/instance-type
operator: In
values: ["p5.48xlarge", "g6e.12xlarge", "g6e.48xlarge"]
taints:
- key: nvidia.com/gpu
value: "true"
effect: NoSchedule
nodeClassRef:
name: default
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 30s
limits:
nvidia.com/gpu: 64
Step 2. Spot / On-Demand ๋น์จ ์ ๋ต
- ์ถ๋ก (inference): Spot 70% + On-Demand 30%, HPA min=1 ์ ์ง
- ํ์ต (training): Savings Plans ๋๋ Capacity Blocks for ML
- Reserved Instance: 24/7 baseline ์ํฌ๋ก๋์๋ง ์ ์ฉ
Step 3. KEDA ScaledObject (Scale-to-Zero)
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: vllm-scaler
namespace: inference
spec:
scaleTargetRef:
name: vllm-llama3
minReplicaCount: 0
maxReplicaCount: 8
triggers:
- type: prometheus
metadata:
serverAddress: http://prometheus.observability.svc:9090
metricName: vllm_num_requests_running
threshold: "4"
query: sum(rate(vllm_num_requests_running[1m]))
Step 4. DRA 1.35 GA - MIG ํํฐ์
๋
- H100 80GB ๋ฅผ
1g.10gb ร 7 ๋ก ๋ถํ ํ๋ฉด ์ํ ๋ชจ๋ธ 7๊ฐ ๋์ ์๋น
ResourceClaim + DeviceClass ๋ฆฌ์์ค๋ก Pod ์ ๋์ ํ ๋น
apiVersion: resource.k8s.io/v1beta1
kind: ResourceClaimTemplate
metadata:
name: mig-1g10gb
spec:
spec:
devices:
requests:
- name: gpu
deviceClassName: nvidia.com/mig-1g.10gb
Step 5. Topology-Aware Routing
- NCCL ํต์ ์ต์ํ: ๊ฐ์ AZ, ๊ฐ์ placement group ๋ด TP ๊ทธ๋ฃน ๋ฐฐ์น
topologySpreadConstraints ๋ก AZ ๋ถ์ฐ DP, ๋์ผ ๋
ธ๋ ๋ด TP
Step 6. ๋น์ฉ ๊ด์ธก + ์๋ฆผ
- Prometheus:
DCGM_FI_DEV_GPU_UTIL, DCGM_FI_DEV_MEM_COPY_UTIL
- KubeCost + AWS Cost Explorer ํ๊ทธ
- ์๋ฆผ: GPU util < 20% 30๋ถ ์ง์ ์ Slack ์๋ฆผ, consolidation ๊ฒํ
Good Examples
- ์ถ๋ก NodePool: p5 + g6e ํผํฉ, Spot 70%, consolidation 30s, KEDA scale-to-zero
- MIG: H100 80GB โ
1g.10gb ร 7 โ 7B-14B ๋ชจ๋ธ 7๊ฐ ๋์
- DRA 1.35 ๋ก ResourceClaim ๊ธฐ๋ฐ fractional GPU ํ ๋น
Bad Examples (๊ธ์ง)
- Karpenter v0.x legacy API (
provisioner.karpenter.sh) โ v1 migration ํ์
- ๋จ์ผ ์ธ์คํด์ค ํ์
์ ์ฝ โ ์ฟผํฐ ๋ถ์กฑ ์ Pending ๋ฌดํ ๋๊ธฐ
- GPU idle ์ํ ๋ฐฉ์น โ Spot ์ธ์คํด์ค๋ก๋ ๋น์ฉ ๋์
- MIG ์์ด 7B ๋ชจ๋ธ 7๊ฐ๋ฅผ ๋์ผ GPU ์ ๊ณต์ (device plugin time-slicing ์์กด) โ latency ๋ณ๋
References