From 86a9434c71e94e5a53d1bb247e6a54095ff4928e Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Mon, 25 Sep 2017 15:40:54 +0800 Subject: [PATCH] rename script and modify comments --- .../image/{run.mkldnn.sh => run_mkldnn.sh} | 29 ++++++++++--------- paddle/trainer/tests/test_CompareTwoNets.cpp | 4 +-- 2 files changed, 17 insertions(+), 16 deletions(-) rename benchmark/paddle/image/{run.mkldnn.sh => run_mkldnn.sh} (70%) diff --git a/benchmark/paddle/image/run.mkldnn.sh b/benchmark/paddle/image/run_mkldnn.sh similarity index 70% rename from benchmark/paddle/image/run.mkldnn.sh rename to benchmark/paddle/image/run_mkldnn.sh index 9f762436959..5b0a0373448 100755 --- a/benchmark/paddle/image/run.mkldnn.sh +++ b/benchmark/paddle/image/run_mkldnn.sh @@ -7,16 +7,17 @@ export KMP_AFFINITY="granularity=fine,compact,0,0" function train() { topology=$1 bs=$2 - thread=1 - if [ $3 ]; then - thread=$3 - fi - if [ $thread -eq 1 ]; then - use_mkldnn=1 + use_mkldnn=$3 + if [ $3 == "True" ]; then + use_mkldnn=$3 + thread=1 log="logs/${topology}-mkldnn-${bs}.log" - else - use_mkldnn=0 + elif [ $3 == "False" ]; then + use_mkldnn=$3 + thread=`nproc` log="logs/${topology}-${thread}mklml-${bs}.log" + else + echo "Wrong input $3, use True or False." fi args="batch_size=${bs}" config="${topology}.py" @@ -40,11 +41,11 @@ fi #========= mkldnn =========# # vgg -train vgg 64 -train vgg 128 -train vgg 256 +train vgg 64 True +train vgg 128 True +train vgg 256 True #========== mklml ===========# -train vgg 64 16 -train vgg 128 16 -train vgg 256 16 +train vgg 64 False +train vgg 128 False +train vgg 256 False diff --git a/paddle/trainer/tests/test_CompareTwoNets.cpp b/paddle/trainer/tests/test_CompareTwoNets.cpp index 00ad75b3631..307645d2c3d 100644 --- a/paddle/trainer/tests/test_CompareTwoNets.cpp +++ b/paddle/trainer/tests/test_CompareTwoNets.cpp @@ -33,8 +33,8 @@ DECLARE_string(nics); DEFINE_string(config_file_a, "", "config of one network to compare"); DEFINE_string(config_file_b, "", "config of another network to compare"); -DEFINE_bool(use_mkldnn_a, false, "whether to use mkldnn to run network"); -DEFINE_bool(use_mkldnn_b, false, "whether to use mkldnn to run network"); +DEFINE_bool(use_mkldnn_a, false, "whether to use mkldnn to run config_file_a"); +DEFINE_bool(use_mkldnn_b, false, "whether to use mkldnn to run config_file_b"); DEFINE_bool(need_high_accuracy, false, "whether need to run in double accuracy"); -- GitLab