Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b5eac52
[Benchmark] Add plot utility for parameter sweep
DarkLight1337 Oct 19, 2025
7f93c36
Update
DarkLight1337 Oct 20, 2025
d52e9b9
Add log plot
DarkLight1337 Oct 20, 2025
2f96852
Fix multifigure
DarkLight1337 Oct 20, 2025
fcf156b
Update command
DarkLight1337 Oct 20, 2025
ad14a53
Add title
DarkLight1337 Oct 20, 2025
08fab86
Support file prefix
DarkLight1337 Oct 20, 2025
bc04f30
Separate
DarkLight1337 Oct 20, 2025
1e13493
Improve separation
DarkLight1337 Oct 20, 2025
c848b10
Set by directory, not prefix
DarkLight1337 Oct 20, 2025
f7f36f2
Fix
DarkLight1337 Oct 20, 2025
c6cb78a
Plot in parallel
DarkLight1337 Oct 20, 2025
4cc5e90
Clean up
DarkLight1337 Oct 20, 2025
4af1e1a
Don't silently fail
DarkLight1337 Oct 20, 2025
7d82607
Pretty
DarkLight1337 Oct 20, 2025
8150f44
Fix nested
DarkLight1337 Oct 20, 2025
6ace5b2
Raise error if no data found
DarkLight1337 Oct 20, 2025
b3eb7cd
Show the problematic data item
DarkLight1337 Oct 20, 2025
8154e08
Convert to string first
DarkLight1337 Oct 20, 2025
d9fcb09
Be more clear
DarkLight1337 Oct 20, 2025
9c0e9fa
Use seaborn grid
DarkLight1337 Oct 20, 2025
f1810cc
Clean up
DarkLight1337 Oct 20, 2025
dac464b
Clean
DarkLight1337 Oct 20, 2025
73c911b
TODO
DarkLight1337 Oct 20, 2025
eef9c40
Clean
DarkLight1337 Oct 20, 2025
aa96151
Generalized filter and binning
DarkLight1337 Oct 20, 2025
0b98496
Remove old script
DarkLight1337 Oct 20, 2025
94c94c4
Merge branch 'main' into benchmark-sweep
DarkLight1337 Oct 20, 2025
ae9d021
Update import
DarkLight1337 Oct 20, 2025
beb3854
Clean up
DarkLight1337 Oct 20, 2025
5f36c62
Fix
DarkLight1337 Oct 20, 2025
8fbfd49
Simplify
DarkLight1337 Oct 20, 2025
daee7a8
Fix legend
DarkLight1337 Oct 20, 2025
b9e08ff
Fix
DarkLight1337 Oct 20, 2025
ad4149b
Reword
DarkLight1337 Oct 20, 2025
c5eaf78
Fix
DarkLight1337 Oct 20, 2025
c7426c2
Reword
DarkLight1337 Oct 20, 2025
49deaab
Reorder
DarkLight1337 Oct 20, 2025
0a4eb36
Informative error
DarkLight1337 Oct 20, 2025
8afa4d3
Separate out SLA tuner
DarkLight1337 Oct 21, 2025
3fa0d4c
Update
DarkLight1337 Oct 21, 2025
a3d1095
Improve error message
DarkLight1337 Oct 21, 2025
a4adbda
Allow strings
DarkLight1337 Oct 21, 2025
6357b84
Fix
DarkLight1337 Oct 21, 2025
f750fc5
Fix
DarkLight1337 Oct 21, 2025
2d856ff
Ordering
DarkLight1337 Oct 21, 2025
e6d4c72
Don't split
DarkLight1337 Oct 21, 2025
46d9f19
Remove unnecessary quotes
DarkLight1337 Oct 21, 2025
b95d706
Merge branch 'main' into benchmark-sweep
DarkLight1337 Oct 21, 2025
ceabbc8
Update with benchmark overrides as well
DarkLight1337 Oct 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions docs/contributing/benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toc_depth: 4
vLLM provides comprehensive benchmarking tools for performance testing and evaluation:

