disagg_planner.yaml 5.3 KB
Newer Older
1
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
3
# SPDX-License-Identifier: Apache-2.0

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
# ──────────────────────────────────────────────────────────────────────────────
# Planner profiling data ConfigMap
#
# The planner requires pre-deployment profiling data (prefill & decode
# interpolation curves) for throughput-based scaling.  The values below are
# PLACEHOLDERS for Qwen/Qwen3-0.6B — replace them with real measurements
# before deploying to production.
#
# How to obtain real data:
#   • Run the Dynamo Profiler against your target GPU/model combination.
#     See docs/components/profiler/profiler-guide.md for instructions.
#   • Or run manual benchmarks and fill in the arrays below.
#
# Key format (JSON files mounted into the planner container):
#   prefill_raw_data.json — prefill_isl (input sequence lengths),
#       prefill_ttft (time-to-first-token in ms), prefill_thpt_per_gpu
#       (tokens/s per GPU) — all 1-D arrays of equal length.
#   decode_raw_data.json  — x_kv_usage (KV-cache utilisation fractions),
#       y_context_length (context lengths), z_itl (inter-token latency in ms,
#       shape [len(x_kv_usage), len(y_context_length)]), z_thpt_per_gpu
#       (tokens/s per GPU, same shape), max_kv_tokens (scalar).
# ──────────────────────────────────────────────────────────────────────────────
apiVersion: v1
kind: ConfigMap
metadata:
  name: planner-profile-data
data:
  prefill_raw_data.json: |
    {
      "prefill_isl":          [128, 256, 512, 1024, 2048],
      "prefill_ttft":         [12,  18,  30,  55,   105],
      "prefill_thpt_per_gpu": [9800, 8500, 6200, 3800, 2000]
    }
  decode_raw_data.json: |
    {
      "x_kv_usage":       [0.1, 0.3, 0.5, 0.7, 0.9],
      "y_context_length":  [128, 512, 1024, 2048],
      "z_itl": [
        [5,  6,  7,  9 ],
        [6,  7,  8,  10],
        [7,  8,  10, 12],
        [8,  10, 12, 15],
        [10, 12, 15, 20]
      ],
      "z_thpt_per_gpu": [
        [4500, 4000, 3500, 2800],
        [4200, 3700, 3200, 2500],
        [3800, 3300, 2800, 2200],
        [3400, 2900, 2400, 1800],
        [2800, 2400, 1900, 1400]
      ],
      "max_kv_tokens": 32768
    }
---
58
59
60
61
62
63
64
apiVersion: nvidia.com/v1alpha1
kind: DynamoGraphDeployment
metadata:
  name: sglang-disagg-planner
spec:
  services:
    Frontend:
65
      componentType: frontend
66
67
68
      replicas: 1
      extraPodSpec:
        mainContainer:
69
          image: my-registry/sglang-runtime:my-tag
70
71
72
73
74
75
    Planner:
      envFromSecret: hf-token-secret
      componentType: planner
      replicas: 1
      extraPodSpec:
        mainContainer:
76
          image: my-registry/sglang-runtime:my-tag
julienmancuso's avatar
julienmancuso committed
77
          command:
78
79
          - python3
          - -m
80
          - dynamo.planner
81
          args:
82
83
            - --config
            - '{"environment": "kubernetes", "backend": "sglang", "throughput_adjustment_interval": 60, "profile_results_dir": "/workspace/profiling_results"}'
84
85
86
87
88
89
90
91
          volumeMounts:
            - name: planner-profile-data
              mountPath: /workspace/profiling_results
              readOnly: true
        volumes:
          - name: planner-profile-data
            configMap:
              name: planner-profile-data
92
    decode:
93
94
      envFromSecret: hf-token-secret
      componentType: worker
95
      subComponentType: decode
96
97
98
99
100
101
      replicas: 2
      resources:
        limits:
          gpu: "1"
      extraPodSpec:
        mainContainer:
102
          image: my-registry/sglang-runtime:my-tag
103
          workingDir: /workspace/examples/backends/sglang
julienmancuso's avatar
julienmancuso committed
104
          command:
105
            - python3
106
          args:
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
            - -m
            - dynamo.sglang
            - --model-path
            - Qwen/Qwen3-0.6B
            - --served-model-name
            - Qwen/Qwen3-0.6B
            - --page-size
            - "16"
            - --tp
            - "1"
            - --trust-remote-code
            - --skip-tokenizer-init
            - --disaggregation-mode
            - decode
            - --disaggregation-transfer-backend
            - nixl
123
124
125
126
            - --disaggregation-bootstrap-port
            - "12345"
            - --host
            - "0.0.0.0"
127
    prefill:
128
129
      envFromSecret: hf-token-secret
      componentType: worker
130
      subComponentType: prefill
131
132
133
134
135
136
      replicas: 2
      resources:
        limits:
          gpu: "1"
      extraPodSpec:
        mainContainer:
137
          image: my-registry/sglang-runtime:my-tag
138
          workingDir: /workspace/examples/backends/sglang
julienmancuso's avatar
julienmancuso committed
139
          command:
140
            - python3
141
          args:
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
            - -m
            - dynamo.sglang
            - --model-path
            - Qwen/Qwen3-0.6B
            - --served-model-name
            - Qwen/Qwen3-0.6B
            - --page-size
            - "16"
            - --tp
            - "1"
            - --trust-remote-code
            - --skip-tokenizer-init
            - --disaggregation-mode
            - prefill
            - --disaggregation-transfer-backend
            - nixl
158
159
160
161
            - --disaggregation-bootstrap-port
            - "12345"
            - --host
            - "0.0.0.0"