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

Making MKL-DNN default on MXNet master #13681

Merged
merged 116 commits into from
Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
1e17a51
mkldnn is default makefile and explicitly turn off for buidls
azai91 Sep 18, 2018
abbc3ad
add endif
azai91 Sep 18, 2018
92b91f8
retrigger
azai91 Oct 30, 2018
335748b
Merge branch 'master' into feature/mklnn-default-make
azai91 Oct 30, 2018
ce5336c
retrigger
azai91 Oct 31, 2018
d12d2cd
Merge branch 'master' into feature/mklnn-default-make
azai91 Nov 9, 2018
b8a0203
build mkldnn as static lib
azai91 Nov 9, 2018
bc6c482
update makefile to statically build mkldnn
azai91 Nov 9, 2018
15a41fc
build static mkldnn
azai91 Nov 9, 2018
42b3353
fix static name
azai91 Nov 9, 2018
5af258a
fix static name
azai91 Nov 9, 2018
32ab9ce
update static for mac
azai91 Nov 9, 2018
e2422d6
rename mkldnn dep in ci
azai91 Nov 12, 2018
372f697
remove moving mkldnn dynamic lib
azai91 Nov 12, 2018
67e4dff
retrigger
azai91 Nov 13, 2018
150b324
remove commented code
azai91 Nov 13, 2018
890cf1d
merge master
azai91 Nov 13, 2018
89b11c6
retrigger
azai91 Nov 13, 2018
da8f62c
Merge branch 'master' into feature/mklnn-default-make
azai91 Nov 13, 2018
f29c254
Merge branch 'master' into feature/mkldnn-static
azai91 Nov 14, 2018
40fd0ac
remove mkldnn dnaymic for unitest
azai91 Nov 14, 2018
78c6093
Merge branch 'master' into feature/mklnn-default-make
azai91 Nov 21, 2018
cb095c6
retrigger
azai91 Nov 21, 2018
c08f6fa
retrigger
azai91 Nov 22, 2018
0302290
force static for mkldnn lib
azai91 Nov 22, 2018
bf78666
turn of mkldnn on arm builds
azai91 Nov 22, 2018
23fd7d9
Merge branch 'master' into feature/mkldnn-static
azai91 Nov 27, 2018
d103ec8
remove dynamic mkldnn bind
azai91 Nov 28, 2018
46da874
Merge branch 'master' into feature/mklnn-default-make
azai91 Nov 29, 2018
9b60119
Merge branch 'feature/mklnn-default-make' of github.com:azai91/incuba…
azai91 Nov 29, 2018
4b07dcf
update jenkins to use only mkldnn
azai91 Nov 29, 2018
6536cda
remove last flag
azai91 Nov 29, 2018
de4ff31
turn mkldnn by default on mac
azai91 Nov 29, 2018
0e5a362
move mkldnn files for GPU MKLDNN build
azai91 Nov 29, 2018
6eadfae
copy lib mxnet in gpu build
azai91 Nov 30, 2018
c9e8bd2
Merge branch 'master' into feature/mkldnn-static
azai91 Nov 30, 2018
0d0f407
only link windows
azai91 Nov 30, 2018
b300b88
add mkldnn.mk
azai91 Nov 30, 2018
b336ef0
try force linking
azai91 Nov 30, 2018
9827a5b
Merge branch 'master' into feature/mklnn-default-make-2
azai91 Nov 30, 2018
b9be823
retrigger
azai91 Nov 30, 2018
fdcee0d
retrigger
azai91 Nov 30, 2018
46ee0bd
remove mkldnn dynanmic check
azai91 Nov 30, 2018
7772cdd
use ifndef
azai91 Nov 30, 2018
45e8cd8
remove test mkldnn install
azai91 Nov 30, 2018
ed31e12
fix spacing
azai91 Nov 30, 2018
746596c
Merge branch 'master' into feature/mklnn-default-make-2
azai91 Nov 30, 2018
ab2ec74
Merge branch 'feature/mkldnn-static' into feature/mklnn-default-make-2
azai91 Nov 30, 2018
6a02949
fix index
azai91 Nov 30, 2018
9ba1181
Merge branch 'feature/mkldnn-static' into feature/mklnn-default-make-2
azai91 Nov 30, 2018
3cc21f3
remove cp of mkldnn since statically linked
azai91 Nov 30, 2018
0b894a0
add libmkldnn.a to list of files to pack
azai91 Nov 30, 2018
6b4db54
include mkl_ml
azai91 Nov 30, 2018
a754793
merge from master
azai91 Dec 3, 2018
4ad0b29
Merge branch 'master' into feature/mklnn-default-make-2
azai91 Dec 10, 2018
ccf9855
add mkldnn to pack
azai91 Dec 10, 2018
225b446
add libiomp to ci pack
azai91 Dec 11, 2018
54231a9
move static libs
azai91 Dec 11, 2018
2d2a0f9
fix typo
azai91 Dec 11, 2018
884d955
pack mkldnn
azai91 Dec 11, 2018
7dfa87e
retrigger
azai91 Dec 11, 2018
409acd0
add linux artifacts
azai91 Dec 11, 2018
8422287
move libmkldnn in gpu cmake build
azai91 Dec 11, 2018
346a602
move libmkldnn and libiomp5 on gpu workspace
azai91 Dec 11, 2018
20741c4
move linked files
azai91 Dec 11, 2018
4e6b2ca
fix typo
azai91 Dec 11, 2018
992a2a0
fix typo
azai91 Dec 11, 2018
45fd008
add artifacts for tensorrt
azai91 Dec 11, 2018
7934cf1
move mkldnn lib in scala build
azai91 Dec 11, 2018
b40e996
move mkldnn lib on cpu scala
azai91 Dec 11, 2018
74e86e6
create dir for binding
azai91 Dec 11, 2018
5a18a8f
rename libmkldnn in scala
azai91 Dec 11, 2018
c0bd964
move mklml dep in scala builds
azai91 Dec 11, 2018
2dc1683
move mkl to another linked folder
azai91 Dec 11, 2018
4eb65df
move libmkl to another dir
azai91 Dec 12, 2018
ec5421d
add libmklml
azai91 Dec 12, 2018
75dd532
move mkldnn
azai91 Dec 12, 2018
2af09a8
move mkldnn on centos
azai91 Dec 12, 2018
76d842f
specify new dynamic path
azai91 Dec 12, 2018
103c9d1
retrigger
azai91 Dec 13, 2018
edc3bd1
merge from master
azai91 Dec 13, 2018
d510436
remove mkldnn dynamic lib
azai91 Dec 13, 2018
16cca19
remove moving mkldnn artifact
azai91 Dec 13, 2018
ab75373
add ld path
azai91 Dec 14, 2018
63821d4
retrigger
azai91 Dec 14, 2018
13bf7ae
Revert "remove moving mkldnn artifact"
azai91 Dec 14, 2018
935b1dc
Revert "remove mkldnn dynamic lib"
azai91 Dec 14, 2018
96482f7
merge from master
azai91 Dec 14, 2018
59bae57
update makefile
azai91 Dec 14, 2018
6d583df
Revert RPATH change and trigger CI
anirudh2290 Dec 18, 2018
37701b0
Merge branch 'master' of https://github.com/dmlc/mxnet into feature/m…
anirudh2290 Dec 19, 2018
83c36d5
correcting use-mkldnn flags for two tests
Dec 19, 2018
c94129a
mkldnn default on linux for starters
Dec 19, 2018
0220572
reverting naming rules of pack_lib
Dec 19, 2018
2384a90
adding mkldnn=0 flags to centos non mkldnn builds
Dec 19, 2018
377db81
adding mkldnn=0 flags to ubuntu gpu non mkldnn builds
Dec 19, 2018
365838d
removing mkldnn binary operation for ubuntu gpu cmake non mkldnn build
Dec 19, 2018
dfaef51
removing mkldnn binary operation for centos non-mkldnn unittest
Dec 19, 2018
9f7e869
adding explicit USE_MKLDNN=0 flags for clang builds
Dec 19, 2018
c1a5d2c
adding explicit USE_MKLDNN=0 flags for cpu ubuntu builds
Dec 19, 2018
3ec81a1
removing mkldnn binaries from non mkldnn builds scala gpu
Dec 19, 2018
2a3d362
adding explicit flag mkldnn=0 for tensorrt gpu build
Dec 19, 2018
bd9e55b
adding explicit flag mkldnn=0 for ubuntu cmake asan
Dec 19, 2018
bd55a1c
adding centos cpu mkldnn tests to CI
Dec 20, 2018
c68ccd0
adding CentOS GPU MKLDNN build and unittest
Dec 20, 2018
8c82763
not keeping mkldnn default for mac os
Dec 20, 2018
670c3ae
setting mkldnn default for x86_64 only
Dec 21, 2018
130ec16
running docs with mkldnn=0 flag
Dec 21, 2018
b7330cc
removing CentOS CPU Scala MKLDNN test
Dec 21, 2018
fe4b20e
setting mkldnn default for x86_64 only
Dec 22, 2018
38b3d66
not making mkldn default on windows
Dec 22, 2018
b554519
removing Centos MKLDNN tests from CI
Dec 26, 2018
f770f8a
retrigger
azai91 Dec 29, 2018
8da6078
Merge branch 'master' into mkldnn-default
azai91 Dec 29, 2018
28ba12c
retrigger
azai91 Dec 29, 2018
10e40a8
retrigger
azai91 Dec 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ if(ENABLE_TESTCOVERAGE)
if(NOT GCOV_PATH)
message(FATAL_ERROR "gcov not found! Aborting...")
endif() # NOT GCOV_PATH

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} --coverage")
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ endif
# use customized config file
include $(config)

