ado-vllm-performance 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ado_vllm_performance-1.2.1/PKG-INFO +492 -0
- ado_vllm_performance-1.2.1/README.md +480 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/__init__.py +6 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/actuator.py +219 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/actuator_definitions.yaml +6 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/actuator_parameters.py +56 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/env_manager.py +161 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/experiment_executor.py +426 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/experiments.yaml +321 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/geospatial_valencia.jsonl +1 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/k8/create_environment.py +146 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/k8/manage_components.py +358 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/k8/yaml_support/build_components.py +251 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/k8/yaml_support/deployment.yaml +73 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/k8/yaml_support/pvc.yaml +16 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/k8/yaml_support/service.yaml +20 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/vllm_performance_test/execute_benchmark.py +163 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/vllm_performance_test/get_benchmark_results.py +42 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/vllm_performance_test/payload_test.json +15 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/vllm_performance_test/payload_test_simple.json +4 -0
- ado_vllm_performance-1.2.1/ado_actuators/vllm_performance/vllm_performance_test/test.txt +17 -0
- ado_vllm_performance-1.2.1/ado_vllm_performance.egg-info/PKG-INFO +492 -0
- ado_vllm_performance-1.2.1/ado_vllm_performance.egg-info/SOURCES.txt +34 -0
- ado_vllm_performance-1.2.1/ado_vllm_performance.egg-info/dependency_links.txt +1 -0
- ado_vllm_performance-1.2.1/ado_vllm_performance.egg-info/requires.txt +6 -0
- ado_vllm_performance-1.2.1/ado_vllm_performance.egg-info/top_level.txt +2 -0
- ado_vllm_performance-1.2.1/pyproject.toml +47 -0
- ado_vllm_performance-1.2.1/setup.cfg +4 -0
- ado_vllm_performance-1.2.1/uv.lock +5234 -0
- ado_vllm_performance-1.2.1/vllm_testing.png +0 -0
- ado_vllm_performance-1.2.1/yamls/discoveryspace_override_defaults.yaml +54 -0
- ado_vllm_performance-1.2.1/yamls/discoveryspace_override_defaults_small.yaml +54 -0
- ado_vllm_performance-1.2.1/yamls/operation_hyperopt.yaml +19 -0
- ado_vllm_performance-1.2.1/yamls/random_walk_operation.yaml +17 -0
- ado_vllm_performance-1.2.1/yamls/random_walk_operation_grouped.yaml +30 -0
- ado_vllm_performance-1.2.1/yamls/vllm_request_rate_space.yaml +22 -0
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ado-vllm-performance
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: VLLM performance testing actuator
|
|
5
|
+
Description-Content-Type: text/markdown
|
|
6
|
+
Requires-Dist: kubernetes>=31.0.0
|
|
7
|
+
Requires-Dist: transformers>=4.45.0
|
|
8
|
+
Requires-Dist: huggingface_hub
|
|
9
|
+
Requires-Dist: datasets
|
|
10
|
+
Requires-Dist: numpy>=2
|
|
11
|
+
Requires-Dist: vllm>=0.10.1.1
|
|
12
|
+
|
|
13
|
+
<!-- markdownlint-disable code-block-style -->
|
|
14
|
+
<!-- markdownlint-disable-next-line first-line-h1 -->
|
|
15
|
+
This repository contains the vLLM `ado` actuator for benchmarking LLM inference
|
|
16
|
+
performance with vLLM. (For more about Actuators, what they represent, how to
|
|
17
|
+
create them etc., see the `ado`
|
|
18
|
+
[docs](https://ibm.github.io/ado/actuators/working-with-actuators/)).
|
|
19
|
+
|
|
20
|
+
The actuator implements a set of functionalities to deploy and run serving
|
|
21
|
+
benchmarks for different LLMs for vLLM. This actuator deploys
|
|
22
|
+
[vLLM](https://github.com/vllm-project/vllm) on to an
|
|
23
|
+
[OpenShift](https://www.redhat.com/en/technologies/cloud-computing/openshift)
|
|
24
|
+
cluster to serve
|
|
25
|
+
[IBM Granite-3.3-8b](https://huggingface.co/ibm-granite/granite-3.3-8b-instruct)
|
|
26
|
+
and runs an experiment that utilises the
|
|
27
|
+
[vLLM serving benchmark](https://docs.vllm.ai/en/stable/api/vllm/benchmarks/serve.html).
|
|
28
|
+
The the actuator is named `vllm_performance` and features two experiments:
|
|
29
|
+
`performance-testing-full` and `performance-testing-endpoint`.
|
|
30
|
+
|
|
31
|
+
# Getting Started
|
|
32
|
+
|
|
33
|
+
This guide has two parts:
|
|
34
|
+
|
|
35
|
+
- [Getting Started](#getting-started)
|
|
36
|
+
- [Installing and configuring the vLLM actuator](#installing-and-configuring-the-vllm-actuator)
|
|
37
|
+
- [Installation](#installation)
|
|
38
|
+
- [Configuring the actuator](#configuring-the-actuator)
|
|
39
|
+
- [A Simple Benchmarking Exercise](#a-simple-benchmarking-exercise)
|
|
40
|
+
- [Creating a Discovery Space to describe the vLLM configurations to test](#creating-a-discovery-space-to-describe-the-vllm-configurations-to-test)
|
|
41
|
+
- [Activating the local context](#activating-the-local-context)
|
|
42
|
+
- [Defining a Discovery Space of vLLM configurations](#defining-a-discovery-space-of-vllm-configurations)
|
|
43
|
+
- [Querying the Discovery Space](#querying-the-discovery-space)
|
|
44
|
+
- [Exploring the vLLM workload configuration space](#exploring-the-vllm-workload-configuration-space)
|
|
45
|
+
- [Exploring Further](#exploring-further)
|
|
46
|
+
- [vLLM testing approach](#vllm-testing-approach)
|
|
47
|
+
- [The Actuator Package: Key Files](#the-actuator-package-key-files)
|
|
48
|
+
- [Customising Actuator Configurations](#customising-actuator-configurations)
|
|
49
|
+
- [Customising Experiment Protocol](#customising-experiment-protocol)
|
|
50
|
+
- [Notes on the Random walk operation](#notes-on-the-random-walk-operation)
|
|
51
|
+
- [A few ideas for further exploration](#a-few-ideas-for-further-exploration)
|
|
52
|
+
|
|
53
|
+
After running the exercise, please feel free to
|
|
54
|
+
[explore further](#exploring-further) and
|
|
55
|
+
[try a larger experiment](#a-few-ideas-for-further-exploration).
|
|
56
|
+
|
|
57
|
+
> [!NOTE]
|
|
58
|
+
>
|
|
59
|
+
> These prerequisites must be fulfilled before you start with this actuator
|
|
60
|
+
>
|
|
61
|
+
> 1. Access to an OpenShift cluster with at least 1 node with 1 available
|
|
62
|
+
> NVIDIA GPU. You will need access to a namespace with permissions for
|
|
63
|
+
> GPU-based deployments
|
|
64
|
+
> 2. You will need to have downloaded and installed `ado` according to
|
|
65
|
+
> [this guide](https://ibm.github.io/ado/getting-started/install/).
|
|
66
|
+
|
|
67
|
+
## Installing and configuring the vLLM actuator
|
|
68
|
+
|
|
69
|
+
### Installation
|
|
70
|
+
|
|
71
|
+
Ensure the virtual environment you installed `ado` into is active. Then, run:
|
|
72
|
+
|
|
73
|
+
<!-- ```commandline
|
|
74
|
+
pip install ado-vllm-performance
|
|
75
|
+
``` -->
|
|
76
|
+
|
|
77
|
+
```commandline
|
|
78
|
+
pip install -e plugins/actuators/vllm_performance
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
from the root of the `ado` source repository.
|
|
82
|
+
You can clone the repository with
|
|
83
|
+
|
|
84
|
+
```commandline
|
|
85
|
+
git clone https://github.com/IBM/ado.git
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Confirm that the actuator is installed:
|
|
89
|
+
|
|
90
|
+
```commandline
|
|
91
|
+
ado get actuators --details
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
You should see an output like below:
|
|
95
|
+
|
|
96
|
+
```commandline
|
|
97
|
+
ACTUATOR ID CATALOG ID EXPERIMENT ID SUPPORTED
|
|
98
|
+
0 mock mock test-experiment True
|
|
99
|
+
1 mock mock test-experiment-two True
|
|
100
|
+
2 vllm_performance vllm_performance performance-testing-full True
|
|
101
|
+
3 vllm_performance vllm_performance performance-testing-endpoint True
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
On the last two lines you can see the new actuator and the experiments. You can
|
|
105
|
+
understand the
|
|
106
|
+
[constitutive properties required for the experiment](https://ibm.github.io/ado/core-concepts/actuators/#experiments)
|
|
107
|
+
and the
|
|
108
|
+
[target and observed properties](https://ibm.github.io/ado/core-concepts/actuators/#target-and-observed-properties)
|
|
109
|
+
measured by an experiment by running:
|
|
110
|
+
|
|
111
|
+
```commandline
|
|
112
|
+
ado describe experiment performance-testing-full
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The experiment protocol for the vLLM actuator is defined in
|
|
116
|
+
[this YAML file](https://github.com/IBM/ado/blob/main/plugins/actuators/vllm_performance/ado_actuators/vllm_performance/experiments.yaml).
|
|
117
|
+
You will need to update this if you want to modify the values that can be
|
|
118
|
+
accepted as valid for the input properties.
|
|
119
|
+
|
|
120
|
+
### Configuring the actuator
|
|
121
|
+
|
|
122
|
+
Before using the vLLM actuator to execute experiments, you must
|
|
123
|
+
configure its parameters. First, get the template for the configuration:
|
|
124
|
+
|
|
125
|
+
```commandline
|
|
126
|
+
ado template actuatorconfiguration --actuator-identifier vllm_performance \
|
|
127
|
+
-o actuatorconfiguration.yaml
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This will create the `vllm_performance_actuatorconfiguration.yaml` file, which
|
|
131
|
+
will look like:
|
|
132
|
+
|
|
133
|
+
```yaml
|
|
134
|
+
actuatorIdentifier: vllm_performance
|
|
135
|
+
metadata:
|
|
136
|
+
description: null
|
|
137
|
+
labels: null
|
|
138
|
+
name: null
|
|
139
|
+
parameters:
|
|
140
|
+
benchmark_retries: 3
|
|
141
|
+
deployment_template: deployment.yaml
|
|
142
|
+
hf_token: ""
|
|
143
|
+
image_secret: ""
|
|
144
|
+
in_cluster: true
|
|
145
|
+
interpreter: python3
|
|
146
|
+
max_environments: 1
|
|
147
|
+
namespace: null
|
|
148
|
+
node_selector: ""
|
|
149
|
+
pvc_template: pvc.yaml
|
|
150
|
+
retries_timeout: 5
|
|
151
|
+
service_template: service.yaml
|
|
152
|
+
verify_ssl: false
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The three key parameters we have to set here are `hf_token`, `namespace`, and
|
|
156
|
+
`node_selector`.
|
|
157
|
+
|
|
158
|
+
- `hf_token`: Access token from
|
|
159
|
+
[HuggingFace](https://huggingface.co/settings/tokens).
|
|
160
|
+
- `namespace`: The namespace you have access to in your OpenShift cluster.
|
|
161
|
+
- `node_selector`: JSON dictionary representing a Kubernetes selector for a node
|
|
162
|
+
with available GPUs. Make sure it is formatted correctly, for example:
|
|
163
|
+
|
|
164
|
+
```text
|
|
165
|
+
node_selector: '{"kubernetes.io/hostname":"cpu16"}'
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
We will discuss the other parameters later. Once you have put in the parameters,
|
|
169
|
+
create the actuator configuration with:
|
|
170
|
+
|
|
171
|
+
```commandline
|
|
172
|
+
ado create actuatorconfiguration -f `vllm_performance_actuatorconfiguration.yaml`
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Note: You can have multiple configurations for an actuator.
|
|
176
|
+
|
|
177
|
+
## A Simple Benchmarking Exercise
|
|
178
|
+
|
|
179
|
+
To get started, we have provided an exercise to run a benchmarking experiment
|
|
180
|
+
for a single vLLM deployment configuration. The instructions for this exercise
|
|
181
|
+
assume you are running `ado` from a machine outside of the target
|
|
182
|
+
Kubernetes/OpenShift cluster.
|
|
183
|
+
|
|
184
|
+
### Creating a Discovery Space to describe the vLLM configurations to test
|
|
185
|
+
|
|
186
|
+
> [!NOTE]
|
|
187
|
+
>
|
|
188
|
+
> Since this is an example exercise, we will use the `local` context and the
|
|
189
|
+
> `default` sample store.
|
|
190
|
+
|
|
191
|
+
#### Activating the local context
|
|
192
|
+
|
|
193
|
+
To ensure the `local` context is active, run:
|
|
194
|
+
|
|
195
|
+
```commandline
|
|
196
|
+
ado context local
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
#### Defining a Discovery Space of vLLM configurations
|
|
200
|
+
|
|
201
|
+
`ado` uses the concept of
|
|
202
|
+
[Discovery Spaces](https://ibm.github.io/ado/core-concepts/concepts/) to
|
|
203
|
+
describe what to test (in this case vLLM workload configurations) and how to
|
|
204
|
+
test them (the vLLM benchmark(s) to run).
|
|
205
|
+
|
|
206
|
+
The set of configurations to test is defined by the
|
|
207
|
+
[entity space](https://ibm.github.io/ado/core-concepts/entity-spaces/), and the
|
|
208
|
+
set of experiments to perform by the
|
|
209
|
+
[measurement space](https://ibm.github.io/ado/core-concepts/actuators#measurementspace/).
|
|
210
|
+
|
|
211
|
+
An example `discoveryspace` for vLLM inference benchmarking can be found in
|
|
212
|
+
[`yamls/discoveryspace_override_defaults.yaml`](yamls/discoveryspace_override_defaults.yaml).
|
|
213
|
+
This defines a simple discovery space with a **single** entity.
|
|
214
|
+
|
|
215
|
+
Our sample space will benchmark vLLM serving the LLM specified by `model_name`,
|
|
216
|
+
on a node (determined through `node_selector`) with a specific GPU
|
|
217
|
+
(`NVIDIA-A100-80GB-PCIe`) specified in `gpu_type`.
|
|
218
|
+
|
|
219
|
+
> [!NOTE]
|
|
220
|
+
>
|
|
221
|
+
> Ensure that the GPU specified in `gpu_type` is present on the node. To find
|
|
222
|
+
> out the gpu model of your selected node, try the following command:
|
|
223
|
+
>
|
|
224
|
+
> ```commandline
|
|
225
|
+
> oc describe node <node name> | grep "nvidia.com/gpu.product"
|
|
226
|
+
> ```
|
|
227
|
+
>
|
|
228
|
+
> If this returns a different GPU model, then you must
|
|
229
|
+
> [update the experiment protocol](#customising-experiment-protocol).
|
|
230
|
+
|
|
231
|
+
Create the `discoveryspace`:
|
|
232
|
+
|
|
233
|
+
```commandline
|
|
234
|
+
ado create space -f yamls/discoveryspace_override_defaults.yaml \
|
|
235
|
+
--use-default-sample-store
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
#### Querying the Discovery Space
|
|
239
|
+
|
|
240
|
+
Before we run any experiment, we can see that the `discoveryspace` is empty:
|
|
241
|
+
|
|
242
|
+
```commandline
|
|
243
|
+
ado show entities space --use-latest
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Will output:
|
|
247
|
+
|
|
248
|
+
<!-- markdownlint-disable line-length -->
|
|
249
|
+
```text
|
|
250
|
+
Nothing was returned for entity type matching and property format observed in space space-c81773-df57a3.
|
|
251
|
+
```
|
|
252
|
+
<!-- markdownlint-enable line-length -->
|
|
253
|
+
|
|
254
|
+
To see all the entities (parameter combinations) that are waiting to be
|
|
255
|
+
measured, try executing:
|
|
256
|
+
|
|
257
|
+
```commandline
|
|
258
|
+
ado show entities space --include missing --use-latest
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
The output will look like:
|
|
262
|
+
|
|
263
|
+
<!-- markdownlint-disable line-length -->
|
|
264
|
+
```terminaloutput
|
|
265
|
+
model image n_cpus memory dtype num_prompts request_rate max_concurrency gpu_memory_utilization cpu_offload max_batch_tokens max_num_seq n_gpus gpu_type
|
|
266
|
+
0 ibm-granite/granite-3.3-8b-instruct quay.io/dataprep1/data-prep-kit/vllm_image:0.1 8.0 128Gi auto 500.0 -1.0 -1.0 0.9 0.0 16384.0 256.0 1.0 NVIDIA-A100-80GB-PCIe
|
|
267
|
+
```
|
|
268
|
+
<!-- markdownlint-enable line-length -->
|
|
269
|
+
|
|
270
|
+
Which is the entity we want to measure.
|
|
271
|
+
|
|
272
|
+
### Exploring the vLLM workload configuration space
|
|
273
|
+
|
|
274
|
+
First, log in to your OpenShift cluster and select your assigned namespace
|
|
275
|
+
|
|
276
|
+
```commandline
|
|
277
|
+
oc login <your OpenShift API endpoint>
|
|
278
|
+
oc project <your assigned namespace>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
Next, we'll set up the operation to measure our entity defined above.
|
|
282
|
+
|
|
283
|
+
In `ado` parlance, measurements are executed through `operations` which
|
|
284
|
+
represent the executions of `experiments` on `entities`.
|
|
285
|
+
|
|
286
|
+
An example of an operation can be found in
|
|
287
|
+
[`yamls/random_walk_operation.yaml`](https://github.com/IBM/ado/blob/main/plugins/actuators/vllm_performance/yamls/random_walk_operation.yaml).
|
|
288
|
+
You can run the operation using the actuator configuration and space that we
|
|
289
|
+
have created earlier with:
|
|
290
|
+
|
|
291
|
+
<!-- markdownlint-disable line-length -->
|
|
292
|
+
```commandline
|
|
293
|
+
ado create operation -f yamls/random_walk_operation.yaml \
|
|
294
|
+
--use-latest space --use-latest actuatorconfiguration
|
|
295
|
+
```
|
|
296
|
+
<!-- markdownlint-enable line-length -->
|
|
297
|
+
|
|
298
|
+
`ado` will initialise a local Ray cluster and starts the measurement at the
|
|
299
|
+
point where these lines appear:
|
|
300
|
+
|
|
301
|
+
<!-- markdownlint-disable line-length -->
|
|
302
|
+
```terminaloutput
|
|
303
|
+
...
|
|
304
|
+
=========== Starting Discovery Operation ===========
|
|
305
|
+
|
|
306
|
+
(RandomWalk pid=2780) 'all' specified for number of entities to sample. This is 1 entities - the size of the entity space
|
|
307
|
+
...
|
|
308
|
+
```
|
|
309
|
+
<!-- markdownlint-enable line-length -->
|
|
310
|
+
|
|
311
|
+
The actuator uses the entity to create a vLLM deployment, followed by execution
|
|
312
|
+
of the benchmark script. This process will take some time as it involves
|
|
313
|
+
downloading the container image from [Quay](quay.io) and the model from
|
|
314
|
+
HuggingFace, both of which are network-intensive. You can monitor if the
|
|
315
|
+
deployment is ready by executing the following in another shell:
|
|
316
|
+
|
|
317
|
+
```commandline
|
|
318
|
+
oc get deployments --watch
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
The experiment is successfully completed if the `ado` output is similar to the
|
|
322
|
+
following:
|
|
323
|
+
|
|
324
|
+
<!-- markdownlint-disable line-length -->
|
|
325
|
+
```text
|
|
326
|
+
(RandomWalk pid=46852) Continuous Batching: EXPERIMENT COMPLETION. Received finished notification for experiment in measurement request in group 0: request-4332aa-experiment-performance-testing-entities-model.ibm-granite/granite-3.3-8b-instruct-image.quay.io/dataprep1/data-prep-kit/vllm_image:0.1-n_cpus.8-memory.128Gi-dtype.auto-num_prompts.500-request_rate.-1-max_concurrency.-1-gpu_memory_utilization.0.9-cpu_offload.0-max_batch_tokens.16384-max_num_seq.256-n_gpus.1-gpu_type.NVIDIA-A100-80GB-PCIe (explicit_grid_sample_generator)-requester-randomwalk-0.9.7.dev10+b7a010dd.dirty-42ad60-time-2025-08-11 15:53:54.137571+01:00
|
|
327
|
+
(RandomWalk pid=46852) Continuous batching: GET EXPERIMENT. No new experiments in queue. Requests made: 1. Experiments Completed: 1
|
|
328
|
+
```
|
|
329
|
+
<!-- markdownlint-enable line-length -->
|
|
330
|
+
|
|
331
|
+
If the output contains `EXPERIMENT FAILURE`, then something has gone wrong.
|
|
332
|
+
|
|
333
|
+
Verify that the entity has been measured by running:
|
|
334
|
+
|
|
335
|
+
```commandline
|
|
336
|
+
ado show entities space --use-latest --output-format csv
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
The csv file will have one line representing the entity featuring values for all
|
|
340
|
+
its measured properties
|
|
341
|
+
(`performance-testing-output_throughput`,`performance-testing-total_token_throughput`,`performance-testing-mean_ttft_ms`,
|
|
342
|
+
etc.)
|
|
343
|
+
|
|
344
|
+
Congratulations! You have successfully executed the vLLM benchmark on a vLLM
|
|
345
|
+
workload configuration using `ado`!
|
|
346
|
+
|
|
347
|
+
# Exploring Further
|
|
348
|
+
|
|
349
|
+
## vLLM testing approach
|
|
350
|
+
|
|
351
|
+
vLLM testing implementation is based on this
|
|
352
|
+
[guide](https://github.com/vllm-project/vllm/discussions/7181) which is using
|
|
353
|
+
[benchmark_serving.py](https://github.com/vllm-project/vllm/blob/main/benchmarks/benchmark_serving.py)
|
|
354
|
+
to implement the actual benchmarking. The benchmarking is done using HTTP
|
|
355
|
+
requests using `vLLM OpenAI API server`.
|
|
356
|
+
|
|
357
|
+
To use this approach it is necessary to:
|
|
358
|
+
<!-- markdownlint-disable descriptive-link-text -->
|
|
359
|
+
- Create a docker image: Existing docker images for VLLM project are not
|
|
360
|
+
directly suitable for this purpose, as they are hard to use on Openshift
|
|
361
|
+
clusters and not directly extensible. We have provided a Docker image to get
|
|
362
|
+
started but if you want to customize it for your installation, then you will
|
|
363
|
+
need to rebuild it. We provide a slightly different
|
|
364
|
+
[build](docker_image), described [here](docker_image/README.md)
|
|
365
|
+
- Create automation for vLLM deployment for running experiments. A simple
|
|
366
|
+
implementation of such an automation is presented
|
|
367
|
+
[here](ado_actuators/vllm_performance/k8)
|
|
368
|
+
- Create a vLLM performance test. Here we are directly reusing
|
|
369
|
+
[performance test](https://github.com/vllm-project/vllm/blob/main/benchmarks/benchmark_serving.py)
|
|
370
|
+
provided by the vLLM project. The required code is
|
|
371
|
+
[here](ado_actuators/vllm_performance/vllm_performance_test)
|
|
372
|
+
<!-- markdownlint-enable descriptive-link-text -->
|
|
373
|
+
|
|
374
|
+
This figure shows the outline of the components and the parameters available for
|
|
375
|
+
configuring each of them
|
|
376
|
+
|
|
377
|
+

|
|
378
|
+
|
|
379
|
+
The test results in the figure are the measurements recorded for the entity. The
|
|
380
|
+
deployment parameters form the configuration space. Test parameters are
|
|
381
|
+
partially inferred from the configuration space and partially from the context
|
|
382
|
+
(Kubernetes endpoints, etc.)
|
|
383
|
+
|
|
384
|
+
## The Actuator Package: Key Files
|
|
385
|
+
|
|
386
|
+
The actuator package is under `ado_actuators/vllm_performance`. Note all
|
|
387
|
+
actuator packages should be placed under a directory called `ado_actuators` as
|
|
388
|
+
this is the name of package that contains all `ado` plugins.
|
|
389
|
+
|
|
390
|
+
The key files are:
|
|
391
|
+
|
|
392
|
+
- actuator_definitions.yaml
|
|
393
|
+
- This defines which classes in which modules of your package contain
|
|
394
|
+
Actuators.
|
|
395
|
+
- actuators.py
|
|
396
|
+
- Implementation of the actuator logic.
|
|
397
|
+
- It just needs to be the same name as in `actuator_definitions.yaml`
|
|
398
|
+
- experiments.yaml
|
|
399
|
+
- This file contains the definitions of the experiments the actuator defines
|
|
400
|
+
as YAML
|
|
401
|
+
- experiment_executor.py (OPTIONAL)
|
|
402
|
+
- This file contains the code that
|
|
403
|
+
- determines the values for the experiment parameters from the passed Entity
|
|
404
|
+
and Experiment
|
|
405
|
+
- execute the experiment and get measured property values
|
|
406
|
+
- sends the measured property values back to the orchestrator
|
|
407
|
+
|
|
408
|
+
### Customising Actuator Configurations
|
|
409
|
+
|
|
410
|
+
The actuator is configured using
|
|
411
|
+
[VLLMPerformanceTestParameters class](ado_actuators/vllm_performance/actuator_parameters.py)
|
|
412
|
+
|
|
413
|
+
You can customise `deployment_template`, `service_template` and `pvc_template`
|
|
414
|
+
for your OpenShift/K8s cluster. Refer to the
|
|
415
|
+
[default yamls](ado_actuators/vllm_performance/k8/yaml_support) for the
|
|
416
|
+
templates referred to in [Configuring the actuator](#configuring-the-actuator)
|
|
417
|
+
and modify them appropriately
|
|
418
|
+
|
|
419
|
+
If you create a custom Docker image and upload it to a repository, please do not
|
|
420
|
+
forget to create a corresponding Image pull secret in your assigned namespace.
|
|
421
|
+
You must also update the value of the `image_secret` parameter of the actuator
|
|
422
|
+
configuration.
|
|
423
|
+
|
|
424
|
+
### Customising Experiment Protocol
|
|
425
|
+
|
|
426
|
+
The values for the parameters in the entity space must be a subset of the
|
|
427
|
+
acceptable values defined for the experiment (_the experiment protocol_).
|
|
428
|
+
Therefore, depending on your environment and use case, you may need to update
|
|
429
|
+
the set of values to expand the configuration space being studied.
|
|
430
|
+
|
|
431
|
+
For example, you may want to benchmark a different LLM or you may want to change
|
|
432
|
+
the GPU type to the one installed in your cluster. In the former case, you will
|
|
433
|
+
add values to `model_name` and in the latter case, you will have to modify the
|
|
434
|
+
domain of the `gpu_type` parameter to avoid validation errors.
|
|
435
|
+
|
|
436
|
+
To do this, open the
|
|
437
|
+
[experiment definition YAML file](ado_actuators/vllm_performance/experiments.yaml)
|
|
438
|
+
in a text editor, and add your GPU model to the list of values of `gpu_type`.
|
|
439
|
+
|
|
440
|
+
Then, reinstall this actuator by running:
|
|
441
|
+
|
|
442
|
+
```commandline
|
|
443
|
+
pip install .
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
After that, you can use the new value of `gpu_type` in your experiments. For
|
|
447
|
+
example, in
|
|
448
|
+
[the sample space definition file](yamls/discoveryspace_override_defaults.yaml),
|
|
449
|
+
the location to update will be:
|
|
450
|
+
|
|
451
|
+
```yaml
|
|
452
|
+
- identifier: "gpu_type"
|
|
453
|
+
propertyDomain:
|
|
454
|
+
values: ["NVIDIA-A100-80GB-PCIe"]
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### Notes on the Random walk operation
|
|
458
|
+
|
|
459
|
+
VLLM testing is using external environment (deployment + service) to run tests.
|
|
460
|
+
Creating such an environment is resource-intensive. To speed up experiments
|
|
461
|
+
execution it is recommended to use group samplers for running VLLM testing. This
|
|
462
|
+
allows to create an environment once and use it for all experiments that can be
|
|
463
|
+
used for it. In this case the group definition looks as follows:
|
|
464
|
+
|
|
465
|
+
```yaml
|
|
466
|
+
grouping:
|
|
467
|
+
- model
|
|
468
|
+
- image
|
|
469
|
+
- n_gpus
|
|
470
|
+
- gpu_type
|
|
471
|
+
- n_cpus
|
|
472
|
+
- memory
|
|
473
|
+
- max_batch_tokens
|
|
474
|
+
- gpu_memory_utilization
|
|
475
|
+
- dtype
|
|
476
|
+
- cpu_offload
|
|
477
|
+
- max_num_seq
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
<!-- markdownlint-disable descriptive-link-text -->
|
|
481
|
+
For the complete example of configuring random walk operation for the group
|
|
482
|
+
samplers, look [here](yamls/random_walk_operation_grouped.yaml)
|
|
483
|
+
<!-- markdownlint-enable descriptive-link-text -->
|
|
484
|
+
|
|
485
|
+
## A few ideas for further exploration
|
|
486
|
+
|
|
487
|
+
Try:
|
|
488
|
+
|
|
489
|
+
- Testing throughput for different sequence length for multiple models using
|
|
490
|
+
this actuator (See
|
|
491
|
+
[discoveryspace_override_defaults_small.yaml](yamls/discoveryspace_override_defaults_small.yaml)
|
|
492
|
+
for an example with multiple values for `max_batch_tokens`)
|