Disaggregated Serving + LWS 멀티노드
개요
대형 LLM 추론은 두 가지 서로 다른 연산 단계(Prefill / Decode)로 나뉘며, 각 단계의 하드웨어 요구 프로파일이 다릅니다. 700B+ 모델은 단일 노드에 적재할 수 없어 멀티노드 파이프라인 병렬화가 필수입니다. 본 문서는 Disaggregated Serving 아키텍처와 LeaderWorkerSet(LWS) 기반 멀티노드 배포 패턴을 다룹니다.
Disaggregated Serving
Prefill/Decode 분리의 필요성
LLM 추론은 두 가지 근본적으로 다른 연산 단계로 구성됩니다.
| 단계 | 특성 | 병목 | GPU 요구 |
|---|---|---|---|
| Prefill | 입력 프롬프트 전체 처리 | Compute-bound | 높은 연산 능력 (TP=4) |
| Decode | 토큰 하나씩 순차 생성 | Memory-bound | 높은 메모리 대역폭 (TP=2) |
이 두 단계를 동일 Pod에서 처리하면, Prefill의 compute 부하가 Decode의 latency를 악화시킵니다. 분리하면 각 단계를 독립적으로 스케일링할 수 있어 GPU 활용률이 극대화됩니다.
분리 아키텍처
NIXL: 공통 KV Cache 전송 엔진
NIXL(NVIDIA Inference Xfer Library)은 llm-d, Dynamo, production-stack, aibrix 등 대부분의 프로젝트가 사용하는 공통 KV 전송 엔진입니다. NVLink/RDMA를 활용한 초고속 GPU 간 KV Cache 전송을 제공합니다.
EKS Auto Mode에서의 Disaggregated Serving
Auto Mode에서는 MIG 파티셔닝이 불가능하므로, 인스턴스(노드) 단위로 역할을 분리합니다.
# Prefill 전용 NodePool
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: gpu-prefill
spec:
template:
metadata:
labels:
llm-d-role: prefill
spec:
requirements:
- key: eks.amazonaws.com/instance-family
operator: In
values: ["p5"]
nodeClassRef:
group: eks.amazonaws.com
kind: NodeClass
name: default
taints:
- key: llm-d-role
value: prefill
effect: NoSchedule
---
# Decode 전용 NodePool
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: gpu-decode
spec:
template:
metadata:
labels:
llm-d-role: decode
spec:
requirements:
- key: eks.amazonaws.com/instance-family
operator: In
values: ["p5"]
nodeClassRef:
group: eks.amazonaws.com
kind: NodeClass
name: default
taints:
- key: llm-d-role
value: decode
effect: NoSchedule
GPU 배치 전략:
- Prefill: p5.48xlarge 1대에 Prefill Pod 2개 (각 TP=4, GPU 4개)
- Decode: p5.48xlarge 1대에 Decode Pod 4개 (각 TP=2, GPU 2개)
- 이를 통해 GPU 유휴를 최소화