ifndef $(USE_MKLDNN)
mseth10 marked this conversation as resolved.
Show resolved Hide resolved
USE_MKLDNN = 1
endif

ifeq ($(USE_MKL2017), 1)
$(warning "USE_MKL2017 is deprecated. We will switch to USE_MKLDNN.")
USE_MKLDNN=1
Expand Down
34 changes: 27 additions & 7 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ build_centos7_cpu() {
USE_BLAS=openblas \
USE_DIST_KVSTORE=1 \
-j$(nproc)
cp lib/libmkldnn.so.0 lib/libmkldnn.so.0.tmp
mv lib/libmkldnn.so.0.tmp lib/libmkldnn.so.0
cp lib/libmklml_intel.so lib/libmklml_intel.so.tmp
mv lib/libmklml_intel.so.tmp lib/libmklml_intel.so
cp lib/libiomp5.so lib/libiomp5.so.tmp
mv lib/libiomp5.so.tmp lib/libiomp5.so
mseth10 marked this conversation as resolved.
Show resolved Hide resolved
}

build_amzn_linux_cpu() {
Expand Down Expand Up @@ -320,7 +326,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)
}
Expand All @@ -342,6 +347,12 @@ build_centos7_gpu() {
USE_DIST_KVSTORE=1 \
CUDA_ARCH="$CI_CUDA_COMPUTE_CAPABILITIES" \
-j$(nproc)
cp lib/libmkldnn.so.0 lib/libmkldnn.so.0.tmp
mv lib/libmkldnn.so.0.tmp lib/libmkldnn.so.0
cp lib/libmklml_intel.so lib/libmklml_intel.so.tmp
mv lib/libmklml_intel.so.tmp lib/libmklml_intel.so
cp lib/libiomp5.so lib/libiomp5.so.tmp
mv lib/libiomp5.so.tmp lib/libiomp5.so
mseth10 marked this conversation as resolved.
Show resolved Hide resolved
}

