You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tools/recipes/README.md
+71-72Lines changed: 71 additions & 72 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,24 @@
2
2
3
3
Utilities for consuming deployment configurations from [vLLM Recipes](https://recipes.vllm.ai/) and converting them into files that can be used directly with vLLM.
4
4
5
+
6
+
## Optimized Deployment Flow
7
+
8
+
The recipe provides the validated deployment baseline. Hardware and workload
9
+
information are optional inputs that can refine deployment-sensitive values
10
+
before the generated configuration is passed to vLLM.
11
+
12
+
```mermaid
13
+
flowchart LR
14
+
R["vLLM Recipe"] --> C["Recipe Converter"]
15
+
H["Hardware Info (optional)"] --> C
16
+
W["Workload Info (optional)"] --> C
17
+
C --> F["config.yml + env.sh"]
18
+
F --> D["vLLM Docker Image"]
19
+
D --> E["OpenAI Endpoint"]
20
+
```
21
+
22
+
5
23
## `recipe_json_to_vllm_config.py`
6
24
7
25
Converts a hardware-specific vLLM Recipes JSON rendering into:
@@ -157,31 +175,64 @@ Single-process renderings such as `single_node_tp` can be converted directly. Mu
157
175
158
176
## Optional Runtime Tuning
159
177
160
-
The Recipes JSON remains the baseline. vLLM Recipes contain the validated model,
161
-
hardware, strategy, environment variables, and serving arguments for a known
162
-
configuration. Runtime tuning is optional and refines only deployment-sensitive
163
-
arguments when more information about the user's actual hardware or workload is
164
-
available.
178
+
The Recipes JSON remains the baseline. vLLM Recipes already provide validated
179
+
model, hardware, strategy, environment variables, and serving arguments.
180
+
Runtime tuning is optional and is intended for parameters whose best value can
181
+
depend on the actual deployment resources or expected request workload.
182
+
183
+
### Deployment-Time Parameters
184
+
185
+
The parameters below may already exist in a recipe. They are candidates for
186
+
deployment-time refinement when the recipe value is missing, generic, or based
187
+
on a validation environment that differs from the user's target deployment.
188
+
189
+
| Runtime parameter | Why it may need deployment-time refinement | Main decision input | Current draft policy |
190
+
| --- | --- | --- | --- |
191
+
| `tensor-parallel-size` | The effective CPU/NUMA topology available to a container or pod can differ from the system used to validate the recipe. | Hardware topology | Use the largest power-of-two TP value that does not exceed the effective NUMA-node count. |
192
+
| `gpu-memory-utilization` | Available memory can differ by machine size, container limits, and other memory use. The vLLM option name is also used by the CPU backend. | Hardware memory + recipe baseline | Compute a conservative safe fraction, reserve 10%, cap at `0.90`, and never increase a smaller recipe value. If the recipe omits it, start from `0.80`. |
193
+
| `max-num-seqs` | The useful scheduler concurrency depends on the number of requests expected to be active at the same time. | Workload concurrency | Set `max-num-seqs` to `--concurrency`. |
194
+
| `max-num-batched-tokens` | The batching budget depends strongly on request input length and concurrency. | Workload token shape + concurrency | Compute `input_tokens * min(concurrency, 8)`, round up to a power of two, and clamp to `2048..32768`. |
195
+
| `data-parallel-size` | The required replica count depends on the requested throughput and the capacity of one replica. | Capacity target | Keep the recipe value today. `--target-qps` is captured for a future capacity-based policy. |
196
+
197
+
These policies are intentionally isolated in `runtime_tuning.py` so the
198
+
decision rules can evolve as more benchmark data becomes available.
165
199
166
-
This is useful because some performance parameters may be absent from a recipe,
167
-
may use a general/default value, or may have been selected for the hardware and
168
-
workload used when that recipe was validated. The converter does not replace
169
-
Recipes; it adapts the recipe baseline to the deployment context available when
170
-
`config.yml`is generated.
200
+
### How Runtime Tuning Determines the Values
171
201
172
-
### Information Used for Runtime Tuning
202
+
The converter can combine the recipe baseline with optional deployment
203
+
information. Different information sources are used for different parameters:
173
204
174
-
| Information source | How the tool gets it | Examples | Purpose |
205
+
| Information source | How it is obtained | Examples | Parameters it can help determine |
175
206
| --- | --- | --- | --- |
176
-
| vLLM Recipe | Recipes JSON API or direct recipe JSON | model ID, recipe hardware, strategy, existing `argv`, environment variables | Provides the validated baseline and identifies which hardware tuning policy may be used. |
| Workload | Optional CLI inputs | `--input-tokens`, `--output-tokens`, `--concurrency` | Refines scheduler concurrency and batching for the expected request shape. |
179
-
| SLO / capacity | Optional CLI inputs | `--ttft-sla-ms`, `--tpot-sla-ms`, `--target-qps` | Supplies constraints for current or future SLA/capacity-aware policies. |
207
+
| vLLM Recipe | Recipes JSON API or direct recipe JSON | model ID, recipe hardware, strategy, existing `argv`, environment variables | Provides the baseline for all parameters and selects the applicable hardware tuning policy. |
| Workload (optional) | User CLI inputs | `--input-tokens`, `--output-tokens`, `--concurrency` | `max-num-seqs`, `max-num-batched-tokens`; output length is also available for future KV-cache-aware policies. |
### Parameters That May Need Deployment-Time Refinement
199
-
200
-
vLLM Recipes can already contain the parameters below. Runtime tuning is useful
201
-
when a parameter is missing or when the recipe's validated value does not match
202
-
the resources or workload of the target deployment.
203
-
204
-
| Runtime parameter | Why the recipe alone may not be enough | Additional information used | Current draft policy |
205
-
| --- | --- | --- | --- |
206
-
| `tensor-parallel-size` | The recipe topology may differ from the NUMA resources actually available to the container or pod. | Effective NUMA-node count from `--detect-hardware` | Use the largest power-of-two TP value that does not exceed the effective NUMA-node count. |
207
-
| `gpu-memory-utilization` | Available memory can differ because of machine size, container limits, or other memory use. The vLLM option name is also used by the CPU backend. | Per-NUMA total/available memory plus the recipe value, if present | Compute a conservative safe fraction, reserve 10%, cap at `0.90`, and never increase a smaller recipe value. If the recipe omits it, start from `0.80`. |
208
-
| `max-num-seqs` | The best scheduler concurrency depends on the expected number of concurrent requests. | `--concurrency` | Set `max-num-seqs` to the requested concurrency. |
209
-
| `max-num-batched-tokens` | The useful batching budget depends strongly on request input length and concurrency. | `--input-tokens` and `--concurrency` | Compute `input_tokens * min(concurrency, 8)`, round up to a power of two, and clamp to `2048..32768`. |
210
-
| `data-parallel-size` | The required replica count depends on target throughput and the capacity of one replica. | `--target-qps` plus a future per-replica capacity model | Keep the recipe value today. `target_qps` is recorded for future capacity-based tuning. |
211
-
212
249
`--output-tokens`, `--ttft-sla-ms`, and `--tpot-sla-ms` are accepted as policy
213
250
inputs, but the current draft does not force them into an arbitrary formula.
214
251
Output length affects KV-cache residency and request lifetime, while TTFT and
215
252
TPOT constrain how aggressive scheduler batching can be. These inputs can be
216
253
used once benchmark-derived or otherwise validated decision rules are available.
217
254
218
-
The effective precedence is:
219
-
220
-
```text
221
-
vLLM defaults
222
-
-> vLLM Recipes baseline
223
-
-> optional hardware refinement
224
-
-> optional workload/SLO refinement
225
-
-> config.yml + env.sh
226
-
```
227
-
228
255
### Runtime-Tuning Hardware Scope
229
256
230
257
Runtime tuning is selected from the resolved recipe JSON's `hardware` field,
231
258
rather than by inspecting which physical devices happen to be present on the
232
259
host. This matters because a GPU server also exposes its host CPU topology.
233
260
234
-
The current runtime-tuning policy registry contains `xeon6`:
0 commit comments