|
1 | | -To use the benchmark_throughput_flagos feature from vllm-plugin-fl, you must first complete the following preliminary steps: |
| 1 | +## Benchmark Overview |
2 | 2 |
|
3 | | -1. Start an LLM inference service compliant with the OpenAI API protocol using the --served-model-name Qwen3-Next argument, or use a different name and update the string on line 11 of benchmark_throughput_flagos.py to match your chosen --served-model-name exactly (character-for-character). |
| 3 | +This directory provides two workflows: |
| 4 | +- `benchmark_throughput_flagos.py`: throughput benchmarking for a served model. |
| 5 | +- `benchmark_throughput_autotune.py`: auto-tune FlagGems operator selection by throughput. |
4 | 6 |
|
5 | | -2. Run the benchmark_throughput_flagos script on the same machine where the inference service is hosted. |
| 7 | +--- |
6 | 8 |
|
7 | | -3. Ensure the host machine has stable global network bandwidth of at least 10 Mbps, with 100 Mbps recommended for reliable benchmarking. |
| 9 | +## benchmark_throughput_flagos.py |
8 | 10 |
|
9 | | -4. The benchmark_throughput_flagos feature has been validated in environments using vLLM versions 0.11.0 and 0.12.0. Using higher or lower vLLM versions—or serving the model with alternative frameworks such as SGLang—may result in compatibility issues. |
10 | | - |
11 | | -Once the above prerequisites are met, you can simply run the following command from the directory containing this file: |
| 11 | +### Note |
| 12 | +- Start an OpenAI-compatible inference service with `--served-model-name Qwen3-Next`. |
| 13 | + If you use a different name, update the string in `benchmark_throughput_flagos.py`. |
| 14 | +- Run the benchmark on the same host as the service. |
12 | 15 |
|
| 16 | +### Run |
13 | 17 | ```bash |
14 | 18 | python3 benchmark_throughput_flagos.py |
15 | 19 | ``` |
16 | 20 |
|
17 | | -If the command runs successfully, it will generate a directory named vllm_bench_logs in the current working directory. After the execution completes, follow these two steps to verify the benchmark ran correctly and to obtain the performance evaluation results: |
18 | | - |
19 | | -1. Check for failed requests by running the following command in the current directory: |
| 21 | +### Verify Results |
| 22 | +1) Check failed requests: |
20 | 23 | ```bash |
21 | 24 | grep "Fail" -rn vllm_bench_logs |
22 | 25 | ``` |
| 26 | +All matches should show `Fail: 0`. |
23 | 27 |
|
24 | | -All matching lines should report zero failed requests (i.e., Fail: 0). |
25 | | - |
26 | | -2. Generate performance statistics by executing: |
| 28 | +2) Generate statistics: |
27 | 29 | ```bash |
28 | 30 | python3 benchmark_throughput_flagos_statistics.py |
29 | 31 | ``` |
30 | | -This will output the final performance evaluation results based on the collected logs. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## benchmark_throughput_autotune.py |
| 36 | + |
| 37 | + |
| 38 | +### Command |
| 39 | +```bash |
| 40 | +python benchmarks/benchmark_throughput_autotune.py [vllm args] [autotune options] |
| 41 | +``` |
| 42 | + |
| 43 | +### vLLM Args |
| 44 | +All arguments are passed directly to `vllm bench throughput`. |
| 45 | + |
| 46 | +### Autotune Options |
| 47 | +- `--background` (true/false): run in background mode, default `false`. |
| 48 | +- `--ops`: comma-separated list of operator names to tune. If empty, auto-discovers ops. |
| 49 | +- `--num-runs`: number of runs per configuration, default `2` (uses the second round to skip warmup). |
| 50 | +- `--csv-path`: output CSV filename, default `history.csv` under the run directory. |
| 51 | + |
| 52 | +Example: |
| 53 | +```bash |
| 54 | +python benchmarks/benchmark_throughput_autotune.py \ |
| 55 | + --model /models/Qwen3-Next-80B-A3B-Instruct \ |
| 56 | + --tensor-parallel-size 4 \ |
| 57 | + --dataset-name random \ |
| 58 | + --input-len 6144 \ |
| 59 | + --output-len 1024 \ |
| 60 | + --num-prompts 1000 \ |
| 61 | + --max-num-batched-tokens 16384 \ |
| 62 | + --max-num-seqs 2048 \ |
| 63 | + --load-format "dummy" \ |
| 64 | + --gpu-memory-utilization 0.85 \ |
| 65 | + --compilation-config '{"cudagraph_mode": "FULL_AND_PIECEWISE"}' \ |
| 66 | + --background true |
| 67 | +``` |
| 68 | + |
| 69 | +### Environment Variables |
| 70 | +See [environment variables usage](../vllm_fl/dispatch/README.md#environment-variables) for the full dispatch and FlagGems configuration reference. |
| 71 | + |
| 72 | +### Outputs |
| 73 | +Each run creates a directory under `autotune_logs/autotune_xxx` with: |
| 74 | +- `autotune.log`: full run log when setting `background` as `true` |
| 75 | +- `history.csv`: throughput results for all rounds |
| 76 | +- `autotune_ops.yaml`: final op list used for tuning |
| 77 | +- `autotune_configs/`: per-round config snapshots |
| 78 | +- `best_config.yaml`: selected best config |
| 79 | + |
| 80 | +### Notes |
| 81 | +- Round 1 runs baseline throughput without FlagGems. |
| 82 | +- Round 2 benchmarks each op in isolation (whitelist). |
| 83 | +- Round 3 validates the best-performing set. |
0 commit comments