forked from huggingface/pytorch-image-models
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_benchmarks.sh
executable file
·74 lines (68 loc) · 1.58 KB
/
run_benchmarks.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
#!/bin/bash
device="musa"
# device="cuda"
dtype=(
"float32"
"float16"
)
models=(
"resnet50"
# "resnet50d"
# "resnetrs50"
# "resnetrs101"
"resnetv2_50"
"resnetv2_101"
"efficientnet_b0"
"efficientnet_b1"
# "efficientnet_b1_pruned"
"efficientnet_b2"
# "efficientnet_b2_pruned"
"efficientnet_b3"
# "efficientnet_b3_pruned"
"efficientnet_b4"
"efficientnet_b7"
"mobilenetv2_100"
"mobilenetv2_140"
"vgg16"
# "vgg16_bn"
"vgg19"
# "vgg19_bn"
"densenet121"
"densenet161"
"densenet169"
"densenet201"
# "inception_resnet_v2"
"inception_v3"
"inception_v4"
# "vit_base_patch16_224"
# "vit_base_patch16_384"
# "vit_base_patch32_224"
# "vit_base_patch32_384"
# "vit_large_patch16_224"
# "vit_large_patch16_384"
# "vit_large_patch32_384"
# "vit_large_r50_s32_224"
# "vit_large_r50_s32_384"
# "vit_small_patch16_224"
# "vit_small_patch16_384"
# "vit_small_patch32_224"
# "vit_small_patch32_384"
# "vit_small_r26_s32_224"
# "vit_small_r26_s32_384"
# "vit_tiny_patch16_224"
# "vit_tiny_patch16_384"
# "vit_tiny_r_s16_p8_224"
# "vit_tiny_r_s16_p8_384"
)
log_dir="./logs"
log_file="benchmark_$(date +%Y%m%d_%H%M%S).log"
mkdir -p $log_dir
exec > >(tee -a "$log_dir/$log_file") 2>&1
for dtype in "${dtype[@]}"
do
for model in "${models[@]}"
do
echo "Running $model with $dtype"
python benchmark.py --device $device --bench inference --model $model --batch-size 32 --input-size 3 224 224 --precision $dtype
done
done