-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·121 lines (112 loc) · 2.95 KB
/
run.sh
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
TASK=$1
OPTIONS="${@:2}"
function mobile_benchmark_vivo() {
for model in `ls ${MODEL_DIR}`
do
echo "********************" && echo $model &&
python tools.py mobile_benchmark \
--model "${MODEL_DIR}/$model" \
--num_runs=30 \
--warmup_runs=30 \
--num_threads=1 \
--taskset_mask=c0 \
--serial_number=0000028e2c780e4e \
--benchmark_binary_dir="/data/local/tmp" \
--no_root \
$OPTIONS # --no_xnnpack
done
}
function mobile_benchmark_pixel1() {
for model in `ls ${MODEL_DIR}`
do
echo "********************" && echo $model &&
python tools.py mobile_benchmark \
--model "${MODEL_DIR}/$model" \
--num_runs=20 \
--warmup_runs=10 \
--num_threads=1 \
--taskset_mask=c \
--serial_number=FA6A70311471 \
--benchmark_binary_dir="/data/local/tmp" \
--no_root \
$OPTIONS
done
}
function mobile_benchmark_mi() {
for model in `ls ${MODEL_DIR}`
do
echo "********************" && echo $model &&
python tools.py mobile_benchmark \
--model "${MODEL_DIR}/$model" \
--num_runs=30 \
--warmup_runs=30 \
--num_threads=1 \
--taskset_mask=70 \
--serial_number=2458c476 \
--benchmark_binary_dir="/data/local/tmp" \
--no_root \
$OPTIONS # --no_xnnpack
done
}
function mobile_benchmark_pixel4() {
for model in `ls ${MODEL_DIR}`
do
echo "********************" && echo $model &&
python tools.py mobile_benchmark \
--model "${MODEL_DIR}/$model" \
--num_runs=20 \
--warmup_runs=15 \
--num_threads=1 \
--taskset_mask=70 \
$OPTIONS
done
}
function mobile_benchmark_pixel4_thread4() {
for model in `ls ${MODEL_DIR}`
do
echo "********************" && echo $model &&
python tools.py mobile_benchmark \
--model "${MODEL_DIR}/$model" \
--num_runs=30 \
--warmup_runs=30 \
--num_threads=4 \
--taskset_mask=f0
done
}
function mobile_benchmark_pixel4_thread8() {
for model in `ls ${MODEL_DIR}`
do
echo "********************" && echo $model &&
python tools.py mobile_benchmark \
--model "${MODEL_DIR}/$model" \
--num_runs=30 \
--warmup_runs=30 \
--num_threads=8 \
--taskset_mask=ff
done
}
function onnx_benchmark() {
for model in `ls ${MODEL_DIR}`
do
python tools.py server_benchmark \
--model "${MODEL_DIR}/$model" \
--num_runs=200 \
--top=30 \
--warmup_runs=30 \
--precision=3 \
$OPTIONS
done
}
function trt_benchmark() {
for model in `ls ${MODEL_DIR}`
do
python benchmark/tensorrt/onnx_trt_test.py \
--model "${MODEL_DIR}/$model" \
--num_runs=100 \
--warmup_runs=30 \
--top=20 \
$OPTIONS
done
}
$TASK ""