2023-06-17 03:07:40 -07:00
|
|
|
|
# Benchmarking vLLM
|
2023-05-28 03:20:05 -07:00
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
This README guides you through running benchmark tests with the extensive
|
|
|
|
|
datasets supported on vLLM. It’s a living document, updated as new features and datasets
|
|
|
|
|
become available.
|
2023-05-28 03:20:05 -07:00
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
## Dataset Overview
|
|
|
|
|
|
|
|
|
|
<table style="width:100%; border-collapse: collapse;">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
|
|
|
|
<th style="width:15%; text-align: left;">Dataset</th>
|
|
|
|
|
<th style="width:10%; text-align: center;">Online</th>
|
|
|
|
|
<th style="width:10%; text-align: center;">Offline</th>
|
|
|
|
|
<th style="width:65%; text-align: left;">Data Path</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>ShareGPT</strong></td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td><code>wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json</code></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>BurstGPT</strong></td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td><code>wget https://github.com/HPMLL/BurstGPT/releases/download/v1.1/BurstGPT_without_fails_2.csv</code></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>Sonnet</strong></td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td>Local file: <code>benchmarks/sonnet.txt</code></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>Random</strong></td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
|
|
|
|
<td><code>synthetic</code></td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>HuggingFace</strong></td>
|
2025-03-19 21:32:58 -07:00
|
|
|
|
<td style="text-align: center;">🟡</td>
|
2025-03-13 21:07:54 -07:00
|
|
|
|
<td style="text-align: center;">🟡</td>
|
2025-03-11 19:23:04 -07:00
|
|
|
|
<td>Specify your dataset path on HuggingFace</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><strong>VisionArena</strong></td>
|
|
|
|
|
<td style="text-align: center;">✅</td>
|
2025-03-13 21:07:54 -07:00
|
|
|
|
<td style="text-align: center;">✅</td>
|
2025-03-11 19:23:04 -07:00
|
|
|
|
<td><code>lmarena-ai/vision-arena-bench-v0.1</code> (a HuggingFace dataset)</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
2025-03-13 21:07:54 -07:00
|
|
|
|
|
|
|
|
|
✅: supported
|
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
🚧: to be supported
|
|
|
|
|
|
2025-03-13 21:07:54 -07:00
|
|
|
|
🟡: Partial support. Currently, HuggingFaceDataset only supports dataset formats
|
2025-03-19 21:32:58 -07:00
|
|
|
|
similar to `lmms-lab/LLaVA-OneVision-Data` and `Aeala/ShareGPT_Vicuna_unfiltered`.
|
|
|
|
|
If you need support for other dataset formats, please consider contributing.
|
2025-03-13 21:07:54 -07:00
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
**Note**: VisionArena’s `dataset-name` should be set to `hf`
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
## Example - Online Benchmark
|
|
|
|
|
|
|
|
|
|
First start serving your model
|
2025-02-08 20:25:15 +08:00
|
|
|
|
|
2023-05-28 03:20:05 -07:00
|
|
|
|
```bash
|
2025-03-11 19:23:04 -07:00
|
|
|
|
MODEL_NAME="NousResearch/Hermes-3-Llama-3.1-8B"
|
|
|
|
|
vllm serve ${MODEL_NAME} --disable-log-requests
|
2023-05-28 03:20:05 -07:00
|
|
|
|
```
|
2024-11-05 11:30:02 -08:00
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
Then run the benchmarking script
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# download dataset
|
|
|
|
|
# wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json
|
|
|
|
|
MODEL_NAME="NousResearch/Hermes-3-Llama-3.1-8B"
|
|
|
|
|
NUM_PROMPTS=10
|
2025-03-15 18:46:17 -07:00
|
|
|
|
BACKEND="vllm"
|
2025-03-11 19:23:04 -07:00
|
|
|
|
DATASET_NAME="sharegpt"
|
|
|
|
|
DATASET_PATH="<your data path>/ShareGPT_V3_unfiltered_cleaned_split.json"
|
2025-03-15 18:46:17 -07:00
|
|
|
|
python3 vllm/benchmarks/benchmark_serving.py --backend ${BACKEND} --model ${MODEL_NAME} --endpoint /v1/completions --dataset-name ${DATASET_NAME} --dataset-path ${DATASET_PATH} --num-prompts ${NUM_PROMPTS}
|
2025-03-11 19:23:04 -07:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
If successful, you will see the following output
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
============ Serving Benchmark Result ============
|
|
|
|
|
Successful requests: 10
|
|
|
|
|
Benchmark duration (s): 5.78
|
|
|
|
|
Total input tokens: 1369
|
|
|
|
|
Total generated tokens: 2212
|
|
|
|
|
Request throughput (req/s): 1.73
|
|
|
|
|
Output token throughput (tok/s): 382.89
|
|
|
|
|
Total Token throughput (tok/s): 619.85
|
|
|
|
|
---------------Time to First Token----------------
|
|
|
|
|
Mean TTFT (ms): 71.54
|
|
|
|
|
Median TTFT (ms): 73.88
|
|
|
|
|
P99 TTFT (ms): 79.49
|
|
|
|
|
-----Time per Output Token (excl. 1st token)------
|
|
|
|
|
Mean TPOT (ms): 7.91
|
|
|
|
|
Median TPOT (ms): 7.96
|
|
|
|
|
P99 TPOT (ms): 8.03
|
|
|
|
|
---------------Inter-token Latency----------------
|
|
|
|
|
Mean ITL (ms): 7.74
|
|
|
|
|
Median ITL (ms): 7.70
|
|
|
|
|
P99 ITL (ms): 8.39
|
|
|
|
|
==================================================
|
|
|
|
|
```
|
2024-11-05 11:30:02 -08:00
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
### VisionArena Benchmark for Vision Language Models
|
2025-02-08 20:25:15 +08:00
|
|
|
|
|
2024-11-05 11:30:02 -08:00
|
|
|
|
```bash
|
2025-03-11 19:23:04 -07:00
|
|
|
|
# need a model with vision capability here
|
|
|
|
|
vllm serve Qwen/Qwen2-VL-7B-Instruct --disable-log-requests
|
2024-11-05 11:30:02 -08:00
|
|
|
|
```
|
2025-02-10 21:25:30 -08:00
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
```bash
|
|
|
|
|
MODEL_NAME="Qwen/Qwen2-VL-7B-Instruct"
|
|
|
|
|
NUM_PROMPTS=10
|
|
|
|
|
BACKEND="openai-chat"
|
|
|
|
|
DATASET_NAME="hf"
|
|
|
|
|
DATASET_PATH="lmarena-ai/vision-arena-bench-v0.1"
|
|
|
|
|
DATASET_SPLIT='train'
|
|
|
|
|
|
2025-03-13 21:07:54 -07:00
|
|
|
|
python3 vllm/benchmarks/benchmark_serving.py \
|
2025-03-11 19:23:04 -07:00
|
|
|
|
--backend "${BACKEND}" \
|
|
|
|
|
--model "${MODEL_NAME}" \
|
|
|
|
|
--endpoint "/v1/chat/completions" \
|
|
|
|
|
--dataset-name "${DATASET_NAME}" \
|
|
|
|
|
--dataset-path "${DATASET_PATH}" \
|
|
|
|
|
--hf-split "${DATASET_SPLIT}" \
|
|
|
|
|
--num-prompts "${NUM_PROMPTS}"
|
|
|
|
|
```
|
2025-02-10 21:25:30 -08:00
|
|
|
|
|
2025-03-19 21:32:58 -07:00
|
|
|
|
### HuggingFaceDataset Examples
|
|
|
|
|
|
|
|
|
|
Currently, HuggingFaceDataset only supports dataset formats
|
|
|
|
|
similar to `lmms-lab/LLaVA-OneVision-Data` and `Aeala/ShareGPT_Vicuna_unfiltered`. If you need support for other dataset
|
|
|
|
|
formats, please consider contributing.
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# need a model with vision capability here
|
|
|
|
|
vllm serve Qwen/Qwen2-VL-7B-Instruct --disable-log-requests
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**`lmms-lab/LLaVA-OneVision-Data`**
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
MODEL_NAME="Qwen/Qwen2-VL-7B-Instruct"
|
|
|
|
|
NUM_PROMPTS=10
|
|
|
|
|
BACKEND="openai-chat"
|
|
|
|
|
DATASET_NAME="hf"
|
|
|
|
|
DATASET_PATH="lmms-lab/LLaVA-OneVision-Data"
|
|
|
|
|
DATASET_SPLIT='train'
|
|
|
|
|
DATASET_SUBSET='chart2text(cauldron)'
|
|
|
|
|
python3 vllm/benchmarks/benchmark_serving.py \
|
|
|
|
|
--backend "${BACKEND}" \
|
|
|
|
|
--model "${MODEL_NAME}" \
|
|
|
|
|
--endpoint "/v1/chat/completions" \
|
|
|
|
|
--dataset-name "${DATASET_NAME}" \
|
|
|
|
|
--dataset-path "${DATASET_PATH}" \
|
|
|
|
|
--hf-split "${DATASET_SPLIT}" \
|
|
|
|
|
--num-prompts "${NUM_PROMPTS}" \
|
|
|
|
|
--hf-subset "${DATASET_SUBSET}"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**`Aeala/ShareGPT_Vicuna_unfiltered`**
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
MODEL_NAME="Qwen/Qwen2-VL-7B-Instruct"
|
|
|
|
|
NUM_PROMPTS=10
|
|
|
|
|
BACKEND="openai-chat"
|
|
|
|
|
DATASET_NAME="hf"
|
|
|
|
|
DATASET_PATH="Aeala/ShareGPT_Vicuna_unfiltered"
|
|
|
|
|
DATASET_SPLIT='train'
|
|
|
|
|
python3 vllm/benchmarks/benchmark_serving.py \
|
|
|
|
|
--backend "${BACKEND}" \
|
|
|
|
|
--model "${MODEL_NAME}" \
|
|
|
|
|
--endpoint "/v1/chat/completions" \
|
|
|
|
|
--dataset-name "${DATASET_NAME}" \
|
|
|
|
|
--dataset-path "${DATASET_PATH}" \
|
|
|
|
|
--hf-split "${DATASET_SPLIT}" \
|
|
|
|
|
--num-prompts "${NUM_PROMPTS}" \
|
|
|
|
|
```
|
|
|
|
|
|
2025-03-11 19:23:04 -07:00
|
|
|
|
---
|
|
|
|
|
## Example - Offline Throughput Benchmark
|
2025-02-10 21:25:30 -08:00
|
|
|
|
|
|
|
|
|
```bash
|
2025-03-11 19:23:04 -07:00
|
|
|
|
MODEL_NAME="NousResearch/Hermes-3-Llama-3.1-8B"
|
|
|
|
|
NUM_PROMPTS=10
|
|
|
|
|
DATASET_NAME="sonnet"
|
2025-03-13 21:07:54 -07:00
|
|
|
|
DATASET_PATH="vllm/benchmarks/sonnet.txt"
|
2025-03-11 19:23:04 -07:00
|
|
|
|
|
2025-03-13 21:07:54 -07:00
|
|
|
|
python3 vllm/benchmarks/benchmark_throughput.py \
|
2025-03-11 19:23:04 -07:00
|
|
|
|
--model "${MODEL_NAME}" \
|
|
|
|
|
--dataset-name "${DATASET_NAME}" \
|
|
|
|
|
--dataset-path "${DATASET_PATH}" \
|
|
|
|
|
--num-prompts "${NUM_PROMPTS}"
|
2025-03-13 21:07:54 -07:00
|
|
|
|
```
|
2025-03-11 19:23:04 -07:00
|
|
|
|
|
|
|
|
|
If successful, you will see the following output
|
|
|
|
|
|
|
|
|
|
```
|
2025-03-13 21:07:54 -07:00
|
|
|
|
Throughput: 7.15 requests/s, 4656.00 total tokens/s, 1072.15 output tokens/s
|
|
|
|
|
Total num prompt tokens: 5014
|
|
|
|
|
Total num output tokens: 1500
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### VisionArena Benchmark for Vision Language Models
|
|
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
|
MODEL_NAME="Qwen/Qwen2-VL-7B-Instruct"
|
|
|
|
|
NUM_PROMPTS=10
|
|
|
|
|
DATASET_NAME="hf"
|
|
|
|
|
DATASET_PATH="lmarena-ai/vision-arena-bench-v0.1"
|
|
|
|
|
DATASET_SPLIT="train"
|
|
|
|
|
|
|
|
|
|
python3 vllm/benchmarks/benchmark_throughput.py \
|
|
|
|
|
--model "${MODEL_NAME}" \
|
|
|
|
|
--backend "vllm-chat" \
|
|
|
|
|
--dataset-name "${DATASET_NAME}" \
|
|
|
|
|
--dataset-path "${DATASET_PATH}" \
|
|
|
|
|
--num-prompts "${NUM_PROMPTS}" \
|
|
|
|
|
--hf-split "${DATASET_SPLIT}"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The `num prompt tokens` now includes image token counts
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Throughput: 2.55 requests/s, 4036.92 total tokens/s, 326.90 output tokens/s
|
|
|
|
|
Total num prompt tokens: 14527
|
|
|
|
|
Total num output tokens: 1280
|
2025-02-10 21:25:30 -08:00
|
|
|
|
```
|
2025-03-11 19:23:04 -07:00
|
|
|
|
|
|
|
|
|
### Benchmark with LoRA Adapters
|
|
|
|
|
|
|
|
|
|
``` bash
|
2025-03-13 21:07:54 -07:00
|
|
|
|
# download dataset
|
|
|
|
|
# wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json
|
2025-03-11 19:23:04 -07:00
|
|
|
|
MODEL_NAME="meta-llama/Llama-2-7b-hf"
|
|
|
|
|
BACKEND="vllm"
|
|
|
|
|
DATASET_NAME="sharegpt"
|
2025-03-13 21:07:54 -07:00
|
|
|
|
DATASET_PATH="<your data path>/ShareGPT_V3_unfiltered_cleaned_split.json"
|
2025-03-11 19:23:04 -07:00
|
|
|
|
NUM_PROMPTS=10
|
|
|
|
|
MAX_LORAS=2
|
|
|
|
|
MAX_LORA_RANK=8
|
|
|
|
|
ENABLE_LORA="--enable-lora"
|
|
|
|
|
LORA_PATH="yard1/llama-2-7b-sql-lora-test"
|
|
|
|
|
|
2025-03-13 21:07:54 -07:00
|
|
|
|
python3 vllm/benchmarks/benchmark_throughput.py \
|
2025-03-11 19:23:04 -07:00
|
|
|
|
--model "${MODEL_NAME}" \
|
|
|
|
|
--backend "${BACKEND}" \
|
|
|
|
|
--dataset_path "${DATASET_PATH}" \
|
|
|
|
|
--dataset_name "${DATASET_NAME}" \
|
|
|
|
|
--num-prompts "${NUM_PROMPTS}" \
|
|
|
|
|
--max-loras "${MAX_LORAS}" \
|
|
|
|
|
--max-lora-rank "${MAX_LORA_RANK}" \
|
|
|
|
|
${ENABLE_LORA} \
|
|
|
|
|
--lora-path "${LORA_PATH}"
|
|
|
|
|
```
|