- **[Benchmark CLI](#benchmark-cli)**: `vllm bench` CLI tools and specialized benchmark scripts for interactive performance testing
- **[Batch Scripts](#batch-scripts)**: Run `vllm bench` against multiple configurations conveniently
- **[Parameter sweeps](#parameter-sweeps)**: Automate `vllm bench` runs for multiple configurations
- **[Performance benchmarks](#performance-benchmarks)**: Automated CI benchmarks for development
- **[Nightly benchmarks](#nightly-benchmarks)**: Comparative benchmarks against alternatives

Expand Down Expand Up @@ -925,15 +925,13 @@ throughput numbers correctly is also adjusted.

</details>

## Batch Scripts
## Parameter Sweeps

### Batch Serving Script
### Online Benchmark

[`vllm/benchmarks/serve_multi.py`](../../vllm/benchmarks/serve_multi.py) automatically starts `vllm serve` and runs `vllm bench serve` over multiple configurations.
[`vllm/benchmarks/sweep/serve.py`](../../vllm/benchmarks/sweep/serve.py) automatically starts `vllm serve` and runs `vllm bench serve` to evaluate vLLM over multiple configurations.

#### Batch Mode

The basic purpose of this script is to evaluate vLLM under different settings. Follows these steps to run the script:
Follow these steps to run the script:

1. Construct the base command to `vllm serve`, and pass it to the `--serve-cmd` option.
2. Construct the base command to `vllm bench serve`, and pass it to the `--bench-cmd` option.
Expand Down Expand Up @@ -996,7 +994,7 @@ The basic purpose of this script is to evaluate vLLM under different settings. F
Example command:

```bash
python vllm/benchmarks/serve_multi.py \
python -m vllm.benchmarks.sweep.serve \
--serve-cmd 'vllm serve meta-llama/Llama-2-7b-chat-hf' \
--bench-cmd 'vllm bench serve --model meta-llama/Llama-2-7b-chat-hf --backend vllm --endpoint /v1/completions --dataset-name sharegpt --dataset-path benchmarks/ShareGPT_V3_unfiltered_cleaned_split.json' \
--serve-params benchmarks/serve_hparams.json \
Expand All @@ -1018,9 +1016,9 @@ python vllm/benchmarks/serve_multi.py \
!!! tip
You can use the `--resume` option to continue the parameter sweep if one of the runs failed.

#### SLA Mode
### SLA Auto-Tuner

By passing SLA constraints via `--sla-params`, you can run this script in SLA mode, causing it to adjust either the request rate or concurrency (choose using `--sla-variable`) in order to satisfy the SLA constraints.
[`vllm/benchmarks/sweep/serve_sla.py`](../../vllm/benchmarks/sweep/serve_sla.py) is a wrapper over [`vllm/benchmarks/sweep/serve.py`](../../vllm/benchmarks/sweep/serve.py) that tunes either the request rate or concurrency (choose using `--sla-variable`) in order to satisfy the SLA constraints given by `--sla-params`.

For example, to ensure E2E latency within different target values for 99% of requests:

Expand All @@ -1044,7 +1042,7 @@ For example, to ensure E2E latency within different target values for 99% of req
Example command:

```bash
python vllm/benchmarks/serve_multi.py \
python -m vllm.benchmarks.sweep.serve_sla \
--serve-cmd 'vllm serve meta-llama/Llama-2-7b-chat-hf' \
Copy link
Contributor

@lengrongfu lengrongfu Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use a vllm serve api address, we should how to config?

Maybe we should add a --serve-host param, user can set a vllm online server, then this --serve-params param can be invalid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set the server's host via --serve-cmd. And for resetting the server cache after each benchmark run, you can use --after-bench-cmd.

Copy link
Member Author

@DarkLight1337 DarkLight1337 Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean that the benchmark should not be responsible for launching the server, you can just use a dummy command that sleeps infinitely and adjust --bench-cmd to access the real server. Of course, you should also set --after-bench-cmd in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, maybe i not need set --serve-cmd param, use --bench-cmd param to set vllm bench serve --model meta-llama/Llama-2-7b-chat-hf --backend openai is enough.

--bench-cmd 'vllm bench serve --model meta-llama/Llama-2-7b-chat-hf --backend vllm --endpoint /v1/completions --dataset-name sharegpt --dataset-path benchmarks/ShareGPT_V3_unfiltered_cleaned_split.json' \
--serve-params benchmarks/serve_hparams.json \
Expand All @@ -1066,6 +1064,24 @@ The algorithm for adjusting the SLA variable is as follows:

For a given combination of `--serve-params` and `--bench-params`, we share the benchmark results across `--sla-params` to avoid rerunning benchmarks with the same SLA variable value.

### Visualizer

[`vllm/benchmarks/sweep/plot.py`](../../vllm/benchmarks/sweep/plot.py) can be used to plot performance curves from parameter sweep results.

Example command:

```bash
python -m vllm.benchmarks.sweep.plot benchmarks/results/<timestamp> \
--var-x max_concurrency \
--row-by random_input_len \
--col-by random_output_len \
--curve-by api_server_count,max_num_batched_tokens \
--filter-by 'max_concurrency<=1024'
```

!!! tip
You can use `--dry-run` to preview the figures to be plotted.

## Performance Benchmarks

The performance benchmarks are used for development to confirm whether new changes improve performance under various workloads. They are triggered on every commit with both the `perf-benchmarks` and `ready` labels, and when a PR is merged into vLLM.
Expand Down
Loading