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):

  1. Client → Frontend → Router.
  2. Router chọn Prefill worker (KV-aware hoặc load balancing).
  3. Prefill tính KV, trả disaggregated_params (metadata backend: SGLang bootstrap_info, vLLM kv_transfer_params, TensorRT-LLM opaque_state).
  4. Router chọn Decode worker, inject metadata.
  5. NIXL chuyển KV VRAM prefill → VRAM decode (NVLink, InfiniBand/UCX); transfer không block hoàn toàn GPU forward.
  6. 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:

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 replicasmin 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):

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 đủ.