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

Commit

Permalink
Upgrade MKL-DNN dependency to v1.1 (#16823)
Browse files Browse the repository at this point in the history
* upgrade to v1.1 and handle renaming

* softlink for mkldnn_version.h; make clean

* libmkldnn.a -> libdnnl.a
  • Loading branch information
TaoLv authored and pengzhao-intel committed Nov 25, 2019
1 parent 436967b commit ca76bf1
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,5 @@ coverage.xml
cmake_options.yml

# header file generated at compile time
include/mkldnn/mkldnn_version.h
include/mkldnn/dnnl_version.h
include/mkldnn/dnnl_config.h
2 changes: 1 addition & 1 deletion 3rdparty/mkldnn
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ if(USE_MKLDNN)
include_directories(3rdparty/mkldnn/include)
include_directories(${PROJECT_BINARY_DIR}/3rdparty/mkldnn/include)
add_definitions(-DMXNET_USE_MKLDNN=1)
list(APPEND mxnet_LINKER_LIBS mkldnn)
list(APPEND mxnet_LINKER_LIBS dnnl)
endif()

# Allow Cuda compiles outside of src tree to find things in 'src' and 'include'
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ ifeq ($(USE_MKLDNN), 1)
CFLAGS += -DMXNET_USE_MKLDNN=1
CFLAGS += -I$(ROOTDIR)/src/operator/nn/mkldnn/
CFLAGS += -I$(MKLDNNROOT)/include
LIB_DEP += $(MKLDNNROOT)/lib/libmkldnn.a
LIB_DEP += $(MKLDNNROOT)/lib/libdnnl.a
endif

# setup opencv
Expand Down
2 changes: 1 addition & 1 deletion cd/mxnet_lib/static/Jenkins_pipeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ licenses = 'licenses/*'

// libmxnet dependencies
mx_deps = 'lib/libgfortran.so.3, lib/libquadmath.so.0'
mx_mkldnn_deps = 'lib/libgfortran.so.3, lib/libquadmath.so.0, 3rdparty/mkldnn/build/install/include/mkldnn_version.h'
mx_mkldnn_deps = 'lib/libgfortran.so.3, lib/libquadmath.so.0, 3rdparty/mkldnn/build/install/include/dnnl_version.h, 3rdparty/mkldnn/build/install/include/dnnl_config.h'

// library type
// either static or dynamic - depending on how it links to its dependencies
Expand Down
6 changes: 4 additions & 2 deletions cd/python/pypi/pypi_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ export mxnet_variant=${1:?"Please specify the mxnet variant"}
# mxnet-build/3rdparty/mkldnn/build/install/include
# The artifact repository stores this file in the dependencies
# and CD unpacks it to a directory called cd_misc
if [ -f "cd_misc/mkldnn_version.h" ]; then
# Nov. 2019 Update: With v1.1, MKL-DNN is renaming to DNNL. Hence changing the prefix of file name.
if [ -f "cd_misc/dnnl_version.h" ]; then
mkdir -p 3rdparty/mkldnn/build/install/include
cp cd_misc/mkldnn_version.h 3rdparty/mkldnn/build/install/include/.
cp cd_misc/dnnl_version.h 3rdparty/mkldnn/build/install/include/.
cp cd_misc/dnnl_config.h 3rdparty/mkldnn/build/install/include/.
fi

# Create wheel workspace
Expand Down
1 change: 1 addition & 0 deletions include/mkldnn/dnnl.h
1 change: 1 addition & 0 deletions include/mkldnn/dnnl.hpp
1 change: 1 addition & 0 deletions include/mkldnn/dnnl_types.h
1 change: 1 addition & 0 deletions include/mkldnn/mkldnn.hpp
1 change: 1 addition & 0 deletions include/mkldnn/mkldnn_dnnl_mangling.h
1 change: 1 addition & 0 deletions include/mkldnn/mkldnn_version.h
7 changes: 5 additions & 2 deletions mkldnn.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ifeq ($(USE_MKLDNN), 1)
MKLDNN_BUILDDIR = $(MKLDNN_SUBMODDIR)/build
MXNET_LIBDIR = $(ROOTDIR)/lib
MXNET_INCLDIR = $(ROOTDIR)/include
MKLDNN_LIBFILE = $(MKLDNNROOT)/lib/libmkldnn.a
MKLDNN_LIBFILE = $(MKLDNNROOT)/lib/libdnnl.a
endif

mkldnn_FLAGS = -DCMAKE_INSTALL_PREFIX=$(MKLDNNROOT)
Expand Down Expand Up @@ -49,10 +49,13 @@ $(MKLDNN_LIBFILE):
cmake $(MKLDNN_SUBMODDIR) $(mkldnn_FLAGS)
$(MAKE) -C $(MKLDNN_BUILDDIR) VERBOSE=1
$(MAKE) -C $(MKLDNN_BUILDDIR) install
cp $(MKLDNN_BUILDDIR)/include/mkldnn_version.h $(MXNET_INCLDIR)/mkldnn/.
cp $(MKLDNN_BUILDDIR)/include/dnnl_version.h $(MXNET_INCLDIR)/mkldnn/.
cp $(MKLDNN_BUILDDIR)/include/dnnl_config.h $(MXNET_INCLDIR)/mkldnn/.

mkldnn_clean:
$(RM) -r 3rdparty/mkldnn/build
$(RM) -r include/mkldnn/dnnl_version.h
$(RM) -r include/mkldnn/dnnl_config.h

ifeq ($(USE_MKLDNN), 1)
mkldnn: mkldnn_build
Expand Down

0 comments on commit ca76bf1

Please sign in to comment.