From 1e17a516c121b49b7dbaa458a83f050dc8984396 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Tue, 18 Sep 2018 11:53:27 -0700 Subject: [PATCH 1/9] mkldnn is default makefile and explicitly turn off for buidls --- Makefile | 3 +++ ci/docker/runtime_functions.sh | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 620679a44f80..bfe3e97d6f13 100644 --- a/Makefile +++ b/Makefile @@ -60,6 +60,9 @@ endif # use customized config file include $(config) +ifneq ($(USE_MKLDNN), 0) + USE_MKLDNN = 1 + ifeq ($(USE_MKL2017), 1) $(warning "USE_MKL2017 is deprecated. We will switch to USE_MKLDNN.") USE_MKLDNN=1 diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 43006f23974d..55b8bfd6ac14 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -251,6 +251,7 @@ build_centos7_cpu() { USE_LAPACK_PATH=/usr/lib64/liblapack.so \ USE_BLAS=openblas \ USE_DIST_KVSTORE=1 \ + USE_MKLDNN=0 \ -j$(nproc) } @@ -303,6 +304,7 @@ build_centos7_gpu() { USE_CUDA=1 \ USE_CUDA_PATH=/usr/local/cuda \ USE_CUDNN=1 \ + USE_MKLDNN=0 \ USE_DIST_KVSTORE=1 \ CUDA_ARCH="$CI_CUDA_COMPUTE_CAPABILITIES" \ -j$(nproc) @@ -318,6 +320,7 @@ build_ubuntu_cpu_openblas() { export CXX="ccache g++" make \ DEV=1 \ + USE_MKLDNN=0 \ ENABLE_TESTCOVERAGE=1 \ USE_CPP_PACKAGE=1 \ USE_BLAS=openblas \ @@ -385,6 +388,7 @@ build_ubuntu_cpu_clang39() { USE_BLAS=openblas \ USE_OPENMP=0 \ USE_DIST_KVSTORE=1 \ + USE_MKLDNN=0 \ -j$(nproc) } @@ -402,6 +406,7 @@ build_ubuntu_cpu_clang60() { USE_BLAS=openblas \ USE_OPENMP=1 \ USE_DIST_KVSTORE=1 \ + USE_MKLDNN=0 \ -j$(nproc) } @@ -534,6 +539,7 @@ build_ubuntu_gpu_tensorrt() { USE_TENSORRT=1 \ USE_JEMALLOC=0 \ USE_GPERFTOOLS=0 \ + USE_MKLDNN=0 \ ONNX_NAMESPACE=onnx \ CUDA_ARCH="-gencode arch=compute_70,code=compute_70" \ -j$(nproc) @@ -588,6 +594,7 @@ build_ubuntu_gpu_cuda91_cudnn7() { USE_CPP_PACKAGE=1 \ USE_DIST_KVSTORE=1 \ CUDA_ARCH="$CI_CUDA_COMPUTE_CAPABILITIES" \ + USE_MKLDNN=0 \ -j$(nproc) } From abbc3ad526e5ae09334a29d72c87e597a1554993 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Tue, 18 Sep 2018 13:44:24 -0700 Subject: [PATCH 2/9] add endif --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index bfe3e97d6f13..18543fdc917f 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,7 @@ include $(config) ifneq ($(USE_MKLDNN), 0) USE_MKLDNN = 1 +endif ifeq ($(USE_MKL2017), 1) $(warning "USE_MKL2017 is deprecated. We will switch to USE_MKLDNN.") From 92b91f8a19069255d26fa841e06a9ffb2739b949 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Mon, 29 Oct 2018 18:06:55 -0700 Subject: [PATCH 3/9] retrigger From ce5336cb94a912fe6693c3a7c8603fbb406c5c46 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Wed, 31 Oct 2018 13:28:44 -0700 Subject: [PATCH 4/9] retrigger From cb095c6594148a650c4c689592d71c1af251580b Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Wed, 21 Nov 2018 14:25:02 -0800 Subject: [PATCH 5/9] retrigger From c08f6face171389b51a7ac55cb7a930a8623b503 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Wed, 21 Nov 2018 16:35:19 -0800 Subject: [PATCH 6/9] retrigger From bf78666c88e27624fa4d971afbdcf6ca5175fc8f Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Thu, 22 Nov 2018 11:55:27 -0800 Subject: [PATCH 7/9] turn of mkldnn on arm builds --- ci/docker/runtime_functions.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 45eb09f59d10..6b5397c7ff69 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -139,6 +139,7 @@ build_armv6() { -DCMAKE_BUILD_TYPE=Release \ -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_LAPACK=OFF \ + -DUSE_MKLDNN=0FF \ -DBUILD_CPP_EXAMPLES=OFF \ -Dmxnet_LINKER_LIBS=-lgfortran \ -G Ninja /work/mxnet @@ -170,6 +171,7 @@ build_armv7() { -DCMAKE_BUILD_TYPE=Release \ -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_LAPACK=OFF \ + -DUSE_MKLDNN=0FF \ -DBUILD_CPP_EXAMPLES=OFF \ -Dmxnet_LINKER_LIBS=-lgfortran \ -G Ninja /work/mxnet @@ -190,6 +192,7 @@ build_armv8() { -DUSE_LAPACK=OFF\ -DUSE_SIGNAL_HANDLER=ON\ -DCMAKE_BUILD_TYPE=Release\ + -DUSE_MKLDNN=0FF \ -DUSE_MKL_IF_AVAILABLE=OFF\ -G Ninja /work/mxnet ninja -v @@ -215,6 +218,7 @@ build_android_armv7() { -DUSE_OPENCV=OFF\ -DUSE_OPENMP=OFF\ -DUSE_SIGNAL_HANDLER=ON\ + -DUSE_MKLDNN=0FF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo\ -DUSE_MKL_IF_AVAILABLE=OFF\ -G Ninja /work/mxnet @@ -234,6 +238,7 @@ build_android_armv8() { -DUSE_SIGNAL_HANDLER=ON\ -DCMAKE_BUILD_TYPE=RelWithDebInfo\ -DUSE_MKL_IF_AVAILABLE=OFF\ + -DUSE_MKLDNN=0FF \ -G Ninja /work/mxnet ninja -v } From e5a40f6807243ec357cd3039054c5c841bcd8c18 Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Thu, 13 Dec 2018 10:48:38 -0800 Subject: [PATCH 8/9] enable mkldnn on all builds --- ci/docker/runtime_functions.sh | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 4f2f0f0d8994..4b74ee825a4e 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -140,7 +140,6 @@ build_armv6() { -DCMAKE_BUILD_TYPE=Release \ -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_LAPACK=OFF \ - -DUSE_MKLDNN=0FF \ -DBUILD_CPP_EXAMPLES=OFF \ -Dmxnet_LINKER_LIBS=-lgfortran \ -G Ninja /work/mxnet @@ -172,7 +171,6 @@ build_armv7() { -DCMAKE_BUILD_TYPE=Release \ -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_LAPACK=OFF \ - -DUSE_MKLDNN=0FF \ -DBUILD_CPP_EXAMPLES=OFF \ -Dmxnet_LINKER_LIBS=-lgfortran \ -G Ninja /work/mxnet @@ -193,7 +191,6 @@ build_armv8() { -DUSE_LAPACK=OFF\ -DUSE_SIGNAL_HANDLER=ON\ -DCMAKE_BUILD_TYPE=Release\ - -DUSE_MKLDNN=0FF \ -DUSE_MKL_IF_AVAILABLE=OFF\ -G Ninja /work/mxnet ninja -v @@ -219,7 +216,6 @@ build_android_armv7() { -DUSE_OPENCV=OFF\ -DUSE_OPENMP=OFF\ -DUSE_SIGNAL_HANDLER=ON\ - -DUSE_MKLDNN=0FF \ -DCMAKE_BUILD_TYPE=RelWithDebInfo\ -DUSE_MKL_IF_AVAILABLE=OFF\ -G Ninja /work/mxnet @@ -239,7 +235,6 @@ build_android_armv8() { -DUSE_SIGNAL_HANDLER=ON\ -DCMAKE_BUILD_TYPE=RelWithDebInfo\ -DUSE_MKL_IF_AVAILABLE=OFF\ - -DUSE_MKLDNN=0FF \ -G Ninja /work/mxnet ninja -v } @@ -257,7 +252,6 @@ build_centos7_cpu() { USE_LAPACK_PATH=/usr/lib64/liblapack.so \ USE_BLAS=openblas \ USE_DIST_KVSTORE=1 \ - USE_MKLDNN=0 \ -j$(nproc) } @@ -291,7 +285,6 @@ build_centos7_mkldnn() { ENABLE_TESTCOVERAGE=1 \ USE_LAPACK=1 \ USE_LAPACK_PATH=/usr/lib64/liblapack.so \ - USE_MKLDNN=1 \ USE_BLAS=openblas \ -j$(nproc) } @@ -310,7 +303,6 @@ build_centos7_gpu() { USE_CUDA=1 \ USE_CUDA_PATH=/usr/local/cuda \ USE_CUDNN=1 \ - USE_MKLDNN=0 \ USE_DIST_KVSTORE=1 \ CUDA_ARCH="$CI_CUDA_COMPUTE_CAPABILITIES" \ -j$(nproc) @@ -326,7 +318,6 @@ build_ubuntu_cpu_openblas() { export CXX="ccache g++" make \ DEV=1 \ - USE_MKLDNN=0 \ ENABLE_TESTCOVERAGE=1 \ USE_CPP_PACKAGE=1 \ USE_BLAS=openblas \ @@ -394,7 +385,6 @@ build_ubuntu_cpu_clang39() { USE_BLAS=openblas \ USE_OPENMP=0 \ USE_DIST_KVSTORE=1 \ - USE_MKLDNN=0 \ -j$(nproc) } @@ -412,7 +402,6 @@ build_ubuntu_cpu_clang60() { USE_BLAS=openblas \ USE_OPENMP=1 \ USE_DIST_KVSTORE=1 \ - USE_MKLDNN=0 \ -j$(nproc) } @@ -454,7 +443,6 @@ build_ubuntu_cpu_clang39_mkldnn() { ENABLE_TESTCOVERAGE=1 \ USE_CPP_PACKAGE=1 \ USE_BLAS=openblas \ - USE_MKLDNN=1 \ USE_OPENMP=0 \ -j$(nproc) } @@ -471,7 +459,6 @@ build_ubuntu_cpu_clang60_mkldnn() { ENABLE_TESTCOVERAGE=1 \ USE_CPP_PACKAGE=1 \ USE_BLAS=openblas \ - USE_MKLDNN=1 \ USE_OPENMP=1 \ -j$(nproc) } @@ -486,7 +473,6 @@ build_ubuntu_cpu_mkldnn() { ENABLE_TESTCOVERAGE=1 \ USE_CPP_PACKAGE=1 \ USE_BLAS=openblas \ - USE_MKLDNN=1 \ -j$(nproc) } @@ -545,7 +531,6 @@ build_ubuntu_gpu_tensorrt() { USE_TENSORRT=1 \ USE_JEMALLOC=0 \ USE_GPERFTOOLS=0 \ - USE_MKLDNN=0 \ ONNX_NAMESPACE=onnx \ CUDA_ARCH="-gencode arch=compute_70,code=compute_70" \ -j$(nproc) @@ -561,7 +546,6 @@ build_ubuntu_gpu_mkldnn() { ENABLE_TESTCOVERAGE=1 \ USE_CPP_PACKAGE=1 \ USE_BLAS=openblas \ - USE_MKLDNN=1 \ USE_CUDA=1 \ USE_CUDA_PATH=/usr/local/cuda \ USE_CUDNN=1 \ @@ -578,7 +562,6 @@ build_ubuntu_gpu_mkldnn_nocudnn() { DEV=1 \ ENABLE_TESTCOVERAGE=1 \ USE_BLAS=openblas \ - USE_MKLDNN=1 \ USE_CUDA=1 \ USE_CUDA_PATH=/usr/local/cuda \ USE_CUDNN=0 \ @@ -600,7 +583,6 @@ build_ubuntu_gpu_cuda91_cudnn7() { USE_CPP_PACKAGE=1 \ USE_DIST_KVSTORE=1 \ CUDA_ARCH="$CI_CUDA_COMPUTE_CAPABILITIES" \ - USE_MKLDNN=0 \ -j$(nproc) } @@ -633,7 +615,6 @@ build_ubuntu_gpu_cmake_mkldnn() { -DUSE_CUDA=1 \ -DUSE_CUDNN=1 \ -DUSE_MKLML_MKL=1 \ - -DUSE_MKLDNN=1 \ -DCMAKE_BUILD_TYPE=Release \ -DCUDA_ARCH_NAME=Manual \ -DCUDA_ARCH_BIN=$CI_CMAKE_CUDA_ARCH_BIN \ @@ -656,7 +637,6 @@ build_ubuntu_gpu_cmake() { -DUSE_CUDA=1 \ -DUSE_CUDNN=1 \ -DUSE_MKLML_MKL=0 \ - -DUSE_MKLDNN=0 \ -DUSE_DIST_KVSTORE=1 \ -DCMAKE_BUILD_TYPE=Release \ -DCUDA_ARCH_NAME=Manual \ From 7f1f81ff13fda51180314bac2051f9709ad1ba6e Mon Sep 17 00:00:00 2001 From: Alexander Zai Date: Thu, 13 Dec 2018 14:42:27 -0800 Subject: [PATCH 9/9] set make flag correctly --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4a5a81d3e5fe..4822f91bade4 100644 --- a/Makefile +++ b/Makefile @@ -60,7 +60,7 @@ endif # use customized config file include $(config) -ifneq ($(USE_MKLDNN), 0) +ifndef $(USE_MKLDNN) USE_MKLDNN = 1 endif