NVIDIA Dynamo
NVIDIA Dynamo là runtime inference phân tán ở quy mô datacenter. Dynamo là lớp orchestration nằm trên inference engine (TensorRT-LLM, vLLM, SGLang), không thay thế engine. Trên Kubernetes nhiều node, Dynamo biến cluster GPU thành hệ thống inference thống nhất: routing, disaggregated serving, quản lý KV cache, autoscaling theo SLA.
Nguồn: Overall Architecture, GitHub ai-dynamo/dynamo.
Ba mặt phẳng kiến trúc
Dynamo tách ba concern: request path, control path, state path.
flowchart TB
subgraph RP[Request Plane]
C[Client] --> FE[Frontend]
FE --> RT[Router]
RT --> PW[Prefill worker]
RT --> DW[Decode worker]
PW -->|NIXL| DW
DW --> FE
end
subgraph CP[Control Plane]
PL[Planner] --> OP[Dynamo Operator]
OP --> GV[Grove / KAI Scheduler]
end
subgraph SP[Storage and Events Plane]
KVE[KV Events]
KVBM[KVBM]
NIXL[NIXL]
end
RT -.-> KVE
PW -.-> KVBM
DW -.-> KVBM
| Plane | Thành phần | Mục tiêu |
|---|---|---|
| Request | Frontend, Router, Prefill worker, Decode worker | Thực thi request, stream token, độ trễ thấp |
| Control | Planner, Dynamo Operator, Grove | Scale, placement, reconcile desired state |
| Storage and Events | KV Events, KVBM, NIXL | Tái sử dụng KV, offload đa tầng, chuyển KV giữa worker |
Mục tiêu thiết kế: TTFT và ITL ổn định; GPU hiệu quả qua tách prefill/decode; giảm recompute KV; chịu pod restart và overload; portable trên Kubernetes.
Request Plane
Frontend nhận request, chuẩn hóa API OpenAI-compatible, chuyển tiếp tới Router.
Router chọn worker theo load và KV overlap (KV-aware routing). Với disaggregated serving, Router điều phối PrefillRouter: chọn prefill worker, nhận metadata chuyển KV, chọn decode worker, inject metadata vào decode request.
Prefill worker chạy phase prefill, sinh KV cache.
Decode worker nhận KV (qua NIXL), chạy phase decode, stream token về Frontend.
Luồng disaggregated (Disaggregated Serving):
- Client → Frontend → Router.
- Router chọn Prefill worker (KV-aware hoặc load balancing).
- Prefill tính KV, trả
disaggregated_params(metadata backend: SGLangbootstrap_info, vLLMkv_transfer_params, TensorRT-LLMopaque_state). - Router chọn Decode worker, inject metadata.
- NIXL chuyển KV VRAM prefill → VRAM decode (NVLink, InfiniBand/UCX); transfer không block hoàn toàn GPU forward.
- Decode stream token; KV Events cập nhật index; KVBM offload/recall theo áp lực bộ nhớ.
Prefill (compute-bound) và decode (memory-bound) scale độc lập trên pool worker riêng.
Control Plane trên Kubernetes
Triển khai production qua Helm chart dynamo-platform (Deployment Guide).
Dynamo Operator reconcile Custom Resource:
DynamoGraphDeploymentRequest(DGDR): profiling model/hardware, tạo deployment tự cấu hình, trạng thái terminal giống Job.DynamoGraphDeployment(DGD): resource persist, mô tả graph serving (Frontend, worker, Planner).
Planner đọc metrics runtime (TTFT, ITL, load), tính target replica cho pool prefill và decode, áp qua connector layer. Chiến lược throughput-based và load-based.
Grove là API Kubernetes cho orchestration workload AI disaggregated, tích hợp Dynamo (Grove):
| CR Grove | Vai trò |
|---|---|
| PodCliqueSet | Nhóm component colocated, autoscale, topology spread |
| PodClique | Pod cùng role (leader, worker, frontend) |
| PodCliqueScalingGroup | Nhóm PodClique scale và schedule cùng nhau (vd. prefill leader + worker) |
Grove cung cấp gang scheduling, scale ngang đa cấp theo component, startup dependency, topology constraint. Operator map DGD → PodCliqueSet / PodClique / PodCliqueScalingGroup với replicas và min riêng cho nhóm Prefill và Decode.
Topology Aware Scheduling (opt-in trên DGD): topologyProfile tham chiếu ClusterTopology CR; packDomain (vd. rack) đặt replica trong cùng domain mạng để giảm latency prefill↔decode↔router. Cần Grove, KAI Scheduler, ClusterTopology (TAS).
flowchart LR
M[Metrics] --> PL[Planner]
PL --> OP[Operator]
OP --> DGD[DynamoGraphDeployment]
DGD --> GV[Grove]
GV --> P[Prefill pods]
GV --> D[Decode pods]
Storage and Events Plane
KV Events publish vòng đời KV cache; Router dùng cho routing quyết định sau.
KVBM (KV Block Manager) quản lý block reuse, eviction, offload/recall GPU → CPU → SSD → remote storage.
NIXL thực hiện transfer KV/data tốc độ cao giữa worker và memory domain.
Dynamo backend-agnostic: TensorRT-LLM, vLLM, SGLang đều hỗ trợ disaggregated serving và KV-aware routing; KVBM đầy đủ trên TensorRT-LLM và vLLM (Feature Matrix).
Service discovery trên Kubernetes
Mặc định discovery backend Kubernetes, không bắt buộc etcd ngoài cluster (Service Discovery):
- Mỗi worker pod tạo
DynamoWorkerMetadataCR (endpoint, model card), owner reference tới Pod. - EndpointSlices theo Service do Operator tạo; readiness probe khi endpoint
generatehealthy. - Discovery daemon trong pod chỉ expose worker khi EndpointSlice ready và có metadata tương ứng.
KV-aware routing prefix coordination cần NATS (JetStream) trong platform Helm.
Legacy: annotation nvidia.com/dynamo-discovery-backend: etcd trên DGD.
Fault tolerance
| Layer | Cơ chế |
|---|---|
| Request | Migration, cancellation |
| Worker | Health check, graceful shutdown, drain endpoint |
| System | Load shedding, request rejection |
| Infrastructure | Discovery lease expiry, event-path recovery |
Worker crash được xử lý như sự kiện vận hành thường xuyên, không ngoại lệ.
Khi nào dùng Dynamo trên Kubernetes multinode
Phù hợp khi: serving nhiều GPU/node; cần KV-aware routing; scale tách prefill/decode; autoscaling theo SLA TTFT/ITL.
Không cần Dynamo khi: một model trên một GPU — inference engine đơn thường đủ.
Liên kết
- TensorRT-LLM - backend inference trong worker pod Dynamo
- LMCache - lớp KV cache phân tán bổ sung cho KVBM và NIXL
- Quá trình inference của Large Language Model - disaggregated serving tách pha prefill và decode dựa trên KV cache
- Kết nối vLLM và LMCache server trên Dynamo Kubernetes - các issue khi nối vLLM tới LMCacheMPConnector
- Quá trình inference của Large Language Model - prefill/decode và KV cache cơ bản
- Lập lịch dựa trên độ trễ dự đoán cho LLM - thay thế trọng số heuristic thủ công của load balancer bằng dự đoán độ trễ
- Kubernetes Monitoring - observability cluster inference