Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit ce08100

Browse files
committed
Merge remote-tracking branch 'remotes/internal/release_1.0.4b' on 9/27 for bug fixing of benchmark script
2 parents 334a423 + cd2d7ad commit ce08100

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

scripts/run_benchmark.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ result_dir=""
2222
caffe_bin="./scripts/run_intelcaffe.sh"
2323

2424
# Iterations to run benchmark
25-
iterations=100
25+
iterations=5
2626

2727
function usage
2828
{
@@ -74,12 +74,10 @@ function run_specific_model
7474

7575
function run_benchmark
7676
{
77-
detect_cpu
7877
echo "Cpu model : $model_string"
7978
if [[ $topology = "all" ]]; then
8079
for ((i=0; i<${#model_list[@]}; i++))
8180
do
82-
echo " ${model_list[$i]}"
8381
model=${model_list[$i]}
8482
run_specific_model
8583
done
@@ -121,5 +119,7 @@ fi
121119
# check if input topology is supported
122120
is_supported_topology
123121

122+
detect_cpu
123+
124124
# start running benchmark
125-
run_benchmark
125+
run_benchmark

scripts/run_intelcaffe.sh

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ function detect_cpu
9595

9696
function set_numa_node
9797
{
98+
numa_bin="numactl -H"
99+
# check if os has 'libnuma' package ready
100+
check_dependency $numa_bin
101+
if [ $? -ne 0 ]; then
102+
echo "No numactl command support."
103+
return
104+
fi
98105
# detect numa mode: cache and flat mode for KNL
99106
numa_node=($(numactl -H | grep "available" | awk -F ' ' '{print $2}'))
100107
if [ $numa_node -eq 1 ]; then
@@ -191,7 +198,7 @@ function clear_envs
191198
function set_mlsl_vars
192199
{
193200
if [ "${num_mlsl_servers}" -eq -1 ]; then
194-
if [ "${numnodes}" -eq 1 ]; then
201+
if [ ${numnodes} -eq 1 ]; then
195202
numservers=0
196203
else
197204
if [ "${cpu_model}" == "bdw" ] || [ "${cpu_model}" == "skx" ]; then
@@ -257,11 +264,18 @@ function execute_command
257264
if [ "${cpu_model}" == "bdw" ] || [ "${cpu_model}" == "skx" ]; then
258265
exec_command="$xeonbin_"
259266
else
260-
261-
exec_command="numactl --preferred=$numanode $xeonbin_"
267+
numa_bin="numactl --preferred=$numanode"
268+
# check if os has 'libnuma' package ready
269+
check_dependency $numa_bin
270+
if [ $? -ne 0 ]; then
271+
echo "No numactl command support."
272+
exec_command="$xeonbin_"
273+
else
274+
exec_command="$numa_bin $xeonbin_"
275+
fi
262276
fi
263277

264-
if [ "${numnodes}" -gt 1 ]; then
278+
if [ ${numnodes} -gt 1 ]; then
265279
# Produce the configuration file for mpiexec.
266280
# Each line of the config file contains a # host, environment, binary name.
267281
cfile_=nodeconfig-${cpu_model}-${numnodes}.txt
@@ -285,7 +299,7 @@ function execute_command
285299
mv $sensor_log_file $result_dir_/
286300
fi
287301

288-
if [ "${numnodes}" -eq 1 ]; then
302+
if [ ${numnodes} -eq 1 ]; then
289303
time GLOG_minloglevel=0 $exec_command >${log_file} 2>&1
290304
else
291305
exec_command="-l -configfile $cfile_"
@@ -317,7 +331,8 @@ function obtain_average_fwd_bwd_time
317331
# used to calculate images / s
318332
function obtain_batch_size
319333
{
320-
batch_size=`cat $model_file | grep shape | sed -n "3, 1p" | awk '{print $4}'`
334+
# catch batch size of training
335+
batch_size=`cat $model_file | grep shape | sed -n "1, 1p" | awk '{print $4}'`
321336
echo "batch size : $batch_size"
322337
}
323338

0 commit comments

Comments
 (0)