From d29019ccebd59ffb8928f8b53bf0b7a0309b648d Mon Sep 17 00:00:00 2001 From: Lv Tao Date: Tue, 18 Dec 2018 12:33:09 +0800 Subject: [PATCH 01/15] update MKL-DNN to fix Dense layer issue(#13451) --- 3rdparty/mkldnn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index a7c5f53832ac..41470de17b0e 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit a7c5f53832acabade6e5086e72c960adedb3c38a +Subproject commit 41470de17b0e675f4e44c0ecd3c3837e0689874b From c86c10d9021b8942c210f09a7abc3a377df72b38 Mon Sep 17 00:00:00 2001 From: Lv Tao Date: Tue, 18 Dec 2018 15:07:22 +0800 Subject: [PATCH 02/15] fix format numbers --- src/operator/nn/mkldnn/mkldnn_base.cc | 2 ++ tests/cpp/operator/mkldnn_test.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/operator/nn/mkldnn/mkldnn_base.cc b/src/operator/nn/mkldnn/mkldnn_base.cc index 5db51817db9d..271297427099 100644 --- a/src/operator/nn/mkldnn/mkldnn_base.cc +++ b/src/operator/nn/mkldnn/mkldnn_base.cc @@ -311,6 +311,7 @@ mkldnn_memory_format_t GetDefaultFormat(const mkldnn::memory::desc &desc) { case mkldnn_oihw: case mkldnn_ihwo: case mkldnn_hwio: + case mkldnn_iohw: case mkldnn_oIhw8i: case mkldnn_oIhw16i: case mkldnn_OIhw8i8o: @@ -335,6 +336,7 @@ mkldnn_memory_format_t GetDefaultFormat(const mkldnn::memory::desc &desc) { } else if (desc.data.ndims == 5) { switch (desc.data.format) { case mkldnn_goihw: + case mkldnn_giohw: case mkldnn_hwigo: case mkldnn_gOIhw8i8o: case mkldnn_gOIhw16i16o: diff --git a/tests/cpp/operator/mkldnn_test.cc b/tests/cpp/operator/mkldnn_test.cc index 31e762f21720..5afc993f0bc5 100644 --- a/tests/cpp/operator/mkldnn_test.cc +++ b/tests/cpp/operator/mkldnn_test.cc @@ -100,7 +100,7 @@ static void VerifyDefMem(const mkldnn::memory &mem) { TEST(MKLDNN_UTIL_FUNC, MemFormat) { // Check whether the number of format is correct. - CHECK_EQ(mkldnn_format_last, 112); + CHECK_EQ(mkldnn_format_last, 114); CHECK_EQ(mkldnn_nchw, 7); CHECK_EQ(mkldnn_oihw, 16); } From e75a0ef6a7acea8a271ba0b33989ff9e227a825d Mon Sep 17 00:00:00 2001 From: Lv Tao Date: Thu, 20 Dec 2018 13:34:02 +0800 Subject: [PATCH 03/15] update mkldnn --- 3rdparty/mkldnn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index 41470de17b0e..deb25f13d797 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit 41470de17b0e675f4e44c0ecd3c3837e0689874b +Subproject commit deb25f13d797c7cb126b1bef21f2ba1b713fad94 From c2392a17af67a139b65dff2a4c1b66a5810983b0 Mon Sep 17 00:00:00 2001 From: taolv Date: Sat, 2 Mar 2019 11:32:32 +0800 Subject: [PATCH 04/15] update mkldnn to v0.18 release --- 3rdparty/mkldnn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index deb25f13d797..863ff6e7042c 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit deb25f13d797c7cb126b1bef21f2ba1b713fad94 +Subproject commit 863ff6e7042cec7d2e29897fe9f0872e0888b0fc From 0551ef3a1e251aa34ce9299d73d8f512130e523c Mon Sep 17 00:00:00 2001 From: taolv Date: Sat, 2 Mar 2019 12:02:03 +0800 Subject: [PATCH 05/15] update mklml version & fix mkldnn build --- ci/docker/install/ubuntu_mklml.sh | 2 +- cmake/DownloadMKLML.cmake | 14 +++++++++----- mkldnn.mk | 5 +++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ci/docker/install/ubuntu_mklml.sh b/ci/docker/install/ubuntu_mklml.sh index 862e2846403a..e50b6d273b8c 100755 --- a/ci/docker/install/ubuntu_mklml.sh +++ b/ci/docker/install/ubuntu_mklml.sh @@ -21,5 +21,5 @@ # the whole docker cache for the image set -ex -wget -q --no-check-certificate -O /tmp/mklml.tgz https://github.com/intel/mkl-dnn/releases/download/v0.17-rc/mklml_lnx_2019.0.1.20180928.tgz +wget -q --no-check-certificate -O /tmp/mklml.tgz https://github.com/intel/mkl-dnn/releases/download/v0.18/mklml_lnx_2019.0.3.20190220.tgz tar -zxf /tmp/mklml.tgz && cp -rf mklml_*/* /usr/local/ && rm -rf mklml_* diff --git a/cmake/DownloadMKLML.cmake b/cmake/DownloadMKLML.cmake index eabf861a4b2a..05112b9cc450 100644 --- a/cmake/DownloadMKLML.cmake +++ b/cmake/DownloadMKLML.cmake @@ -19,15 +19,19 @@ message(STATUS "Downloading MKLML...") -set(MKLDNN_RELEASE v0.17-rc) -set(MKLML_RELEASE_FILE_SUFFIX 2019.0.1.20180928) +set(MKLDNN_RELEASE v0.18) +set(MKLML_RELEASE_FILE_SUFFIX 2019.0.3.20190220) + +set(MKLML_LNX_MD5 76354b74325cd293aba593d7cbe36b3f) +set(MKLML_WIN_MD5 02286cb980f12af610c05e99dbd78755) +set(MKLML_MAC_MD5 3b28da686a25a4cf995ca4fc5e30e514) if(MSVC) set(MKL_NAME "mklml_win_${MKLML_RELEASE_FILE_SUFFIX}") file(DOWNLOAD "https://github.com/intel/mkl-dnn/releases/download/${MKLDNN_RELEASE}/${MKL_NAME}.zip" "${CMAKE_CURRENT_BINARY_DIR}/mklml/${MKL_NAME}.zip" - EXPECTED_MD5 "443e661bdfd32dbbc99b460b43afceee" SHOW_PROGRESS) + EXPECTED_MD5 "${MKLML_WIM_MD5}" SHOW_PROGRESS) file(DOWNLOAD "https://github.com/apache/incubator-mxnet/releases/download/utils/7z.exe" "${CMAKE_CURRENT_BINARY_DIR}/mklml/7z2.exe" EXPECTED_MD5 "E1CF766CF358F368EC97662D06EA5A4C" SHOW_PROGRESS) @@ -47,7 +51,7 @@ elseif(APPLE) file(DOWNLOAD "https://github.com/intel/mkl-dnn/releases/download/${MKLDNN_RELEASE}/${MKL_NAME}.tgz" "${CMAKE_CURRENT_BINARY_DIR}/mklml/${MKL_NAME}.tgz" - EXPECTED_MD5 "95f887af332205b1d15b392260003952" SHOW_PROGRESS) + EXPECTED_MD5 "${MKLML_MAC_MD5}" SHOW_PROGRESS) execute_process(COMMAND "tar" "-xzf" "${CMAKE_CURRENT_BINARY_DIR}/mklml/${MKL_NAME}.tgz" "-C" "${CMAKE_CURRENT_BINARY_DIR}/mklml/") @@ -61,7 +65,7 @@ elseif(UNIX) file(DOWNLOAD "https://github.com/intel/mkl-dnn/releases/download/${MKLDNN_RELEASE}/${MKL_NAME}.tgz" "${CMAKE_CURRENT_BINARY_DIR}/mklml/${MKL_NAME}.tgz" - EXPECTED_MD5 "a63abf155361322b9c03f8fc50f4f317" SHOW_PROGRESS) + EXPECTED_MD5 "${MKLML_LNX_MD5}" SHOW_PROGRESS) execute_process(COMMAND "tar" "-xzf" "${CMAKE_CURRENT_BINARY_DIR}/mklml/${MKL_NAME}.tgz" "-C" "${CMAKE_CURRENT_BINARY_DIR}/mklml/") diff --git a/mkldnn.mk b/mkldnn.mk index d79bbe7d2a0e..be45ce5df5d4 100644 --- a/mkldnn.mk +++ b/mkldnn.mk @@ -23,10 +23,12 @@ ifeq ($(UNAME_S), Darwin) OMP_LIBFILE = $(MKLDNNROOT)/lib/libiomp5.dylib MKLML_LIBFILE = $(MKLDNNROOT)/lib/libmklml.dylib MKLDNN_LIBFILE = $(MKLDNNROOT)/lib/libmkldnn.0.dylib + MKLDNN_LIB64FILE = $(MKLDNNROOT)/lib64/libmkldnn.0.dylib else OMP_LIBFILE = $(MKLDNNROOT)/lib/libiomp5.so MKLML_LIBFILE = $(MKLDNNROOT)/lib/libmklml_intel.so MKLDNN_LIBFILE = $(MKLDNNROOT)/lib/libmkldnn.so.0 + MKLDNN_LIB64FILE = $(MKLDNNROOT)/lib64/libmkldnn.so.0 endif endif @@ -40,6 +42,9 @@ $(MKLDNN_LIBFILE): cmake $(MKLDNN_SUBMODDIR) -DCMAKE_INSTALL_PREFIX=$(MKLDNNROOT) -B$(MKLDNN_BUILDDIR) -DARCH_OPT_FLAGS="-mtune=generic" -DWITH_TEST=OFF -DWITH_EXAMPLE=OFF $(MAKE) -C $(MKLDNN_BUILDDIR) VERBOSE=1 $(MAKE) -C $(MKLDNN_BUILDDIR) install + if [ -f "$(MKLDNN_LIB64FILE)" ]; then \ + mv $(MKLDNNROOT)/lib64/libmkldnn* $(MKLDNNROOT)/lib/; \ + fi mkdir -p $(MXNET_LIBDIR) cp $(OMP_LIBFILE) $(MXNET_LIBDIR) cp $(MKLML_LIBFILE) $(MXNET_LIBDIR) From 85b22f9495d2dc8cba999c933d1c83baa0df5cf0 Mon Sep 17 00:00:00 2001 From: taolv Date: Sat, 2 Mar 2019 13:01:57 +0800 Subject: [PATCH 06/15] fix typo --- cmake/DownloadMKLML.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/DownloadMKLML.cmake b/cmake/DownloadMKLML.cmake index 05112b9cc450..7b0e5ecf7c9c 100644 --- a/cmake/DownloadMKLML.cmake +++ b/cmake/DownloadMKLML.cmake @@ -31,7 +31,7 @@ if(MSVC) file(DOWNLOAD "https://github.com/intel/mkl-dnn/releases/download/${MKLDNN_RELEASE}/${MKL_NAME}.zip" "${CMAKE_CURRENT_BINARY_DIR}/mklml/${MKL_NAME}.zip" - EXPECTED_MD5 "${MKLML_WIM_MD5}" SHOW_PROGRESS) + EXPECTED_MD5 "${MKLML_WIN_MD5}" SHOW_PROGRESS) file(DOWNLOAD "https://github.com/apache/incubator-mxnet/releases/download/utils/7z.exe" "${CMAKE_CURRENT_BINARY_DIR}/mklml/7z2.exe" EXPECTED_MD5 "E1CF766CF358F368EC97662D06EA5A4C" SHOW_PROGRESS) From e97f335259e836b908b0deeff8a076d7b72b6593 Mon Sep 17 00:00:00 2001 From: taolv Date: Mon, 4 Mar 2019 23:06:41 +0800 Subject: [PATCH 07/15] fix cmake --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8ef524bb389..6299c0f0d48e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,6 +255,7 @@ if(USE_MKLDNN) add_subdirectory(3rdparty/mkldnn) include_directories(3rdparty/mkldnn/include) + include_directories(${PROJECT_BINARY_DIR}/3rdparty/mkldnn/include) add_definitions(-DUSE_MKL=1) add_definitions(-DCUB_MKL=1) add_definitions(-DMXNET_USE_MKLDNN=1) From a9b3886d8e713cab777162e6a3e390387cbdcb18 Mon Sep 17 00:00:00 2001 From: taolv Date: Fri, 8 Mar 2019 10:09:56 +0800 Subject: [PATCH 08/15] fix cmake --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6299c0f0d48e..7f3d326f1318 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,8 +256,8 @@ if(USE_MKLDNN) include_directories(3rdparty/mkldnn/include) include_directories(${PROJECT_BINARY_DIR}/3rdparty/mkldnn/include) - add_definitions(-DUSE_MKL=1) - add_definitions(-DCUB_MKL=1) + # add_definitions(-DUSE_MKL=1) + # add_definitions(-DCUB_MKL=1) add_definitions(-DMXNET_USE_MKLDNN=1) list(APPEND mxnet_LINKER_LIBS mkldnn) endif() From ac72fba391bf8f23ff00e09bbc6779b9d5410539 Mon Sep 17 00:00:00 2001 From: taolv Date: Mon, 11 Mar 2019 23:03:13 +0800 Subject: [PATCH 09/15] skip test_quantized_conv --- tests/python/quantization/test_quantization.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/python/quantization/test_quantization.py b/tests/python/quantization/test_quantization.py index d8c7f08d4ca5..2aec0cbbdc42 100644 --- a/tests/python/quantization/test_quantization.py +++ b/tests/python/quantization/test_quantization.py @@ -132,6 +132,7 @@ def check_requantize(shape, min_calib_range=None, max_calib_range=None): @with_seed() +@unittest.skip("skipped temporarily for validation") def test_quantized_conv(): def check_quantized_conv(data_shape, kernel, num_filter, pad, stride, no_bias, qdtype): if is_test_for_native_cpu(): From 38efc7e99b9d0d26626c657c5244d0ba9f583d1c Mon Sep 17 00:00:00 2001 From: taolv Date: Tue, 12 Mar 2019 13:34:36 +0800 Subject: [PATCH 10/15] fix quantized_conv and cmake --- .gitmodules | 2 +- 3rdparty/mkldnn | 2 +- tests/python/quantization/test_quantization.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 836d824a6f5a..277defe86bde 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,7 +18,7 @@ url = https://github.com/google/googletest.git [submodule "3rdparty/mkldnn"] path = 3rdparty/mkldnn - url = https://github.com/intel/mkl-dnn.git + url = https://github.com/TaoLv/mkl-dnn.git branch = master [submodule "3rdparty/cub"] path = 3rdparty/cub diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index 863ff6e7042c..bee23be598b8 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit 863ff6e7042cec7d2e29897fe9f0872e0888b0fc +Subproject commit bee23be598b8fd3405f59b4ddb47e1f791afdb6d diff --git a/tests/python/quantization/test_quantization.py b/tests/python/quantization/test_quantization.py index 1d8c101a8938..e4cc277d0ae3 100644 --- a/tests/python/quantization/test_quantization.py +++ b/tests/python/quantization/test_quantization.py @@ -132,7 +132,6 @@ def check_requantize(shape, min_calib_range=None, max_calib_range=None): @with_seed() -@unittest.skip("skipped temporarily for validation") def test_quantized_conv(): def check_quantized_conv(data_shape, kernel, num_filter, pad, stride, no_bias, qdtype): if is_test_for_native_cpu(): From ff9be44de65c64beb2f2cdf21d0c1bedc6a4578c Mon Sep 17 00:00:00 2001 From: taolv Date: Tue, 12 Mar 2019 13:42:02 +0800 Subject: [PATCH 11/15] Revert "fix cmake" This reverts commit a9b3886d8e713cab777162e6a3e390387cbdcb18. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f3d326f1318..6299c0f0d48e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,8 +256,8 @@ if(USE_MKLDNN) include_directories(3rdparty/mkldnn/include) include_directories(${PROJECT_BINARY_DIR}/3rdparty/mkldnn/include) - # add_definitions(-DUSE_MKL=1) - # add_definitions(-DCUB_MKL=1) + add_definitions(-DUSE_MKL=1) + add_definitions(-DCUB_MKL=1) add_definitions(-DMXNET_USE_MKLDNN=1) list(APPEND mxnet_LINKER_LIBS mkldnn) endif() From b0e0add0bed711441e2a052d63bf38ade2cc0e21 Mon Sep 17 00:00:00 2001 From: taolv Date: Wed, 13 Mar 2019 10:40:19 +0800 Subject: [PATCH 12/15] update mkldnn submodule --- .gitmodules | 2 +- 3rdparty/mkldnn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 277defe86bde..836d824a6f5a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,7 +18,7 @@ url = https://github.com/google/googletest.git [submodule "3rdparty/mkldnn"] path = 3rdparty/mkldnn - url = https://github.com/TaoLv/mkl-dnn.git + url = https://github.com/intel/mkl-dnn.git branch = master [submodule "3rdparty/cub"] path = 3rdparty/cub diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index bee23be598b8..245b331e5ef4 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit bee23be598b8fd3405f59b4ddb47e1f791afdb6d +Subproject commit 245b331e5ef4962f6bffdff2d207b185e362a58a From 93cb7b87cba225485e0cb66ed53e41a8152cad81 Mon Sep 17 00:00:00 2001 From: taolv Date: Sat, 16 Mar 2019 10:09:33 +0800 Subject: [PATCH 13/15] update mkldnn head to 0.18.1 patch release --- 3rdparty/mkldnn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/mkldnn b/3rdparty/mkldnn index 245b331e5ef4..7de7e5d02bf6 160000 --- a/3rdparty/mkldnn +++ b/3rdparty/mkldnn @@ -1 +1 @@ -Subproject commit 245b331e5ef4962f6bffdff2d207b185e362a58a +Subproject commit 7de7e5d02bf687f971e7668963649728356e0c20 From 7500ed008ab266bec107a3b963e74341766115d0 Mon Sep 17 00:00:00 2001 From: taolv Date: Sat, 16 Mar 2019 12:17:55 +0800 Subject: [PATCH 14/15] empty commit to retrigger ci From eb12d845dda877e91d45d513e6027877abc6bc2b Mon Sep 17 00:00:00 2001 From: taolv Date: Sat, 16 Mar 2019 16:53:59 +0800 Subject: [PATCH 15/15] retrigger ci