From 1ca7d65e36538f3e83ed6495bba69729f24e0287 Mon Sep 17 00:00:00 2001 From: apeforest Date: Tue, 11 Jun 2019 08:31:16 +0000 Subject: [PATCH 1/7] fix horovod build when mxnet is built from source --- include/mkldnn | 1 - include/mkldnn/mkldnn.h | 1 + include/mkldnn/mkldnn_version.h | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) delete mode 120000 include/mkldnn create mode 120000 include/mkldnn/mkldnn.h create mode 120000 include/mkldnn/mkldnn_version.h diff --git a/include/mkldnn b/include/mkldnn deleted file mode 120000 index ed48bf601bd6..000000000000 --- a/include/mkldnn +++ /dev/null @@ -1 +0,0 @@ -../3rdparty/mkldnn/include \ No newline at end of file diff --git a/include/mkldnn/mkldnn.h b/include/mkldnn/mkldnn.h new file mode 120000 index 000000000000..873c515d113a --- /dev/null +++ b/include/mkldnn/mkldnn.h @@ -0,0 +1 @@ +../../3rdparty/mkldnn/include/mkldnn.h \ No newline at end of file diff --git a/include/mkldnn/mkldnn_version.h b/include/mkldnn/mkldnn_version.h new file mode 120000 index 000000000000..c40ba6025620 --- /dev/null +++ b/include/mkldnn/mkldnn_version.h @@ -0,0 +1 @@ +../../3rdparty/mkldnn/build/include/mkldnn_version.h \ No newline at end of file From 96919abe70b706152a6775e6df82910478b07ee6 Mon Sep 17 00:00:00 2001 From: apeforest Date: Fri, 14 Jun 2019 00:08:35 +0000 Subject: [PATCH 2/7] copy header file in mkldnn --- Makefile | 5 +++++ include/mkldnn/mkldnn.h | 1 - include/mkldnn/mkldnn_version.h | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) delete mode 120000 include/mkldnn/mkldnn.h delete mode 120000 include/mkldnn/mkldnn_version.h diff --git a/Makefile b/Makefile index 6fc3c3aca5f6..8ee08a4792d4 100644 --- a/Makefile +++ b/Makefile @@ -549,6 +549,11 @@ lib/libmxnet.so: $(ALLX_DEP) @mkdir -p $(@D) $(CXX) $(CFLAGS) -shared -o $@ $(filter-out %libnnvm.a, $(filter %.o %.a, $^)) $(LDFLAGS) \ -Wl,${WHOLE_ARCH} $(filter %libnnvm.a, $^) -Wl,${NO_WHOLE_ARCH} + if [ -e "lib/libmkldnn.so.0" ]; then \ + mkdir -p $(ROOTDIR)/include/mxnet/mkldnn; \ + cp -rf 3rdparty/mkldnn/build/install/include/* $(ROOTDIR)/include/mxnet/mkldnn/; \ + fi + ifeq ($(USE_MKLDNN), 1) ifeq ($(UNAME_S), Darwin) install_name_tool -change '@rpath/libmklml.dylib' '@loader_path/libmklml.dylib' $@ diff --git a/include/mkldnn/mkldnn.h b/include/mkldnn/mkldnn.h deleted file mode 120000 index 873c515d113a..000000000000 --- a/include/mkldnn/mkldnn.h +++ /dev/null @@ -1 +0,0 @@ -../../3rdparty/mkldnn/include/mkldnn.h \ No newline at end of file diff --git a/include/mkldnn/mkldnn_version.h b/include/mkldnn/mkldnn_version.h deleted file mode 120000 index c40ba6025620..000000000000 --- a/include/mkldnn/mkldnn_version.h +++ /dev/null @@ -1 +0,0 @@ -../../3rdparty/mkldnn/build/include/mkldnn_version.h \ No newline at end of file From 58cd27138365524aa1b0ddaf9d6b1ce3b4e6b963 Mon Sep 17 00:00:00 2001 From: apeforest Date: Fri, 14 Jun 2019 17:57:08 +0000 Subject: [PATCH 3/7] copy mkldnn_version header file to include --- Makefile | 4 ---- include/mkldnn | 1 + mkldnn.mk | 3 ++- 3 files changed, 3 insertions(+), 5 deletions(-) create mode 120000 include/mkldnn diff --git a/Makefile b/Makefile index 8ee08a4792d4..6bdb10ec9445 100644 --- a/Makefile +++ b/Makefile @@ -549,10 +549,6 @@ lib/libmxnet.so: $(ALLX_DEP) @mkdir -p $(@D) $(CXX) $(CFLAGS) -shared -o $@ $(filter-out %libnnvm.a, $(filter %.o %.a, $^)) $(LDFLAGS) \ -Wl,${WHOLE_ARCH} $(filter %libnnvm.a, $^) -Wl,${NO_WHOLE_ARCH} - if [ -e "lib/libmkldnn.so.0" ]; then \ - mkdir -p $(ROOTDIR)/include/mxnet/mkldnn; \ - cp -rf 3rdparty/mkldnn/build/install/include/* $(ROOTDIR)/include/mxnet/mkldnn/; \ - fi ifeq ($(USE_MKLDNN), 1) ifeq ($(UNAME_S), Darwin) diff --git a/include/mkldnn b/include/mkldnn new file mode 120000 index 000000000000..ed48bf601bd6 --- /dev/null +++ b/include/mkldnn @@ -0,0 +1 @@ +../3rdparty/mkldnn/include \ No newline at end of file diff --git a/mkldnn.mk b/mkldnn.mk index be45ce5df5d4..66ad15d930bb 100644 --- a/mkldnn.mk +++ b/mkldnn.mk @@ -18,6 +18,7 @@ ifeq ($(USE_MKLDNN), 1) MKLDNN_SUBMODDIR = $(ROOTDIR)/3rdparty/mkldnn MKLDNN_BUILDDIR = $(MKLDNN_SUBMODDIR)/build + MKLDNN_INCLDIR = $(MKLDNN_SUBMODDIR)/include MXNET_LIBDIR = $(ROOTDIR)/lib ifeq ($(UNAME_S), Darwin) OMP_LIBFILE = $(MKLDNNROOT)/lib/libiomp5.dylib @@ -49,7 +50,7 @@ $(MKLDNN_LIBFILE): cp $(OMP_LIBFILE) $(MXNET_LIBDIR) cp $(MKLML_LIBFILE) $(MXNET_LIBDIR) cp $(MKLDNN_LIBFILE) $(MXNET_LIBDIR) - + cp $(MKLDNN_BUILDDIR)/include/mkldnn_version.h $(MKLDNN_INCLDIR)/. mkldnn_clean: $(RM) -r 3rdparty/mkldnn/build $(RM) -r $(MKLDNNROOT) From d805ad76126b91f29002e99151a0383af40bedbd Mon Sep 17 00:00:00 2001 From: apeforest Date: Fri, 14 Jun 2019 18:01:14 +0000 Subject: [PATCH 4/7] remove unnecessary line --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 6bdb10ec9445..6fc3c3aca5f6 100644 --- a/Makefile +++ b/Makefile @@ -549,7 +549,6 @@ lib/libmxnet.so: $(ALLX_DEP) @mkdir -p $(@D) $(CXX) $(CFLAGS) -shared -o $@ $(filter-out %libnnvm.a, $(filter %.o %.a, $^)) $(LDFLAGS) \ -Wl,${WHOLE_ARCH} $(filter %libnnvm.a, $^) -Wl,${NO_WHOLE_ARCH} - ifeq ($(USE_MKLDNN), 1) ifeq ($(UNAME_S), Darwin) install_name_tool -change '@rpath/libmklml.dylib' '@loader_path/libmklml.dylib' $@ From f19d05db141995038f81dd0199ba54817036f794 Mon Sep 17 00:00:00 2001 From: apeforest Date: Fri, 14 Jun 2019 18:42:53 +0000 Subject: [PATCH 5/7] fix the untracked file --- .gitignore | 5 ++++- include/mkldnn | 1 - include/mkldnn/mkldnn.h | 1 + include/mkldnn/mkldnn_types.h | 1 + mkldnn.mk | 4 ++-- 5 files changed, 8 insertions(+), 4 deletions(-) delete mode 120000 include/mkldnn create mode 120000 include/mkldnn/mkldnn.h create mode 120000 include/mkldnn/mkldnn_types.h diff --git a/.gitignore b/.gitignore index 59ca0d434e57..94cc9baccad9 100644 --- a/.gitignore +++ b/.gitignore @@ -161,4 +161,7 @@ tests/mxnet_unit_tests coverage.xml # Local CMake build config -cmake_options.yml \ No newline at end of file +cmake_options.yml + +# header file generated at compile time +include/mkldnn/mkldnn_version.h diff --git a/include/mkldnn b/include/mkldnn deleted file mode 120000 index ed48bf601bd6..000000000000 --- a/include/mkldnn +++ /dev/null @@ -1 +0,0 @@ -../3rdparty/mkldnn/include \ No newline at end of file diff --git a/include/mkldnn/mkldnn.h b/include/mkldnn/mkldnn.h new file mode 120000 index 000000000000..873c515d113a --- /dev/null +++ b/include/mkldnn/mkldnn.h @@ -0,0 +1 @@ +../../3rdparty/mkldnn/include/mkldnn.h \ No newline at end of file diff --git a/include/mkldnn/mkldnn_types.h b/include/mkldnn/mkldnn_types.h new file mode 120000 index 000000000000..548b884e2edb --- /dev/null +++ b/include/mkldnn/mkldnn_types.h @@ -0,0 +1 @@ +../../3rdparty/mkldnn/include/mkldnn_types.h \ No newline at end of file diff --git a/mkldnn.mk b/mkldnn.mk index 66ad15d930bb..802f3dc747c2 100644 --- a/mkldnn.mk +++ b/mkldnn.mk @@ -18,8 +18,8 @@ ifeq ($(USE_MKLDNN), 1) MKLDNN_SUBMODDIR = $(ROOTDIR)/3rdparty/mkldnn MKLDNN_BUILDDIR = $(MKLDNN_SUBMODDIR)/build - MKLDNN_INCLDIR = $(MKLDNN_SUBMODDIR)/include MXNET_LIBDIR = $(ROOTDIR)/lib + MXNET_INCLDIR = $(ROOTDIR)/include ifeq ($(UNAME_S), Darwin) OMP_LIBFILE = $(MKLDNNROOT)/lib/libiomp5.dylib MKLML_LIBFILE = $(MKLDNNROOT)/lib/libmklml.dylib @@ -50,7 +50,7 @@ $(MKLDNN_LIBFILE): cp $(OMP_LIBFILE) $(MXNET_LIBDIR) cp $(MKLML_LIBFILE) $(MXNET_LIBDIR) cp $(MKLDNN_LIBFILE) $(MXNET_LIBDIR) - cp $(MKLDNN_BUILDDIR)/include/mkldnn_version.h $(MKLDNN_INCLDIR)/. + cp $(MKLDNN_BUILDDIR)/include/mkldnn_version.h $(MXNET_INCLDIR)/mkldnn/. mkldnn_clean: $(RM) -r 3rdparty/mkldnn/build $(RM) -r $(MKLDNNROOT) From a8a12ecb93567325e37f6dddf95a1e9928530367 Mon Sep 17 00:00:00 2001 From: apeforest Date: Fri, 14 Jun 2019 18:59:40 +0000 Subject: [PATCH 6/7] whitelist mkldnn headerfile --- tools/license_header.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/license_header.py b/tools/license_header.py index b9acbf167c17..c8add72288e7 100755 --- a/tools/license_header.py +++ b/tools/license_header.py @@ -68,6 +68,9 @@ # Git submodules under different licenses '3rdparty', + # 3rdparty headerfiles under different licenses + 'include/mkldnn', + # Code shared with project by author - see file for details 'src/operator/special_functions-inl.h', From cfd1d9c8574650ecf3c489e39af287ccd4633d88 Mon Sep 17 00:00:00 2001 From: apeforest Date: Fri, 14 Jun 2019 19:10:21 +0000 Subject: [PATCH 7/7] exlude lint path --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6fc3c3aca5f6..741c5f0190f2 100644 --- a/Makefile +++ b/Makefile @@ -594,7 +594,7 @@ lint: cpplint rcpplint jnilint pylint cpplint: 3rdparty/dmlc-core/scripts/lint.py mxnet cpp include src plugin cpp-package tests \ - --exclude_path src/operator/contrib/ctc_include + --exclude_path src/operator/contrib/ctc_include include/mkldnn pylint: python3 -m pylint --rcfile=$(ROOTDIR)/ci/other/pylintrc --ignore-patterns=".*\.so$$,.*\.dll$$,.*\.dylib$$" python/mxnet tools/caffe_converter/*.py