build_ubuntu_cpu() {
Expand Down Expand Up @@ -497,7 +508,6 @@ build_ubuntu_cpu_clang39_mkldnn() {
ENABLE_TESTCOVERAGE=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKLDNN=1 \
USE_OPENMP=0 \
-j$(nproc)
}
Expand All @@ -514,7 +524,6 @@ build_ubuntu_cpu_clang60_mkldnn() {
ENABLE_TESTCOVERAGE=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKLDNN=1 \
USE_OPENMP=1 \
-j$(nproc)
}
Expand All @@ -529,7 +538,6 @@ build_ubuntu_cpu_mkldnn() {
ENABLE_TESTCOVERAGE=1 \
USE_CPP_PACKAGE=1 \
USE_BLAS=openblas \
USE_MKLDNN=1 \
-j$(nproc)
}

Expand Down Expand Up @@ -622,7 +630,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 \
Expand All @@ -639,7 +646,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 \
Expand All @@ -662,6 +668,10 @@ build_ubuntu_gpu_cuda91_cudnn7() {
USE_DIST_KVSTORE=1 \
CUDA_ARCH="$CI_CUDA_COMPUTE_CAPABILITIES" \
-j$(nproc)
cp lib/libmkldnn.so.0 lib/libmkldnn.so.0.tmp
mv lib/libmkldnn.so.0.tmp lib/libmkldnn.so.0
cp lib/libiomp5.so lib/libiomp5.so.tmp
mv lib/libiomp5.so.tmp lib/libiomp5.so
}

build_ubuntu_amalgamation() {
Expand Down Expand Up @@ -697,7 +707,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 \
Expand Down Expand Up @@ -731,6 +740,9 @@ build_ubuntu_gpu_cmake() {
/work/mxnet

ninja -v
# libmkldnn.so.0 is a link file. We need an actual binary file named libmkldnn.so.0.
cp 3rdparty/mkldnn/src/libmkldnn.so.0 3rdparty/mkldnn/src/libmkldnn.so.0.tmp
mv 3rdparty/mkldnn/src/libmkldnn.so.0.tmp 3rdparty/mkldnn/src/libmkldnn.so.0
}

build_ubuntu_blc() {
Expand Down Expand Up @@ -842,6 +854,9 @@ unittest_ubuntu_cpu_scala() {

unittest_centos7_cpu_scala() {
set -ex
mkdir -p /work/mxnet/3rdparty/mkldnn/build/install/lib/
cp lib/libmkldnn.so.0 /work/mxnet/3rdparty/mkldnn/build/install/lib/libmkldnn.so
cp lib/libmklml_intel.so /work/mxnet/3rdparty/mkldnn/build/install/lib/libmklml_intel.so
cd /work/mxnet
make scalapkg USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
make scalaunittest USE_BLAS=openblas USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
Expand Down Expand Up @@ -911,6 +926,7 @@ unittest_ubuntu_cpu_julia06() {

# FIXME
export LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libjemalloc.so'
export LD_LIBRARY_PATH=/work/mxnet/lib:$LD_LIBRARY_PATH

# use the prebuilt binary from $MXNET_HOME/lib
julia -e 'Pkg.build("MXNet")'
Expand Down Expand Up @@ -994,6 +1010,9 @@ integrationtest_ubuntu_cpu_dist_kvstore() {

integrationtest_ubuntu_gpu_scala() {
set -ex
mkdir -p /work/mxnet/3rdparty/mkldnn/build/install/lib/
cp lib/libmkldnn.so.0 /work/mxnet/3rdparty/mkldnn/build/install/lib/libmkldnn.so
cp lib/libmklml_intel.so /work/mxnet/3rdparty/mkldnn/build/install/lib/libmklml_intel.so
make scalapkg USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 USE_DIST_KVSTORE=1 SCALA_ON_GPU=1 ENABLE_TESTCOVERAGE=1
make scalaintegrationtest USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_CUDA_PATH=/usr/local/cuda USE_CUDNN=1 SCALA_TEST_ON_GPU=1 USE_DIST_KVSTORE=1 ENABLE_TESTCOVERAGE=1
}
Expand Down Expand Up @@ -1237,6 +1256,7 @@ deploy_jl_docs() {

# FIXME
export LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libjemalloc.so'
export LD_LIBRARY_PATH=/work/mxnet/lib:$LD_LIBRARY_PATH

# use the prebuilt binary from $MXNET_HOME/lib
julia -e 'Pkg.build("MXNet")'
Expand Down
12 changes: 6 additions & 6 deletions ci/jenkins/Jenkins_steps.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@
utils = load('ci/Jenkinsfile_utils.groovy')

// mxnet libraries
mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a'
mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a, lib/libmklml_intel.so, lib/libmkldnn.so.0, lib/libiomp5.so'

// Python wheels
mx_pip = 'build/*.whl'

// for scala build, need to pass extra libs when run with dist_kvstore
mx_dist_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a'
mx_dist_lib = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a, lib/libmklml_intel.so, lib/libmkldnn.so.0, lib/libiomp5.so'
// mxnet cmake libraries, in cmake builds we do not produce a libnvvm static library by default.
mx_cmake_lib = 'build/libmxnet.so, build/libmxnet.a, build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, build/3rdparty/openmp/runtime/src/libomp.so'
mx_cmake_lib = 'build/libmxnet.so, build/libmxnet.a, build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, build/3rdparty/openmp/runtime/src/libomp.so, build/3rdparty/mkldnn/src/libmkldnn.so.0'
mseth10 marked this conversation as resolved.
Show resolved Hide resolved
// mxnet cmake libraries, in cmake builds we do not produce a libnvvm static library by default.
mx_cmake_lib_debug = 'build/libmxnet.so, build/libmxnet.a, build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests'
mx_cmake_mkldnn_lib = 'build/libmxnet.so, build/libmxnet.a, build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, build/3rdparty/openmp/runtime/src/libomp.so, build/3rdparty/mkldnn/src/libmkldnn.so.0'
mx_mkldnn_lib = 'lib/libmxnet.so, lib/libmxnet.a, lib/libiomp5.so, lib/libmkldnn.so.0, lib/libmklml_intel.so, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a'
mx_tensorrt_lib = 'lib/libmxnet.so, lib/libnvonnxparser_runtime.so.0, lib/libnvonnxparser.so.0, lib/libonnx_proto.so, lib/libonnx.so'
mx_lib_cpp_examples = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a, build/cpp-package/example/*'
mx_lib_cpp_examples_cpu = 'build/libmxnet.so, build/cpp-package/example/*'
mx_tensorrt_lib = 'lib/libmxnet.so, lib/libnvonnxparser_runtime.so.0, lib/libnvonnxparser.so.0, lib/libonnx_proto.so, lib/libonnx.so, lib/libmklml_intel.so, lib/libmkldnn.so.0, lib/libiomp5.so'
mx_lib_cpp_examples = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a, build/cpp-package/example/*, lib/libmklml_intel.so, lib/libmkldnn.so.0, lib/libiomp5.so'
mx_lib_cpp_examples_cpu = 'build/libmxnet.so, build/cpp-package/example/*, lib/libmklml_intel.so, lib/libmkldnn.so.0, lib/libiomp5.so'

// Python unittest for CPU
// Python 2
Expand Down