You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2019/11/13 19:09:13 UTC

[GitHub] [incubator-tvm] icemelon9 commented on a change in pull request #4323: [Contrib] Add MKL DNN option

icemelon9 commented on a change in pull request #4323: [Contrib] Add MKL DNN option
URL: https://github.com/apache/incubator-tvm/pull/4323#discussion_r345946543
 
 

 ##########
 File path: cmake/modules/contrib/BLAS.cmake
 ##########
 @@ -55,3 +55,11 @@ elseif(USE_BLAS STREQUAL "none")
 else()
   message(FATAL_ERROR "Invalid option: USE_BLAS=" ${USE_BLAS})
 endif()
+
+if(USE_MKL_DNN STREQUAL "ON")
+  find_library(BLAS_LIBRARY_MKLDNN dnnl)
+  list(APPEND TVM_RUNTIME_LINKER_LIBS ${BLAS_LIBRARY_MKLDNN})
+  list(APPEND RUNTIME_SRCS ${CBLAS_CONTRIB_SRC})
+  add_definitions(-DUSE_MKL_DNN=1)
+  message(STATUS "Use MKL DNN library " ${BLAS_LIBRARY_MKLDNN})
+endif()
 
 Review comment:
   Update the logic here. MKL DNN will only be used when USE_BLAS is not `none`. When both are set, MKL DNN will be only used in the sgemm op as the library has limited support for the BLAS operators. And I find that MKL DNN kernel achieves better performance than MKL in TVM.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services