From eaf9e0a78e2b67c65724cfb9a4ce74d0ac001d4b Mon Sep 17 00:00:00 2001 From: Bartosz Kuncer Date: Wed, 10 Mar 2021 16:02:57 +0100 Subject: [PATCH] Remove USE_MKL_IF_AVAILABLE flag --- CMakeLists.txt | 5 +- ci/build_windows.py | 6 +- ci/docker/runtime_functions.sh | 65 ++++++++++--------- ci/jenkins/Jenkins_steps.groovy | 2 +- cmake/ChooseBlas.cmake | 10 ++- config/darwin.cmake | 1 - config/distribution/darwin_cpu.cmake | 1 - config/distribution/darwin_native.cmake | 1 - config/distribution/linux_cpu.cmake | 2 +- config/distribution/linux_cu100.cmake | 2 +- config/distribution/linux_cu101.cmake | 2 +- config/distribution/linux_cu102.cmake | 2 +- config/distribution/linux_cu110.cmake | 2 +- config/distribution/linux_cu112.cmake | 2 +- config/distribution/linux_cu92.cmake | 2 +- config/distribution/linux_native.cmake | 2 +- config/linux.cmake | 3 - config/linux_gpu.cmake | 3 - .../backend/mkldnn/mkldnn_readme.md | 2 +- .../get_started/devices/raspberry_pi.md | 4 +- tests/README.md | 4 +- 21 files changed, 54 insertions(+), 69 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a3a9b766d7f..35348976805d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,9 +60,8 @@ cmake_dependent_option(USE_SSE "Build with x86 SSE instruction support" ON "CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL amd64" OFF) option(USE_F16C "Build with x86 F16C instruction support" ON) # autodetects support if ON option(USE_LAPACK "Build with lapack support" ON) -option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON) -option(USE_MKL_LAYERNORM "Use layer normalization from MKL, which is currently slower than internal. No effect unless USE_MKL_IF_AVAILABLE is set." OFF) -if(USE_MKL_IF_AVAILABLE AND (NOT APPLE) AND (NOT MSVC) AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") AND (NOT CMAKE_CROSSCOMPILING)) +option(USE_MKL_LAYERNORM "Use layer normalization from MKL, which is currently slower than internal. No effect unless USE_BLAS=MKL (or mkl)." OFF) +if((NOT APPLE) AND (NOT MSVC) AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") AND (NOT CMAKE_CROSSCOMPILING)) option(USE_MKLDNN "Build with MKL-DNN support" ON) else() option(USE_MKLDNN "Build with MKL-DNN support" OFF) diff --git a/ci/build_windows.py b/ci/build_windows.py index f74fa6c6e95f..899d1ddcd332 100755 --- a/ci/build_windows.py +++ b/ci/build_windows.py @@ -67,7 +67,6 @@ class BuildFlavour(Enum): '-DUSE_LAPACK=ON ' '-DUSE_DIST_KVSTORE=OFF ' '-DBUILD_CPP_EXAMPLES=ON ' - '-DUSE_MKL_IF_AVAILABLE=OFF ' '-DCMAKE_BUILD_TYPE=Release') , 'WIN_CPU_MKLDNN': ( @@ -80,7 +79,6 @@ class BuildFlavour(Enum): '-DUSE_BLAS=open ' '-DUSE_LAPACK=ON ' '-DUSE_DIST_KVSTORE=OFF ' - '-DUSE_MKL_IF_AVAILABLE=ON ' '-DUSE_MKLDNN=ON ' '-DCMAKE_BUILD_TYPE=Release') @@ -94,7 +92,6 @@ class BuildFlavour(Enum): '-DUSE_BLAS=mkl ' '-DUSE_LAPACK=ON ' '-DUSE_DIST_KVSTORE=OFF ' - '-DUSE_MKL_IF_AVAILABLE=ON ' '-DUSE_MKLDNN=ON ' '-DCMAKE_BUILD_TYPE=Release') @@ -108,7 +105,6 @@ class BuildFlavour(Enum): '-DUSE_BLAS=mkl ' '-DUSE_LAPACK=ON ' '-DUSE_DIST_KVSTORE=OFF ' - '-DUSE_MKL_IF_AVAILABLE=ON ' '-DUSE_MKLDNN=OFF ' '-DCMAKE_BUILD_TYPE=Release') @@ -123,7 +119,6 @@ class BuildFlavour(Enum): '-DUSE_LAPACK=ON ' '-DUSE_DIST_KVSTORE=OFF ' '-DMXNET_CUDA_ARCH="5.2" ' - '-DUSE_MKL_IF_AVAILABLE=OFF ' '-DCMAKE_BUILD_TYPE=Release') , 'WIN_GPU_MKLDNN': ( @@ -228,6 +223,7 @@ def nix_build(args): logging.info("Generating project with CMake") check_call("cmake \ -DUSE_CUDA=OFF \ + -DUSE_BLAS=open \ -DUSE_OPENCV=OFF \ -DUSE_OPENMP=OFF \ -DCMAKE_BUILD_TYPE=Debug \ diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index fb9783db4dd2..b760f08159b0 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -115,17 +115,17 @@ build_dynamic_libmxnet() { # Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2. export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" if [[ ${mxnet_variant} = "cpu" ]]; then - cmake -DUSE_MKL_IF_AVAILABLE=OFF \ + cmake -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_CUDA=OFF \ -G Ninja /work/mxnet elif [[ ${mxnet_variant} = "native" ]]; then - cmake -DUSE_MKL_IF_AVAILABLE=OFF \ + cmake -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_CUDA=OFF \ -G Ninja /work/mxnet elif [[ ${mxnet_variant} =~ cu[0-9]+$ ]]; then - cmake -DUSE_MKL_IF_AVAILABLE=OFF \ + cmake -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_DIST_KVSTORE=ON \ -DUSE_CUDA=ON \ @@ -147,8 +147,8 @@ build_jetson() { -DUSE_OPENCV=OFF \ -DUSE_OPENMP=ON \ -DUSE_LAPACK=OFF \ + -DUSE_BLAS=Open \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -G Ninja /work/mxnet ninja build_wheel @@ -170,8 +170,8 @@ build_armv6() { -DUSE_OPENCV=OFF \ -DUSE_OPENMP=OFF \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_LAPACK=OFF \ + -DUSE_BLAS=Open \ -DBUILD_CPP_EXAMPLES=OFF \ -G Ninja /work/mxnet @@ -189,8 +189,8 @@ build_armv7() { -DUSE_OPENCV=OFF \ -DUSE_OPENMP=ON \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_LAPACK=OFF \ + -DUSE_BLAS=Open \ -DBUILD_CPP_EXAMPLES=OFF \ -G Ninja /work/mxnet @@ -206,8 +206,8 @@ build_armv8() { -DUSE_OPENCV=OFF \ -DUSE_OPENMP=ON \ -DUSE_LAPACK=OFF \ + -DUSE_BLAS=Open \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -G Ninja /work/mxnet ninja build_wheel @@ -229,9 +229,9 @@ build_android_armv7() { -DANDROID_STL="c++_shared" \ -DUSE_CUDA=OFF \ -DUSE_LAPACK=OFF \ + -DUSE_BLAS=Open \ -DUSE_OPENCV=OFF \ -DUSE_OPENMP=OFF \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -G Ninja /work/mxnet ninja } @@ -247,10 +247,10 @@ build_android_armv8() { -DANDROID_STL="c++_shared" \ -DUSE_CUDA=OFF \ -DUSE_LAPACK=OFF \ + -DUSE_BLAS=Open \ -DUSE_OPENCV=OFF \ -DUSE_OPENMP=OFF \ -DUSE_SIGNAL_HANDLER=ON \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -G Ninja /work/mxnet ninja } @@ -263,12 +263,12 @@ build_centos7_cpu() { export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" cmake \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_MKLDNN=OFF \ -DUSE_DIST_KVSTORE=ON \ -DUSE_CUDA=OFF \ -DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \ -DUSE_INT64_TENSOR_SIZE=OFF \ + -DUSE_BLAS=Open \ -G Ninja /work/mxnet ninja } @@ -279,8 +279,7 @@ build_centos7_mkldnn() { source /opt/rh/devtoolset-7/enable # Opt in to newer GCC C++ ABI. devtoolset defaults to ABI Version 2. export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" - cmake \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + cmake -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_CUDA=OFF \ -DUSE_INT64_TENSOR_SIZE=OFF \ @@ -296,7 +295,7 @@ build_centos7_gpu() { export CXXFLAGS="-fabi-version=11 -fabi-compat-version=7" cmake \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_CUDA=ON \ -DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \ @@ -318,7 +317,7 @@ build_ubuntu_cpu_openblas() { -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DENABLE_TESTCOVERAGE=ON \ -DUSE_TVM_OP=ON \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_CUDA=OFF \ -DUSE_DIST_KVSTORE=ON \ @@ -337,7 +336,6 @@ build_ubuntu_cpu_mkl() { -DUSE_MKLDNN=OFF \ -DUSE_CUDA=OFF \ -DUSE_TVM_OP=ON \ - -DUSE_MKL_IF_AVAILABLE=ON \ -DUSE_MKL_LAYERNORM=ON \ -DUSE_BLAS=MKL \ -DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \ @@ -353,7 +351,7 @@ build_ubuntu_cpu_cmake_debug() { -DENABLE_TESTCOVERAGE=ON \ -DUSE_CUDA=OFF \ -DUSE_TVM_OP=ON \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_OPENMP=OFF \ -DUSE_OPENCV=ON \ -DUSE_SIGNAL_HANDLER=ON \ @@ -368,7 +366,7 @@ build_ubuntu_cpu_cmake_no_tvm_op() { CC=gcc-7 CXX=g++-7 cmake \ -DUSE_CUDA=OFF \ -DUSE_TVM_OP=OFF \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_OPENMP=OFF \ -DUSE_OPENCV=ON \ -DUSE_SIGNAL_HANDLER=ON \ @@ -386,7 +384,7 @@ build_ubuntu_cpu_cmake_asan() { cd /work/build cmake \ -DUSE_CUDA=OFF \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_OPENMP=OFF \ -DUSE_OPENCV=OFF \ @@ -402,6 +400,7 @@ build_ubuntu_cpu_gcc8_werror() { set -ex cd /work/build CC=gcc-8 CXX=g++-8 cmake \ + -DUSE_BLAS=Open \ -DUSE_CUDA=OFF \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -GNinja /work/mxnet @@ -412,6 +411,7 @@ build_ubuntu_cpu_clang10_werror() { set -ex cd /work/build CXX=clang++-10 CC=clang-10 cmake \ + -DUSE_BLAS=Open \ -DUSE_CUDA=OFF \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -GNinja /work/mxnet @@ -429,6 +429,7 @@ build_ubuntu_gpu_clang10_werror() { export CXXFLAGS="-I/usr/local/thrust" CXX=clang++-10 CC=clang-10 cmake \ + -DUSE_BLAS=Open \ -DUSE_CUDA=ON \ -DUSE_NVML=OFF \ -DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \ @@ -442,7 +443,7 @@ build_ubuntu_cpu_clang6() { cd /work/build export OpenBLAS_HOME=/usr/local/openblas-clang/ CXX=clang++-6.0 CC=clang-6.0 cmake \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_CUDA=OFF \ -DUSE_OPENMP=OFF \ @@ -456,7 +457,7 @@ build_ubuntu_cpu_clang100() { cd /work/build export OpenBLAS_HOME=/usr/local/openblas-clang/ CXX=clang++-10 CC=clang-10 cmake \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_CUDA=OFF \ -DUSE_OPENMP=ON \ @@ -471,7 +472,7 @@ build_ubuntu_cpu_clang_tidy() { export OpenBLAS_HOME=/usr/local/openblas-clang/ # TODO(leezu) USE_OPENMP=OFF 3rdparty/dmlc-core/CMakeLists.txt:79 broken? CXX=clang++-10 CC=clang-10 cmake \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_CUDA=OFF \ -DUSE_OPENMP=OFF \ @@ -487,7 +488,7 @@ build_ubuntu_cpu_clang6_mkldnn() { cd /work/build export OpenBLAS_HOME=/usr/local/openblas-clang/ CXX=clang++-6.0 CC=clang-6.0 cmake \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_CUDA=OFF \ -DUSE_OPENMP=OFF \ @@ -500,7 +501,7 @@ build_ubuntu_cpu_clang100_mkldnn() { cd /work/build export OpenBLAS_HOME=/usr/local/openblas-clang/ CXX=clang++-10 CC=clang-10 cmake \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_CUDA=OFF \ -G Ninja /work/mxnet @@ -513,8 +514,8 @@ build_ubuntu_cpu_mkldnn() { CC=gcc-7 CXX=g++-7 cmake \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ -DENABLE_TESTCOVERAGE=ON \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_TVM_OP=ON \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_CUDA=OFF \ -DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \ @@ -531,7 +532,6 @@ build_ubuntu_cpu_mkldnn_mkl() { -DUSE_MKLDNN=ON \ -DUSE_CUDA=OFF \ -DUSE_TVM_OP=ON \ - -DUSE_MKL_IF_AVAILABLE=ON \ -DUSE_BLAS=MKL \ -DBUILD_EXTENSION_PATH=/work/mxnet/example/extensions/lib_external_ops \ -GNinja /work/mxnet @@ -583,9 +583,9 @@ build_ubuntu_gpu_tensorrt() { -DUSE_OPENCV=1 \ -DUSE_TENSORRT=1 \ -DUSE_OPENMP=0 \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=0 \ -DUSE_NVML=OFF \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \ -G Ninja \ /work/mxnet @@ -598,7 +598,7 @@ build_ubuntu_gpu_mkldnn() { cd /work/build CC=gcc-7 CXX=g++-7 cmake \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_CUDA=ON \ -DUSE_NVML=OFF \ -DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \ @@ -612,7 +612,7 @@ build_ubuntu_gpu_mkldnn_nocudnn() { cd /work/build CC=gcc-7 CXX=g++-7 cmake \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_BLAS=Open \ -DUSE_CUDA=ON \ -DUSE_NVML=OFF \ -DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \ @@ -627,11 +627,11 @@ build_ubuntu_gpu() { cd /work/build CC=gcc-7 CXX=g++-7 cmake \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_CUDA=ON \ -DUSE_NVML=OFF \ -DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \ -DUSE_CUDNN=ON \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_DIST_KVSTORE=ON \ -DBUILD_CYTHON_MODULES=ON \ @@ -645,11 +645,11 @@ build_ubuntu_gpu_debug() { cd /work/build CC=gcc-7 CXX=g++-7 cmake \ -DCMAKE_BUILD_TYPE=Debug \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_CUDA=ON \ -DUSE_NVML=OFF \ -DMXNET_CUDA_ARCH="$CI_CMAKE_CUDA_ARCH" \ -DUSE_CUDNN=ON \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=OFF \ -DUSE_DIST_KVSTORE=ON \ -DBUILD_CYTHON_MODULES=ON \ @@ -664,6 +664,7 @@ build_ubuntu_cpu_large_tensor() { -DUSE_SIGNAL_HANDLER=ON \ -DUSE_CUDA=OFF \ -DUSE_CUDNN=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -G Ninja \ /work/mxnet @@ -678,8 +679,8 @@ build_ubuntu_gpu_large_tensor() { -DUSE_SIGNAL_HANDLER=ON \ -DUSE_CUDA=ON \ -DUSE_CUDNN=ON \ - -DUSE_NVML=OFF \ - -DUSE_MKL_IF_AVAILABLE=OFF \ + -DUSE_NVML=OFF \ + -DUSE_BLAS=Open \ -DUSE_MKLDNN=ON \ -DUSE_DIST_KVSTORE=ON \ -DCMAKE_BUILD_TYPE=Release \ diff --git a/ci/jenkins/Jenkins_steps.groovy b/ci/jenkins/Jenkins_steps.groovy index b0244c114b36..2661363580d3 100644 --- a/ci/jenkins/Jenkins_steps.groovy +++ b/ci/jenkins/Jenkins_steps.groovy @@ -36,7 +36,7 @@ mx_mkldnn_lib = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/ mx_tensorrt_lib = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf, lib/libnvonnxparser_runtime.so.0, lib/libnvonnxparser.so.0, lib/libonnx_proto.so, lib/libonnx.so' mx_lib_cpp_examples = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf, build/libcustomop_lib.so, build/libcustomop_gpu_lib.so, build/libsubgraph_lib.so, example/extensions/lib_external_ops/build/libexternal_lib.so, python/mxnet/_cy3/*.so, python/mxnet/_ffi/_cy3/*.so' mx_lib_cpp_examples_no_tvm_op = 'build/libmxnet.so, build/libcustomop_lib.so, build/libcustomop_gpu_lib.so, build/libsubgraph_lib.so, python/mxnet/_cy3/*.so, python/mxnet/_ffi/_cy3/*.so' -mx_lib_cpp_examples_cpu = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf, ' +mx_lib_cpp_examples_cpu = 'build/libmxnet.so, build/3rdparty/tvm/libtvm_runtime.so, build/libtvmop.so, build/tvmop.conf' mx_cd_lib = 'lib/libmxnet.so, licenses/*, lib/libgfortran.so.*, lib/libopenblas.so.0, include/mkldnn/oneapi/dnnl/dnnl_version.h, include/mkldnn/oneapi/dnnl/dnnl_config.h' diff --git a/cmake/ChooseBlas.cmake b/cmake/ChooseBlas.cmake index 16d82db5a95c..3f7544eb90cb 100644 --- a/cmake/ChooseBlas.cmake +++ b/cmake/ChooseBlas.cmake @@ -24,12 +24,10 @@ set(INTEL_OPT_ROOT "/opt/intel" CACHE PATH "Folder contains root-installed intel if(DEFINED USE_BLAS) set(BLAS "${USE_BLAS}") else() - if (USE_MKL_IF_AVAILABLE) - # Setting up BLAS_mkl_MKLROOT for non-Ubuntu 20.04 OSes - find_path(BLAS_mkl_MKLROOT mkl PATHS $ENV{MKLROOT} ${INTEL_HOME_ROOT} ${INTEL_OPT_ROOT}) - if(NOT BLAS_mkl_MKLROOT STREQUAL "BLAS_mkl_MKLROOT-NOTFOUND") - set(BLAS "MKL") - endif() + # Setting up BLAS_mkl_MKLROOT for non-Ubuntu 20.04 OSes + find_path(BLAS_mkl_MKLROOT mkl PATHS $ENV{MKLROOT} ${INTEL_HOME_ROOT} ${INTEL_OPT_ROOT}) + if(NOT BLAS_mkl_MKLROOT STREQUAL "BLAS_mkl_MKLROOT-NOTFOUND") + set(BLAS "MKL") endif() endif() diff --git a/config/darwin.cmake b/config/darwin.cmake index 5a7899e018e7..2311da9c2ce6 100644 --- a/config/darwin.cmake +++ b/config/darwin.cmake @@ -45,7 +45,6 @@ set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.") set(USE_OPENMP OFF CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") diff --git a/config/distribution/darwin_cpu.cmake b/config/distribution/darwin_cpu.cmake index ed295efd33d2..baff103f2863 100644 --- a/config/distribution/darwin_cpu.cmake +++ b/config/distribution/darwin_cpu.cmake @@ -24,7 +24,6 @@ set(USE_BLAS "apple" CACHE STRING "BLAS Vendor") set(USE_CUDA OFF CACHE BOOL "Build with CUDA support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP OFF CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/darwin_native.cmake b/config/distribution/darwin_native.cmake index c3bc23f4fcb3..c9d8fa1d7665 100644 --- a/config/distribution/darwin_native.cmake +++ b/config/distribution/darwin_native.cmake @@ -24,7 +24,6 @@ set(USE_BLAS "apple" CACHE STRING "BLAS Vendor") set(USE_CUDA OFF CACHE BOOL "Build with CUDA support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP OFF CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN OFF CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_cpu.cmake b/config/distribution/linux_cpu.cmake index 4579b42fce5c..9f0885d54501 100644 --- a/config/distribution/linux_cpu.cmake +++ b/config/distribution/linux_cpu.cmake @@ -19,10 +19,10 @@ set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA OFF CACHE BOOL "Build with CUDA support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_cu100.cmake b/config/distribution/linux_cu100.cmake index 284b2f628b9d..a328040b6c45 100644 --- a/config/distribution/linux_cu100.cmake +++ b/config/distribution/linux_cu100.cmake @@ -19,12 +19,12 @@ set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA ON CACHE BOOL "Build with CUDA support") set(USE_CUDNN ON CACHE BOOL "Build with CUDNN support") set(USE_NCCL ON CACHE BOOL "Build with NCCL support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_cu101.cmake b/config/distribution/linux_cu101.cmake index fe969e1f9da8..210e07e6354b 100644 --- a/config/distribution/linux_cu101.cmake +++ b/config/distribution/linux_cu101.cmake @@ -21,12 +21,12 @@ set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA ON CACHE BOOL "Build with CUDA support") set(USE_CUDNN ON CACHE BOOL "Build with CUDNN support") set(USE_NCCL ON CACHE BOOL "Build with NCCL support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_cu102.cmake b/config/distribution/linux_cu102.cmake index 00c76c14a02c..1bfedb590137 100644 --- a/config/distribution/linux_cu102.cmake +++ b/config/distribution/linux_cu102.cmake @@ -19,12 +19,12 @@ set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA ON CACHE BOOL "Build with CUDA support") set(USE_CUDNN ON CACHE BOOL "Build with CUDNN support") set(USE_NCCL ON CACHE BOOL "Build with NCCL support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_cu110.cmake b/config/distribution/linux_cu110.cmake index b4fdb17570a6..b3cd6a77b262 100644 --- a/config/distribution/linux_cu110.cmake +++ b/config/distribution/linux_cu110.cmake @@ -19,12 +19,12 @@ set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA ON CACHE BOOL "Build with CUDA support") set(USE_CUDNN ON CACHE BOOL "Build with CUDNN support") set(USE_NCCL ON CACHE BOOL "Build with NCCL support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_cu112.cmake b/config/distribution/linux_cu112.cmake index 43ce18ad15c3..8c1e74ad9349 100644 --- a/config/distribution/linux_cu112.cmake +++ b/config/distribution/linux_cu112.cmake @@ -19,12 +19,12 @@ set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA ON CACHE BOOL "Build with CUDA support") set(USE_CUDNN ON CACHE BOOL "Build with CUDNN support") set(USE_NCCL ON CACHE BOOL "Build with NCCL support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_cu92.cmake b/config/distribution/linux_cu92.cmake index bc4f6afebdbe..7af9ded168f9 100644 --- a/config/distribution/linux_cu92.cmake +++ b/config/distribution/linux_cu92.cmake @@ -19,12 +19,12 @@ set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA ON CACHE BOOL "Build with CUDA support") set(USE_CUDNN ON CACHE BOOL "Build with CUDNN support") set(USE_NCCL ON CACHE BOOL "Build with NCCL support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/distribution/linux_native.cmake b/config/distribution/linux_native.cmake index 09fb4956ae80..6d74b1213814 100644 --- a/config/distribution/linux_native.cmake +++ b/config/distribution/linux_native.cmake @@ -19,10 +19,10 @@ set(CMAKE_BUILD_TYPE "Distribution" CACHE STRING "Build type") set(CFLAGS "-mno-avx" CACHE STRING "CFLAGS") set(CXXFLAGS "-mno-avx" CACHE STRING "CXXFLAGS") +set(USE_BLAS "open" CACHE STRING "BLAS Vendor") set(USE_CUDA OFF CACHE BOOL "Build with CUDA support") set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE OFF CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN OFF CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") set(USE_TVM_OP OFF CACHE BOOL "Enable use of TVM operator build system.") diff --git a/config/linux.cmake b/config/linux.cmake index 55c1d0810d81..5d0e0a195841 100644 --- a/config/linux.cmake +++ b/config/linux.cmake @@ -57,14 +57,11 @@ set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture") #--------------------------------------------- # Common libraries #--------------------------------------------- -set(USE_BLAS "open" CACHE STRING "BLAS Vendor") - set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") diff --git a/config/linux_gpu.cmake b/config/linux_gpu.cmake index cedcbac9c5f9..56b00d0f1bac 100644 --- a/config/linux_gpu.cmake +++ b/config/linux_gpu.cmake @@ -61,14 +61,11 @@ set(MXNET_CUDA_ARCH "Auto" CACHE STRING "Target NVIDIA GPU achitecture") #--------------------------------------------- # Common libraries #--------------------------------------------- -set(USE_BLAS "open" CACHE STRING "BLAS Vendor") - set(USE_OPENCV ON CACHE BOOL "Build with OpenCV support") set(OPENCV_ROOT "" CACHE BOOL "OpenCV install path. Supports autodetection.") set(USE_OPENMP ON CACHE BOOL "Build with Openmp support") -set(USE_MKL_IF_AVAILABLE ON CACHE BOOL "Use Intel MKL if found") set(USE_MKLDNN ON CACHE BOOL "Build with MKL-DNN support") set(USE_LAPACK ON CACHE BOOL "Build with lapack support") diff --git a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md index ad10f368ca72..dfe61cbc82fb 100644 --- a/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md +++ b/docs/python_docs/python/tutorials/performance/backend/mkldnn/mkldnn_readme.md @@ -62,7 +62,7 @@ To achieve better performance, the Intel OpenMP and llvm OpenMP are recommended ``` # build with llvm OpenMP and Intel MKL/openblas mkdir build && cd build -cmake -DUSE_CUDA=OFF -DUSE_MKL_IF_AVAILABLE=ON -DUSE_MKLDNN=ON -DUSE_OPENMP=ON -DUSE_OPENCV=ON .. +cmake -DUSE_CUDA=OFF -DUSE_MKLDNN=ON -DUSE_OPENMP=ON -DUSE_OPENCV=ON .. make -j $(nproc) ``` diff --git a/docs/static_site/src/_includes/get_started/devices/raspberry_pi.md b/docs/static_site/src/_includes/get_started/devices/raspberry_pi.md index 9a3f481e7142..36263b4a0392 100644 --- a/docs/static_site/src/_includes/get_started/devices/raspberry_pi.md +++ b/docs/static_site/src/_includes/get_started/devices/raspberry_pi.md @@ -27,9 +27,9 @@ mkdir -p build && cd build cmake \ -DUSE_SSE=OFF \ -DUSE_CUDA=OFF \ + -DUSE_BLAS=Open \ -DUSE_OPENCV=ON \ -DUSE_OPENMP=ON \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -DUSE_SIGNAL_HANDLER=ON \ -DCMAKE_BUILD_TYPE=Release \ -GNinja .. @@ -116,12 +116,12 @@ mkdir build; cd build cmake -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ -DUSE_CUDA=OFF \ -DSUPPORT_F16C=OFF \ + -DUSE_BLAS=Open \ -DUSE_OPENCV=OFF \ -DUSE_OPENMP=ON \ -DUSE_LAPACK=OFF \ -DUSE_SIGNAL_HANDLER=ON \ -DCMAKE_BUILD_TYPE=Release \ - -DUSE_MKL_IF_AVAILABLE=OFF \ -G Ninja .. ninja cd .. diff --git a/tests/README.md b/tests/README.md index f26beec1c8fe..98b1cd5edc9c 100644 --- a/tests/README.md +++ b/tests/README.md @@ -27,7 +27,7 @@ ``` 1. Generate your Makefile and build along with the tests with cmake (specify appropraite flags) ``` - cmake -DUSE_CUDNN=ON -DUSE_CUDA=ON -DUSE_MKLDNN=ON -DBLAS=Open -DCMAKE_BUILD_TYPE=Debug .. && make + cmake -DUSE_CUDNN=ON -DUSE_CUDA=ON -DUSE_MKLDNN=ON -DUSE_BLAS=Open -DCMAKE_BUILD_TYPE=Debug .. && make ``` 1. Run tests ``` @@ -53,7 +53,7 @@ Ninja is a build tool (like make) that prioritizes building speed. If you will b ``` 1. When running cmake, add the `-GNinja` flag to specify cmake to generate a Ninja build file ``` - cmake -DUSE_CUDNN=ON -DUSE_CUDA=ON -DUSE_MKLDNN=ON -DBLAS=Open -GNinja -DCMAKE_BUILD_TYPE=Debug .. + cmake -DUSE_CUDNN=ON -DUSE_CUDA=ON -DUSE_MKLDNN=ON -DUSE_BLAS=Open -GNinja -DCMAKE_BUILD_TYPE=Debug .. ``` 1. Run the ninja build file with ```