forked from vllm-project/production-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_aws.sh
More file actions
85 lines (67 loc) · 1.87 KB
/
Copy pathrun_aws.sh
File metadata and controls
85 lines (67 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
if [[ $# -ne 3 ]]; then
echo "Usage: $0 <model> <base url> <save file key>"
exit 1
fi
MODEL=$1
BASE_URL=$2
# Warmup: precompute KV and store inside CPU mem
# CONFIGURATION
NUM_USERS_WARMUP=320
SYSTEM_PROMPT=1000 # Shared system prompt length
CHAT_HISTORY=20000 # User specific chat history length
ANSWER_LEN=100 # Generation length per round
warmup() {
# Warm up the vLLM with a lot of user queries
python3 ./multi-round-qa.py \
--num-users 1 \
--num-rounds 2 \
--qps 2 \
--shared-system-prompt $SYSTEM_PROMPT \
--user-history-prompt $CHAT_HISTORY \
--answer-len $ANSWER_LEN \
--model "$MODEL" \
--base-url "$BASE_URL" \
--output /tmp/warmup.csv \
--log-interval 30 \
--time $((NUM_USERS_WARMUP / 2))
}
warmup
MODEL=$1
BASE_URL=$2
# CONFIGURATION
NUM_USERS=260
NUM_ROUNDS=20
SYSTEM_PROMPT=1000 # Shared system prompt length
CHAT_HISTORY=20000 # User specific chat history length
ANSWER_LEN=100 # Generation length per round
run_benchmark() {
# $1: qps
# $2: output file
# Real run
python3 ./multi-round-qa.py \
--num-users $NUM_USERS \
--num-rounds $NUM_ROUNDS \
--qps "$1" \
--shared-system-prompt "$SYSTEM_PROMPT" \
--user-history-prompt "$CHAT_HISTORY" \
--answer-len $ANSWER_LEN \
--model "$MODEL" \
--base-url "$BASE_URL" \
--output "$2" \
--log-interval 30 \
--time 100
sleep 10
}
KEY=$3
# Run benchmarks for different QPS values
if [[ "$KEY" == "naive" ]]; then
QPS_VALUES=(0.1 0.5 0.9 1.3 1.7 2.1 2.5 2.9 3.3 3.7 4.1)
else
QPS_VALUES=(4.1 3.7 3.3 2.9 2.5 2.1 1.7 1.3 0.9 0.5 0.1)
fi
# Run benchmarks for the determined QPS values
for qps in "${QPS_VALUES[@]}"; do
output_file="${KEY}_output_${qps}.csv"
run_benchmark "$qps" "$output_file"
done