-
Notifications
You must be signed in to change notification settings - Fork 2
/
run_througput-experiments.sh
executable file
·183 lines (169 loc) · 13.1 KB
/
run_througput-experiments.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/bin/bash
CMAKE_COMMAND=cmake # change this if needed
# Target_data_dir, local dir, algo, cache, threading
function conv_experiment()
{
mkdir -p $1
mkdir $2
pushd $2
$CMAKE_COMMAND ../ -DCMAKE_BUILD_TYPE=Release -DALGO=$3 -DN=256 -DC=16 -DW=227 -DH=227 -DNF=96 -DHF=3 -DWF=3 -DCOLD_CACHES=$4 -DTHREADING=$5 -DCHARTS=relative
sudo make enable_turbo_boost
make -j 4 test-openmp-gomp
sudo make disable_turbo_boost
make roofline
cp roofline* cputest.txt memtest*.txt runtime.txt traffic.txt work.txt algo_info.txt cpu_info.txt $1
popd
}
# Target_data_dir, local dir, algo, cache, threading
function layer_norm_experiment()
{
mkdir -p $1
mkdir $2
pushd $2
$CMAKE_COMMAND ../ -DCMAKE_BUILD_TYPE=Release -DALGO=dnnl_tnc_layer_norm -DN=256 -DC=768 -DW=4 -DH=32 -DCOLD_CACHES=$4 -DTHREADING=$5 -DCHARTS=relative
sudo make enable_turbo_boost
make -j 4 test-openmp-gomp
sudo make disable_turbo_boost
make roofline
cp roofline* cputest.txt memtest*.txt runtime.txt traffic.txt work.txt algo_info.txt cpu_info.txt $1
popd
}
function eltwise_experiment()
{
mkdir -p $1
mkdir $2
pushd $2
$CMAKE_COMMAND ../ -DCMAKE_BUILD_TYPE=Release -DALGO=$3 -DN=256 -DC=96 -DW=55 -DH=55 -DCOLD_CACHES=$4 -DTHREADING=$5 -DCHARTS=relative
sudo make enable_turbo_boost
make -j 4 test-openmp-gomp
sudo make disable_turbo_boost
make roofline
cp roofline* cputest.txt memtest*.txt runtime.txt traffic.txt work.txt algo_info.txt cpu_info.txt $1
popd
}
function binary_experiment()
{
mkdir -p $1
mkdir $2
pushd $2
$CMAKE_COMMAND ../ -DCMAKE_BUILD_TYPE=Release -DALGO=$3 -DN=256 -DC=96 -DW=55 -DH=55 -DCOLD_CACHES=$4 -DTHREADING=$5 -DCHARTS=relative
sudo make enable_turbo_boost
make -j 4 test-openmp-gomp
sudo make disable_turbo_boost
make roofline
cp roofline* cputest.txt memtest*.txt runtime.txt traffic.txt work.txt algo_info.txt cpu_info.txt $1
popd
}
function pool_experiment()
{
mkdir -p $1
mkdir $2
pushd $2
$CMAKE_COMMAND ../ -DCMAKE_BUILD_TYPE=Release -DALGO=$3 -DN=256 -DC=96 -DW=55 -DH=55 -DWF=5 -DCOLD_CACHES=$4 -DTHREADING=$5 -DCHARTS=relative
sudo make enable_turbo_boost
make -j 4 test-openmp-gomp
sudo make disable_turbo_boost
make roofline
cp roofline* cputest.txt memtest*.txt runtime.txt traffic.txt work.txt algo_info.txt cpu_info.txt $1
popd
}
function inner_prod_experiment()
{
mkdir -p $1
mkdir $2
pushd $2
$CMAKE_COMMAND ../ -DCMAKE_BUILD_TYPE=Release -DALGO=$3 -DN=256 -DC=4096 -DW=1 -DH=1 -DNF=1000 -DCOLD_CACHES=$4 -DTHREADING=$5 -DCHARTS=relative
sudo make enable_turbo_boost
make -j 4 test-openmp-gomp
sudo make disable_turbo_boost
make roofline
cp roofline* cputest.txt memtest*.txt runtime.txt traffic.txt work.txt algo_info.txt cpu_info.txt $1
popd
}
DATA_DIR="$PWD/experiment-throughput-`date -I`"
if [ -d $DATA_DIR ]
then
echo "Directory $PWD/experiment-throughput-`date -I` exists. Quitting not too overwrite existing results."
else
# FULL SOCKETS
conv_experiment $DATA_DIR/dnnl_nchw_conv_warm_caches build-conv-nchw-warm-caches dnnl_nchw_conv false full
conv_experiment $DATA_DIR/dnnl_nchw_conv_cold_caches build-conv-nchw-cold-caches dnnl_nchw_conv true full
conv_experiment $DATA_DIR/dnnl_blocked_conv_warm_caches build-conv-blocked-warm-caches dnnl_blocked_conv false full
conv_experiment $DATA_DIR/dnnl_blocked_conv_cold_caches build-conv-blocked-cold-caches dnnl_blocked_conv true full
conv_experiment $DATA_DIR/dnnl_winograd_conv_warm_caches build-conv-winograd-warm-caches dnnl_winograd_conv false full
conv_experiment $DATA_DIR/dnnl_winograd_conv_cold_caches build-conv-winograd-cold-caches dnnl_winograd_conv true full
layer_norm_experiment $DATA_DIR/dnnl_tnc_layer_norm_warm_caches build-tnc-layer_norm_warm_caches dnnl_tnc_layer_norm false full
layer_norm_experiment $DATA_DIR/dnnl_tnc_layer_norm_cold_caches build-tnc-layer_norm_cold_caches dnnl_tnc_layer_norm true full
eltwise_experiment $DATA_DIR/dnnl_nchw_gelu_warm_caches build-eltwise-nchw-warm-caches dnnl_nchw_gelu false full
eltwise_experiment $DATA_DIR/dnnl_nchw_gelu_cold_caches build-eltwise-nchw-cold-caches dnnl_nchw_gelu true full
eltwise_experiment $DATA_DIR/dnnl_blocked_gelu_warm_caches build-eltwise-blocked-warm-caches dnnl_blocked_gelu false full
eltwise_experiment $DATA_DIR/dnnl_blocked_gelu_cold_caches build-eltwise-blocked-cold-caches dnnl_blocked_gelu true full
binary_experiment $DATA_DIR/dnnl_nchw_binary_add_warm_caches build-binary-add-nchw-warm-caches dnnl_nchw_binary_add false full
binary_experiment $DATA_DIR/dnnl_nchw_binary_add_cold_caches build-binary-add-nchw-cold-caches dnnl_nchw_binary_add true full
binary_experiment $DATA_DIR/dnnl_blocked_binary_add_warm_caches build-binary-add-blocked-warm-caches dnnl_blocked_binary_add false full
binary_experiment $DATA_DIR/dnnl_blocked_binary_add_cold_caches build-binary-add-blocked-cold-caches dnnl_blocked_binary_add true full
binary_experiment $DATA_DIR/dnnl_nchw_binary_mul_warm_caches build-binary-mul-nchw-warm-caches dnnl_nchw_binary_mul false full
binary_experiment $DATA_DIR/dnnl_nchw_binary_mul_cold_caches build-binary-mul-nchw-cold-caches dnnl_nchw_binary_mul true full
binary_experiment $DATA_DIR/dnnl_blocked_binary_mul_warm_caches build-binary-mul-blocked-warm-caches dnnl_blocked_binary_mul false full
binary_experiment $DATA_DIR/dnnl_blocked_binary_mul_cold_caches build-binary-mul-blocked-cold-caches dnnl_blocked_binary_mul true full
pool_experiment $DATA_DIR/dnnl_nchw_pool_warm_caches build-pool-nchw-warm-caches dnnl_nchw_pool_avg false full
pool_experiment $DATA_DIR/dnnl_nchw_pool_cold_caches build-pool-nchw-cold-caches dnnl_nchw_pool_avg true full
pool_experiment $DATA_DIR/dnnl_blocked_pool_warm_caches build-pool-blocked-warm-caches dnnl_blocked_pool_avg false full
pool_experiment $DATA_DIR/dnnl_blocked_pool_cold_caches build-pool-blocked-cold-caches dnnl_blocked_pool_avg true full
inner_prod_experiment $DATA_DIR/dnnl_nchw_fc_cold_caches build-fc-nchw-cold-caches dnnl_nchw_fc true full
inner_prod_experiment $DATA_DIR/dnnl_nchw_fc_warm_caches build-fc-nchw-warm-caches dnnl_nchw_fc false full
# ONE SOCKET
conv_experiment $DATA_DIR/dnnl_nchw_conv_warm_caches-socket build-conv-nchw-warm-caches-socket dnnl_nchw_conv false socket
conv_experiment $DATA_DIR/dnnl_nchw_conv_cold_caches-socket build-conv-nchw-cold-caches-socket dnnl_nchw_conv true socket
conv_experiment $DATA_DIR/dnnl_blocked_conv_warm_caches-socket build-conv-blocked-warm-caches-socket dnnl_blocked_conv false socket
conv_experiment $DATA_DIR/dnnl_blocked_conv_cold_caches-socket build-conv-blocked-cold-caches-socket dnnl_blocked_conv true socket
conv_experiment $DATA_DIR/dnnl_winograd_conv_warm_caches-socket build-conv-winograd-warm-caches-socket dnnl_winograd_conv false socket
conv_experiment $DATA_DIR/dnnl_winograd_conv_cold_caches-socket build-conv-winograd-cold-caches-socket dnnl_winograd_conv true socket
layer_norm_experiment $DATA_DIR/dnnl_tnc_layer_norm_warm_caches-socket build-tnc-layer_norm_warm_caches-socket dnnl_tnc_layer_norm false socket
layer_norm_experiment $DATA_DIR/dnnl_tnc_layer_norm_cold_caches-socket build-tnc-layer_norm_cold_caches-socket dnnl_tnc_layer_norm true socket
eltwise_experiment $DATA_DIR/dnnl_nchw_gelu_warm_caches-socket build-eltwise-nchw-warm-caches-socket dnnl_nchw_gelu false socket
eltwise_experiment $DATA_DIR/dnnl_nchw_gelu_cold_caches-socket build-eltwise-nchw-cold-caches-socket dnnl_nchw_gelu true socket
eltwise_experiment $DATA_DIR/dnnl_blocked_gelu_warm_caches-socket build-eltwise-blocked-warm-caches-socket dnnl_blocked_gelu false socket
eltwise_experiment $DATA_DIR/dnnl_blocked_gelu_cold_caches-socket build-eltwise-blocked-cold-caches-socket dnnl_blocked_gelu true socket
binary_experiment $DATA_DIR/dnnl_nchw_binary_add_warm_caches-socket build-binary-add-nchw-warm-caches-socket dnnl_nchw_binary_add false socket
binary_experiment $DATA_DIR/dnnl_nchw_binary_add_cold_caches-socket build-binary-add-nchw-cold-caches-socket dnnl_nchw_binary_add true socket
binary_experiment $DATA_DIR/dnnl_blocked_binary_add_warm_caches-socket build-binary-add-blocked-warm-caches-socket dnnl_blocked_binary_add false socket
binary_experiment $DATA_DIR/dnnl_blocked_binary_add_cold_caches-socket build-binary-add-blocked-cold-caches-socket dnnl_blocked_binary_add true socket
binary_experiment $DATA_DIR/dnnl_nchw_binary_mul_warm_caches-socket build-binary-mul-nchw-warm-caches-socket dnnl_nchw_binary_mul false socket
binary_experiment $DATA_DIR/dnnl_nchw_binary_mul_cold_caches-socket build-binary-mul-nchw-cold-caches-socket dnnl_nchw_binary_mul true socket
binary_experiment $DATA_DIR/dnnl_blocked_binary_mul_warm_caches-socket build-binary-mul-blocked-warm-caches-socket dnnl_blocked_binary_mul false socket
binary_experiment $DATA_DIR/dnnl_blocked_binary_mul_cold_caches-socket build-binary-mul-blocked-cold-caches-socket dnnl_blocked_binary_mul true socket
pool_experiment $DATA_DIR/dnnl_nchw_pool_warm_caches-socket build-pool-nchw-warm-caches-socket dnnl_nchw_pool_avg false socket
pool_experiment $DATA_DIR/dnnl_nchw_pool_cold_caches-socket build-pool-nchw-cold-caches-socket dnnl_nchw_pool_avg true socket
pool_experiment $DATA_DIR/dnnl_blocked_pool_warm_caches-socket build-pool-blocked-warm-caches-socket dnnl_blocked_pool_avg false socket
pool_experiment $DATA_DIR/dnnl_blocked_pool_cold_caches-socket build-pool-blocked-cold-caches-socket dnnl_blocked_pool_avg true socket
inner_prod_experiment $DATA_DIR/dnnl_nchw_fc_cold_caches-socket build-fc-nchw-cold-caches-socket dnnl_nchw_fc true socket
inner_prod_experiment $DATA_DIR/dnnl_nchw_fc_warm_caches-socket build-fc-nchw-warm-caches-socket dnnl_nchw_fc false socket
# SINGLE THREAD
conv_experiment $DATA_DIR/dnnl_nchw_conv_warm_caches-single build-conv-nchw-warm-caches-single dnnl_nchw_conv false single
conv_experiment $DATA_DIR/dnnl_nchw_conv_cold_caches-single build-conv-nchw-cold-caches-single dnnl_nchw_conv true single
conv_experiment $DATA_DIR/dnnl_blocked_conv_warm_caches-single build-conv-blocked-warm-caches-single dnnl_blocked_conv false single
conv_experiment $DATA_DIR/dnnl_blocked_conv_cold_caches-single build-conv-blocked-cold-caches-single dnnl_blocked_conv true single
conv_experiment $DATA_DIR/dnnl_winograd_conv_warm_caches-single build-conv-winograd-warm-caches-single dnnl_winograd_conv false single
conv_experiment $DATA_DIR/dnnl_winograd_conv_cold_caches-single build-conv-winograd-cold-caches-single dnnl_winograd_conv true single
layer_norm_experiment $DATA_DIR/dnnl_tnc_layer_norm_warm_caches-single build-tnc-layer_norm_warm_caches-single dnnl_tnc_layer_norm false single
layer_norm_experiment $DATA_DIR/dnnl_tnc_layer_norm_cold_caches-single build-tnc-layer_norm_cold_caches-single dnnl_tnc_layer_norm true single
eltwise_experiment $DATA_DIR/dnnl_nchw_gelu_warm_caches-single build-eltwise-nchw-warm-caches-single dnnl_nchw_gelu false single
eltwise_experiment $DATA_DIR/dnnl_nchw_gelu_cold_caches-single build-eltwise-nchw-cold-caches-single dnnl_nchw_gelu true single
eltwise_experiment $DATA_DIR/dnnl_blocked_gelu_warm_caches-single build-eltwise-blocked-warm-caches-single dnnl_blocked_gelu false single
eltwise_experiment $DATA_DIR/dnnl_blocked_gelu_cold_caches-single build-eltwise-blocked-cold-caches-single dnnl_blocked_gelu true single
binary_experiment $DATA_DIR/dnnl_nchw_binary_add_warm_caches-single build-binary-add-nchw-warm-caches-single dnnl_nchw_binary_add false single
binary_experiment $DATA_DIR/dnnl_nchw_binary_add_cold_caches-single build-binary-add-nchw-cold-caches-single dnnl_nchw_binary_add true single
binary_experiment $DATA_DIR/dnnl_blocked_binary_add_warm_caches-single build-binary-add-blocked-warm-caches-single dnnl_blocked_binary_add false single
binary_experiment $DATA_DIR/dnnl_blocked_binary_add_cold_caches-single build-binary-add-blocked-cold-caches-single dnnl_blocked_binary_add true single
binary_experiment $DATA_DIR/dnnl_nchw_binary_mul_warm_caches-single build-binary-mul-nchw-warm-caches-single dnnl_nchw_binary_mul false single
binary_experiment $DATA_DIR/dnnl_nchw_binary_mul_cold_caches-single build-binary-mul-nchw-cold-caches-single dnnl_nchw_binary_mul true single
binary_experiment $DATA_DIR/dnnl_blocked_binary_mul_warm_caches-single build-binary-mul-blocked-warm-caches-single dnnl_blocked_binary_mul false single
binary_experiment $DATA_DIR/dnnl_blocked_binary_mul_cold_caches-single build-binary-mul-blocked-cold-caches-single dnnl_blocked_binary_mul true single
pool_experiment $DATA_DIR/dnnl_nchw_pool_cold_caches-single build-pool-nchw-cold-caches-single dnnl_nchw_pool_avg true single
pool_experiment $DATA_DIR/dnnl_nchw_pool_warm_caches-single build-pool-nchw-warm-caches-single dnnl_nchw_pool_avg false single
pool_experiment $DATA_DIR/dnnl_blocked_pool_cold_caches-single build-pool-blocked-cold-caches-single dnnl_blocked_pool_avg true single
pool_experiment $DATA_DIR/dnnl_blocked_pool_warm_caches-single build-pool-blocked-warm-caches-single dnnl_blocked_pool_avg false single
inner_prod_experiment $DATA_DIR/dnnl_nchw_fc_cold_caches-single build-fc-nchw-cold-caches-single dnnl_nchw_fc true single
inner_prod_experiment $DATA_DIR/dnnl_nchw_fc_warm_caches-single build-fc-nchw-warm-caches-single dnnl_nchw_fc false single
fi