|
| 1 | +diff --git a/.buildkite/nightly-benchmarks/README.md b/.buildkite/nightly-benchmarks/README.md |
| 2 | +index 72c52d5bb..e6f5c8b60 100644 |
| 3 | +--- a/.buildkite/nightly-benchmarks/README.md |
| 4 | ++++ b/.buildkite/nightly-benchmarks/README.md |
| 5 | +@@ -7,11 +7,11 @@ This directory contains two sets of benchmark for vllm. |
| 6 | + - Performance benchmark: benchmark vllm's performance under various workload, for **developers** to gain clarity on whether their PR improves/degrades vllm's performance |
| 7 | + - Nightly benchmark: compare vllm's performance against alternatives (tgi, trt-llm and lmdeploy), for **the public** to know when to choose vllm. |
| 8 | + |
| 9 | +-See [vLLM performance dashboard](https://perf.vllm.ai) for the latest performance benchmark results and [vLLM GitHub README](https://github.com/vllm-project/vllm/blob/main/README.md) for latest nightly benchmark results. |
| 10 | ++See [vLLM performance dashboard](https://hud.pytorch.org/benchmark/llms?repoName=vllm-project%2Fvllm) for the latest performance benchmark results and [vLLM GitHub README](https://github.com/vllm-project/vllm/blob/main/README.md) for latest nightly benchmark results. |
| 11 | + |
| 12 | + ## Performance benchmark quick overview |
| 13 | + |
| 14 | +-**Benchmarking Coverage**: latency, throughput and fix-qps serving on A100 (the support for FP8 benchmark on H100 is coming!), with different models. |
| 15 | ++**Benchmarking Coverage**: latency, throughput and fix-qps serving on A100 (the support for FP8 benchmark on H100 is coming!) and Intel® Xeon® Processors, with different models. |
| 16 | + |
| 17 | + **Benchmarking Duration**: about 1hr. |
| 18 | + |
| 19 | +@@ -28,16 +28,34 @@ See [vLLM performance dashboard](https://perf.vllm.ai) for the latest performanc |
| 20 | + ## Trigger the benchmark |
| 21 | + |
| 22 | + Performance benchmark will be triggered when: |
| 23 | ++ |
| 24 | + - A PR being merged into vllm. |
| 25 | + - Every commit for those PRs with `perf-benchmarks` label AND `ready` label. |
| 26 | + |
| 27 | ++Manually Trigger the benchmark |
| 28 | ++ |
| 29 | ++```bash |
| 30 | ++bash .buildkite/nightly-benchmarks/scripts/run-performance-benchmarks.sh |
| 31 | ++``` |
| 32 | ++ |
| 33 | ++Runtime environment variables: |
| 34 | ++ |
| 35 | ++- `ON_CPU`: set the value to '1' on Intel® Xeon® Processors. Default value is 0. |
| 36 | ++- `SERVING_JSON`: JSON file to use for the serving tests. Default value is empty string (use default file). |
| 37 | ++- `LATENCY_JSON`: JSON file to use for the latency tests. Default value is empty string (use default file). |
| 38 | ++- `THROUGHPUT_JSON`: JSON file to use for the throughout tests. Default value is empty string (use default file). |
| 39 | ++- `REMOTE_HOST`: IP for the remote vLLM service to benchmark. Default value is empty string. |
| 40 | ++- `REMOTE_PORT`: Port for the remote vLLM service to benchmark. Default value is empty string. |
| 41 | ++ |
| 42 | + Nightly benchmark will be triggered when: |
| 43 | ++ |
| 44 | + - Every commit for those PRs with `perf-benchmarks` label and `nightly-benchmarks` label. |
| 45 | + |
| 46 | + ## Performance benchmark details |
| 47 | + |
| 48 | + See [performance-benchmarks-descriptions.md](performance-benchmarks-descriptions.md) for detailed descriptions, and use `tests/latency-tests.json`, `tests/throughput-tests.json`, `tests/serving-tests.json` to configure the test cases. |
| 49 | +- |
| 50 | ++> NOTE: For Intel® Xeon® Processors, use `tests/latency-tests-cpu.json`, `tests/throughput-tests-cpu.json`, `tests/serving-tests-cpu.json` instead. |
| 51 | ++> |
| 52 | + ### Latency test |
| 53 | + |
| 54 | + Here is an example of one test inside `latency-tests.json`: |
| 55 | +@@ -60,7 +78,7 @@ Here is an example of one test inside `latency-tests.json`: |
| 56 | + In this example: |
| 57 | + |
| 58 | + - The `test_name` attributes is a unique identifier for the test. In `latency-tests.json`, it must start with `latency_`. |
| 59 | +-- The `parameters` attribute control the command line arguments to be used for `benchmark_latency.py`. Note that please use underline `_` instead of the dash `-` when specifying the command line arguments, and `run-performance-benchmarks.sh` will convert the underline to dash when feeding the arguments to `benchmark_latency.py`. For example, the corresponding command line arguments for `benchmark_latency.py` will be `--model meta-llama/Meta-Llama-3-8B --tensor-parallel-size 1 --load-format dummy --num-iters-warmup 5 --num-iters 15` |
| 60 | ++- The `parameters` attribute control the command line arguments to be used for `vllm bench latency`. Note that please use underline `_` instead of the dash `-` when specifying the command line arguments, and `run-performance-benchmarks.sh` will convert the underline to dash when feeding the arguments to `vllm bench latency`. For example, the corresponding command line arguments for `vllm bench latency` will be `--model meta-llama/Meta-Llama-3-8B --tensor-parallel-size 1 --load-format dummy --num-iters-warmup 5 --num-iters 15` |
| 61 | + |
| 62 | + Note that the performance numbers are highly sensitive to the value of the parameters. Please make sure the parameters are set correctly. |
| 63 | + |
| 64 | +@@ -68,13 +86,13 @@ WARNING: The benchmarking script will save json results by itself, so please do |
| 65 | + |
| 66 | + ### Throughput test |
| 67 | + |
| 68 | +-The tests are specified in `throughput-tests.json`. The syntax is similar to `latency-tests.json`, except for that the parameters will be fed forward to `benchmark_throughput.py`. |
| 69 | ++The tests are specified in `throughput-tests.json`. The syntax is similar to `latency-tests.json`, except for that the parameters will be fed forward to `vllm bench throughput`. |
| 70 | + |
| 71 | + The number of this test is also stable -- a slight change on the value of this number might vary the performance numbers by a lot. |
| 72 | + |
| 73 | + ### Serving test |
| 74 | + |
| 75 | +-We test the throughput by using `benchmark_serving.py` with request rate = inf to cover the online serving overhead. The corresponding parameters are in `serving-tests.json`, and here is an example: |
| 76 | ++We test the throughput by using `vllm bench serve` with request rate = inf to cover the online serving overhead. The corresponding parameters are in `serving-tests.json`, and here is an example: |
| 77 | + |
| 78 | + ```json |
| 79 | + [ |
| 80 | +@@ -86,7 +104,6 @@ We test the throughput by using `benchmark_serving.py` with request rate = inf t |
| 81 | + "tensor_parallel_size": 1, |
| 82 | + "swap_space": 16, |
| 83 | + "disable_log_stats": "", |
| 84 | +- "disable_log_requests": "", |
| 85 | + "load_format": "dummy" |
| 86 | + }, |
| 87 | + "client_parameters": { |
| 88 | +@@ -104,8 +121,8 @@ Inside this example: |
| 89 | + |
| 90 | + - The `test_name` attribute is also a unique identifier for the test. It must start with `serving_`. |
| 91 | + - The `server-parameters` includes the command line arguments for vLLM server. |
| 92 | +-- The `client-parameters` includes the command line arguments for `benchmark_serving.py`. |
| 93 | +-- The `qps_list` controls the list of qps for test. It will be used to configure the `--request-rate` parameter in `benchmark_serving.py` |
| 94 | ++- The `client-parameters` includes the command line arguments for `vllm bench serve`. |
| 95 | ++- The `qps_list` controls the list of qps for test. It will be used to configure the `--request-rate` parameter in `vllm bench serve` |
| 96 | + |
| 97 | + The number of this test is less stable compared to the delay and latency benchmarks (due to randomized sharegpt dataset sampling inside `benchmark_serving.py`), but a large change on this number (e.g. 5% change) still vary the output greatly. |
| 98 | + |
| 99 | +@@ -119,6 +136,23 @@ If you do not see the table, please wait till the benchmark finish running. |
| 100 | + The json version of the table (together with the json version of the benchmark) will be also attached to the markdown file. |
| 101 | + The raw benchmarking results (in the format of json files) are in the `Artifacts` tab of the benchmarking. |
| 102 | + |
| 103 | ++The `compare-json-results.py` helps to compare benchmark results JSON files converted using `convert-results-json-to-markdown.py`. |
| 104 | ++When run, benchmark script generates results under `benchmark/results` folder, along with the `benchmark_results.md` and `benchmark_results.json`. |
| 105 | ++`compare-json-results.py` compares two `benchmark_results.json` files and provides performance ratio e.g. for Output Tput, Median TTFT and Median TPOT. |
| 106 | ++If only one benchmark_results.json is passed, `compare-json-results.py` compares different TP and PP configurations in the benchmark_results.json instead. |
| 107 | ++ |
| 108 | ++Here is an example using the script to compare result_a and result_b with Model, Dataset name, input/output length, max concurrency and qps. |
| 109 | ++`python3 compare-json-results.py -f results_a/benchmark_results.json -f results_b/benchmark_results.json` |
| 110 | ++ |
| 111 | ++| | Model | Dataset Name | Input Len | Output Len | # of max concurrency | qps | results_a/benchmark_results.json | results_b/benchmark_results.json | perf_ratio | |
| 112 | ++|----|---------------------------------------|--------|-----|-----|------|-----|-----------|----------|----------| |
| 113 | ++| 0 | meta-llama/Meta-Llama-3.1-8B-Instruct | random | 128 | 128 | 1000 | 1 | 142.633982 | 156.526018 | 1.097396 | |
| 114 | ++| 1 | meta-llama/Meta-Llama-3.1-8B-Instruct | random | 128 | 128 | 1000 | inf| 241.620334 | 294.018783 | 1.216863 | |
| 115 | ++ |
| 116 | ++A comparison diagram will be generated below the table. |
| 117 | ++Here is an example to compare between 96c/results_gnr_96c_091_tp2pp3 and 128c/results_gnr_128c_091_tp2pp3 |
| 118 | ++<img width="1886" height="828" alt="image" src="https://github.com/user-attachments/assets/c02a43ef-25d0-4fd6-90e5-2169a28682dd" /> |
| 119 | ++ |
| 120 | + ## Nightly test details |
| 121 | + |
| 122 | + See [nightly-descriptions.md](nightly-descriptions.md) for the detailed description on test workload, models and docker containers of benchmarking other llm engines. |
| 123 | +@@ -126,9 +160,9 @@ See [nightly-descriptions.md](nightly-descriptions.md) for the detailed descript |
| 124 | + ### Workflow |
| 125 | + |
| 126 | + - The [nightly-pipeline.yaml](nightly-pipeline.yaml) specifies the docker containers for different LLM serving engines. |
| 127 | +-- Inside each container, we run [run-nightly-suite.sh](run-nightly-suite.sh), which will probe the serving engine of the current container. |
| 128 | +-- The `run-nightly-suite.sh` will redirect the request to `tests/run-[llm serving engine name]-nightly.sh`, which parses the workload described in [nightly-tests.json](tests/nightly-tests.json) and performs the benchmark. |
| 129 | +-- At last, we run [scripts/plot-nightly-results.py](scripts/plot-nightly-results.py) to collect and plot the final benchmarking results, and update the results to buildkite. |
| 130 | ++- Inside each container, we run [scripts/run-nightly-benchmarks.sh](scripts/run-nightly-benchmarks.sh), which will probe the serving engine of the current container. |
| 131 | ++- The `scripts/run-nightly-benchmarks.sh` will parse the workload described in [nightly-tests.json](tests/nightly-tests.json) and launch the right benchmark for the specified serving engine via `scripts/launch-server.sh`. |
| 132 | ++- At last, we run [scripts/summary-nightly-results.py](scripts/summary-nightly-results.py) to collect and plot the final benchmarking results, and update the results to buildkite. |
| 133 | + |
| 134 | + ### Nightly tests |
| 135 | + |
| 136 | +@@ -138,6 +172,6 @@ In [nightly-tests.json](tests/nightly-tests.json), we include the command line a |
| 137 | + |
| 138 | + The docker containers for benchmarking are specified in `nightly-pipeline.yaml`. |
| 139 | + |
| 140 | +-WARNING: the docker versions are HARD-CODED and SHOULD BE ALIGNED WITH `nightly-descriptions.md`. The docker versions need to be hard-coded as there are several version-specific bug fixes inside `tests/run-[llm serving engine name]-nightly.sh`. |
| 141 | ++WARNING: the docker versions are HARD-CODED and SHOULD BE ALIGNED WITH `nightly-descriptions.md`. The docker versions need to be hard-coded as there are several version-specific bug fixes inside `scripts/run-nightly-benchmarks.sh` and `scripts/launch-server.sh`. |
| 142 | + |
| 143 | + WARNING: populating `trt-llm` to latest version is not easy, as it requires updating several protobuf files in [tensorrt-demo](https://github.com/neuralmagic/tensorrt-demo.git). |
| 144 | + |
0 commit comments