Build fails on MKLDNN code


#1

Hi,

I’m building MXNet from source on Ubuntu 18.04 and see the following failure when building the mkldnn code:

g++ -std=c++11 -c -DMSHADOW_FORCE_STREAM -Wall -Wsign-compare -O3 -DNDEBUG=1 -I/home/lgo/dev/incubator-mxnet/3rdparty/mshadow/ -I/home/lgo/dev/incubator-mxnet/3rdparty/dmlc-core/include -fPIC -I/home/lgo/dev/incubator-mxnet/3rdparty/tvm/nnvm/include -I/home/lgo/dev/incubator-mxnet/3rdparty/dlpack/include -I/home/lgo/dev/incubator-mxnet/3rdparty/tvm/include -Iinclude -funroll-loops -Wno-unused-parameter -Wno-unknown-pragmas -Wno-unused-local-typedefs -msse3 -DMSHADOW_USE_F16C=0 -I/usr/include -DMSHADOW_USE_CBLAS=1 -DMSHADOW_USE_MKL=0 -I/home/lgo/dev/incubator-mxnet/3rdparty/mkldnn/build/install/include -DMSHADOW_RABIT_PS=0 -DMSHADOW_DIST_PS=0 -DMSHADOW_USE_PASCAL=0 -DMXNET_USE_MKLDNN=1 -DUSE_MKL=1 -I/home/lgo/dev/incubator-mxnet/src/operator/nn/mkldnn/ -I/home/lgo/dev/incubator-mxnet/3rdparty/mkldnn/build/install/include -DMXNET_USE_OPENCV=1 -I/usr/include/opencv -fopenmp -DMXNET_USE_OPERATOR_TUNING=1 -DMSHADOW_USE_CUDNN=1 -I/home/lgo/dev/incubator-mxnet/3rdparty/cub -DMXNET_ENABLE_CUDA_RTC=1 -DMXNET_USE_NCCL=0 -DMXNET_USE_LIBJPEG_TURBO=0 -MMD -c src/operator/nn/mkldnn/mkldnn_deconvolution.cc -o build/src/operator/nn/mkldnn/mkldnn_deconvolution.o
In file included from src/operator/nn/mkldnn/…/deconvolution-inl.h:29:0,
from src/operator/nn/mkldnn/mkldnn_deconvolution.cc:28:
src/operator/nn/mkldnn/mkldnn_deconvolution.cc: In function ‘mkldnn::convolution_forward::primitive_desc mxnet::op::GetDeconvBwd_(const mkldnn::memory::desc&, const mkldnn::memory::desc&, bool, const mkldnn::memory::desc&, const mkldnn::engine&, const dims&, const dims&, const dims&)’:
src/operator/nn/mkldnn/mkldnn_deconvolution.cc:68:23: error: ‘struct mkldnn::convolution_forward::primitive_desc’ has no member named ‘next_impl’
CHECK(deconv_pd.next_impl()) << “No implementation”;
^
/home/lgo/dev/incubator-mxnet/3rdparty/dmlc-core/include/dmlc/logging.h:122:9: note: in definition of macro ‘CHECK’
if (!(x)) \

and

src/operator/nn/mkldnn/mkldnn_base.cc:317:12: error: ‘mkldnn_ncw’ was not declared in this scope
case mkldnn_ncw:
^~~~~~~~~~
src/operator/nn/mkldnn/mkldnn_base.cc:317:12: note: suggested alternative: ‘mkldnn_nchw’
case mkldnn_ncw:
^~~~~~~~~~
mkldnn_nchw
src/operator/nn/mkldnn/mkldnn_base.cc:318:12: error: ‘mkldnn_nwc’ was not declared in this scope
case mkldnn_nwc:
^~~~~~~~~~
src/operator/nn/mkldnn/mkldnn_base.cc:318:12: note: suggested alternative: ‘mkldnn_ntc’
case mkldnn_nwc:
^~~~~~~~~~
mkldnn_ntc
src/operator/nn/mkldnn/mkldnn_base.cc:319:12: error: ‘mkldnn_nCw8c’ was not declared in this scope
case mkldnn_nCw8c:
^~~~~~~~~~~~
src/operator/nn/mkldnn/mkldnn_base.cc:319:12: note: suggested alternative: ‘mkldnn_nChw8c’
case mkldnn_nCw8c:

My build script is as follows:

#!/bin/sh

make_params=“USE_OPENCV=1 USE_BLAS=openblas USE_CUDA=1 USE_F16C=0 USE_MKLDNN=1 USE_CUDA_PATH=/usr USE_CUDNN=1”
make -j $(nproc) $make_params

The solution for this build issue is to update all the 3rd part submodules (or at least the mlkdnn submodule) to their specified revision:

$ git submodule update --recursive --remote

Posting this here to save other people a bit of time.

Lieven


#2

Great, thanks for posting @Igo.