Revert D13383102: [pytorch][PR] Upgrade MKL-DNN to version 0.17
authorEdward Yang <ezyang@fb.com>
Tue, 18 Dec 2018 15:35:43 +0000 (07:35 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 18 Dec 2018 15:39:20 +0000 (07:39 -0800)
Differential Revision:
D13383102

Original commit changeset: c434f0e0ddff

fbshipit-source-id: 690f46ca0710954fa591a5ea77535e9759db4de5

.jenkins/caffe2/build.sh
caffe2/ideep/operators/utility_ops.cc
cmake/Modules/FindMKLDNN.cmake
third_party/ideep

index 4beb22d..8c42ee3 100755 (executable)
@@ -132,7 +132,6 @@ CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX}")
 
 if [[ $BUILD_ENVIRONMENT == *mkl* ]]; then
   CMAKE_ARGS+=("-DBLAS=MKL")
-  CMAKE_ARGS+=("-DUSE_MKLDNN=ON")
 fi
 
 if [[ $BUILD_ENVIRONMENT == py2-cuda9.0-cudnn7-ubuntu16.04 ]]; then
index 05df9b7..f312c6f 100644 (file)
@@ -1,4 +1,6 @@
-#include <caffe2/ideep/ideep_utils.h>
+#include "caffe2/operators/utility_ops.h"
+#include "caffe2/core/operator.h"
+#include "caffe2/ideep/ideep_utils.h"
 
 namespace caffe2 {
 
index 97d9683..3a19913 100644 (file)
@@ -41,28 +41,27 @@ ENDIF(NOT IDEEP_INCLUDE_DIR OR NOT MKLDNN_INCLUDE_DIR)
 LIST(APPEND MKLDNN_INCLUDE_DIR ${IDEEP_INCLUDE_DIR})
 
 IF(MKL_FOUND)
-  # Configure MKL-DNN
-  ADD_DEFINITIONS(-DUSE_MKL)
-  SET(MKLDNN_USE_MKL "FULL")
-  INCLUDE_DIRECTORIES(AFTER ${MKL_INCLUDE_DIR})
-  LIST(APPEND mkldnn_LINKER_LIBS ${MKL_LIBRARIES})
-
   LIST(APPEND MKLDNN_LIBRARIES ${MKL_LIBRARIES})
   LIST(APPEND MKLDNN_INCLUDE_DIR ${MKL_INCLUDE_DIR})
-
-  # The OMP-related variables of MKL-DNN have to be overrode here
-  # if MKL is used. Then, the OMP version can be defined by MKL.
+  # The OMP-related variables of MKL-DNN have to be overwritten here,
+  # if MKL is used, and the OMP version is defined by MKL.
   # MKL_LIBRARIES_xxxx_LIBRARY is defined by MKL.
-  IF (EXISTS "${MKL_LIBRARIES_gomp_LIBRARY}")
-    SET(MKLIOMP5LIB ${MKL_LIBRARIES_gomp_LIBRARY} CACHE STRING "Override MKL-DNN omp dependency" FORCE)
-  ELSEIF(EXISTS "${MKL_LIBRARIES_iomp5_LIBRARY}")
-    SET(MKLIOMP5LIB ${MKL_LIBRARIES_iomp5_LIBRARY} CACHE STRING "Override MKL-DNN omp dependency" FORCE)
-  ELSEIF(EXISTS "${MKL_LIBRARIES_libiomp5md_LIBRARY}")
-    SET(MKLIOMP5DLL ${MKL_LIBRARIES_libiomp5md_LIBRARY} CACHE STRING "Override MKL-DNN omp dependency" FORCE)
-  ELSE(EXISTS "${MKL_LIBRARIES_gomp_LIBRARY}")
-    SET(MKLIOMP5LIB "" CACHE STRING "Override MKL-DNN omp dependency" FORCE)
-    SET(MKLIOMP5DLL "" CACHE STRING "Override MKL-DNN omp dependency" FORCE)
-  ENDIF(EXISTS "${MKL_LIBRARIES_gomp_LIBRARY}")
+  # INTEL_MKL_DIR gives the MKL root path.
+  IF (INTEL_MKL_DIR)
+    SET(MKLROOT ${INTEL_MKL_DIR})
+    IF(WIN32)
+      SET(MKLIOMP5DLL ${MKL_LIBRARIES_libiomp5md_LIBRARY} CACHE STRING "Overwrite MKL-DNN omp dependency" FORCE)
+    ELSE(WIN32)
+      IF (MKL_LIBRARIES_gomp_LIBRARY)
+        SET(MKLOMPLIB ${MKL_LIBRARIES_gomp_LIBRARY})
+      ELSE(MKL_LIBRARIES_gomp_LIBRARY)
+        SET(MKLOMPLIB ${MKL_LIBRARIES_iomp5_LIBRARY})
+      ENDIF(MKL_LIBRARIES_gomp_LIBRARY)
+      SET(MKLIOMP5LIB ${MKLOMPLIB} CACHE STRING "Overwrite MKL-DNN omp dependency" FORCE)
+    ENDIF(WIN32)
+  ELSE(INTEL_MKL_DIR)
+    MESSAGE(STATUS "Warning: MKL is found, but INTEL_MKL_DIR is not set!")
+  ENDIF(INTEL_MKL_DIR)
 
 ELSE(MKL_FOUND)
   # If we cannot find MKL, we will use the Intel MKL Small library
@@ -118,7 +117,6 @@ IF(MKLDNN_FOUND)
     ADD_COMPILE_OPTIONS(-Wno-strict-overflow)
     ADD_COMPILE_OPTIONS(-Wno-error=strict-overflow)
   ENDIF(NOT APPLE AND CMAKE_COMPILER_IS_GNUCC)
-  SET(MKLDNN_THREADING "OMP:COMP")
   SET(WITH_TEST FALSE CACHE BOOL "build with mkl-dnn test" FORCE)
   SET(WITH_EXAMPLE FALSE CACHE BOOL "build with mkl-dnn examples" FORCE)
   ADD_SUBDIRECTORY(${MKLDNN_ROOT})
index d06f361..dedff8f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit d06f361c530dda79f49192953b2e896861e84602
+Subproject commit dedff8fb8193fe3a1ea893d4bc852f8ea395b6b3