Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Remove USE_MKL_IF_AVAILABLE flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekkuncer committed Mar 11, 2021
1 parent cca56ae commit ccb939b
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 69 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions ci/build_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': (
Expand All @@ -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')

Expand All @@ -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')

Expand All @@ -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')

Expand All @@ -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': (
Expand Down Expand Up @@ -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 \
Expand Down
69 changes: 35 additions & 34 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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 \
Expand All @@ -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" \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -412,7 +411,8 @@ build_ubuntu_cpu_clang10_werror() {
set -ex
cd /work/build
CXX=clang++-10 CC=clang-10 cmake \
-DUSE_CUDA=OFF \
-DUSE_BLAS=Open \
-DUSE_CUDA=OFF \
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
-GNinja /work/mxnet
ninja
Expand All @@ -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" \
Expand All @@ -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 \
Expand All @@ -456,8 +457,8 @@ 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_MKLDNN=OFF \
-DUSE_BLAS=Open \
-DUSE_MKLDNN=OFF \
-DUSE_CUDA=OFF \
-DUSE_OPENMP=ON \
-DUSE_DIST_KVSTORE=ON \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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" \
Expand All @@ -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" \
Expand All @@ -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 \
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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'


Expand Down
Loading

0 comments on commit ccb939b

Please sign in to comment.