|
| 1 | +#!/bin/bash |
| 2 | +# Concurrency array |
| 3 | +concurrency_array=(48) |
| 4 | +#best rate |
| 5 | +rate_array=(0.7) |
| 6 | + |
| 7 | +# Result file |
| 8 | +result_file="benchmark_results.txt" |
| 9 | +echo "Benchmark Results" > $result_file |
| 10 | +echo "===================" >> $result_file |
| 11 | + |
| 12 | +# Loop through all combinations |
| 13 | +for concurrency in "${concurrency_array[@]}"; do |
| 14 | + for rate in "${rate_array[@]}"; do |
| 15 | + echo "Testing with concurrency=$concurrency, rate=$rate" |
| 16 | + echo "" >> $result_file |
| 17 | + echo "Concurrency: $concurrency, Request Rate: $rate" >> $result_file |
| 18 | + echo "-------------------" >> $result_file |
| 19 | + |
| 20 | + # Run benchmark test |
| 21 | + python /mnt/deepseek/vllm/benchmarks/benchmark_serving.py \ |
| 22 | + --backend vllm \ |
| 23 | + --trust-remote-code \ |
| 24 | + --model /mnt/deepseek/DeepSeek-R1-W8A8-VLLM \ |
| 25 | + --dataset-name random \ |
| 26 | + --random-input-len 4096 \ |
| 27 | + --random-output-len 1536 \ |
| 28 | + --ignore-eos \ |
| 29 | + --num-prompts 400 \ |
| 30 | + --max-concurrency $concurrency \ |
| 31 | + --request-rate $rate \ |
| 32 | + --metric-percentiles 90 \ |
| 33 | + --base-url http://localhost:8006 2>&1 | tee -a $result_file |
| 34 | + |
| 35 | + # Wait for system cool down |
| 36 | + sleep 30 |
| 37 | + done |
| 38 | +done |
| 39 | + |
| 40 | +# Analyze results |
| 41 | +echo "Analysis Results" > analysis_results.txt |
| 42 | +echo "=================" >> analysis_results.txt |
| 43 | + |
| 44 | +# Extract and analyze TPOT data |
| 45 | +echo "TPOT Analysis:" >> analysis_results.txt |
| 46 | +grep "Mean TPOT" $result_file | awk -F':' '{ |
| 47 | + printf "Concurrency %s, Rate %s: %s ms\n", $1, $2, $3 |
| 48 | +}' >> analysis_results.txt |
| 49 | + |
| 50 | +# Extract and analyze throughput data |
| 51 | +echo -e "\nThroughput Analysis:" >> analysis_results.txt |
| 52 | +grep "Output token throughput" $result_file | awk -F':' '{ |
| 53 | + printf "Concurrency %s, Rate %s: %s tokens/s\n", $1, $2, $3 |
| 54 | +}' >> analysis_results.txt |
| 55 | + |
| 56 | +echo "Testing completed. Results saved in $result_file and analysis in analysis_results.txt" |
0 commit comments