dgd-gms-failover.yaml 3.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Example: DynamoGraphDeployment with inter-pod GMS (GPU Memory Service)
# failover on vLLM.
#
# Inter-pod GMS failover splits the traditional single-engine pod into:
#   * a dedicated GMS weight-server pod (per rank) that owns the model weights
#     and exposes them over a shared-GPU UDS, and
#   * N engine pods (per rank) that attach to the same GPUs via DRA and race
#     for a flock; the winner becomes primary, the others are hot shadows.
#
# This file contains two commented-out variants you can copy into .spec.services:
#
# Single-node GMS:
#   Creates per PCSG replica:
#     - 1 GMS weight-server pod   (<service>-gms-0)
#     - numShadows + 1 engine pods (<service>, replicas = numShadows + 1)
#   All engine pods + the GMS pod share the same GPUs via DRA ResourceClaims.
#   service.replicas controls how many PCSG replicas are created
#   (horizontal scale).
#
# Multinode GMS (N nodes):
#   Creates per PCSG replica:
#     - 1 GMS weight-server pod per rank   (<service>-gms-<rank>)
#     - numShadows + 1 engine pods per rank
#         rank 0: <service>-ldr   (leader,   replicas = numShadows + 1)
#         rank R: <service>-wkr-R (worker R, replicas = numShadows + 1)
#   Each rank's GMS + engine pods share GPUs via DRA within that node.
#   service.replicas controls horizontal PCSG replicas.
apiVersion: nvidia.com/v1alpha1
kind: DynamoGraphDeployment
metadata:
  name: llm-serving-mn
spec:
  backendFramework: vllm
  services:
    # ─── Single-node GMS failover ───
    # agg:
    #   componentType: worker
    #   replicas: 1
    #   resources:
    #     limits:
    #       gpu: "1"
    #       # gpuType: gpu.nvidia.com/h100
    #   failover:
    #     enabled: true
    #     mode: interPod
    #     numShadows: 1        # 1 primary + 1 shadow = 2 engine pods per PCSG replica
    #   extraPodSpec:
    #     mainContainer:
    #       image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:latest
    #       command: ["python3", "-m", "dynamo.vllm"]
    #       args: ["--model", "Qwen/Qwen3-0.6B", "--tensor-parallel-size", "1", "--enforce-eager", "--gpu-memory-utilization", "0.85"]
    #   sharedMemory:
    #     size: 16Gi

    # ─── Multinode GMS failover (2 nodes) ───
    agg:
      envFromSecret: hf-token-secret
      componentType: worker
      replicas: 1
      multinode:
        nodeCount: 2
      resources:
        limits:
          gpu: "1"
          # gpuType: gpu.nvidia.com/h100
      failover:
        enabled: true
        mode: interPod
        numShadows: 1       # 1 primary + 1 shadow = 2 engine pods per rank
      extraPodSpec:
        mainContainer:
          image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:latest
          command: ["python3", "-m", "dynamo.vllm"]
          # args: ["--model", "Qwen/Qwen3-235B-A22B", "--tensor-parallel-size", "8", "--enforce-eager", "--gpu-memory-utilization", "0.85"]
          args: ["--model", "Qwen/Qwen3-0.6B", "--tensor-parallel-size", "2", "--enforce-eager", "--gpu-memory-utilization", "0.85"]

      # sharedMemory:
      #   size: 16Gi

    # ─── Regular frontend (no failover) ───
    frontend:
      envFromSecret: hf-token-secret
      componentType: frontend
      replicas: 1
      extraPodSpec:
        mainContainer:
          image: nvcr.io/nvidia/ai-dynamo/vllm-runtime:latest
          # command: ["python3", "-m", "dynamo.frontend"]