You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/07/09 02:10:56 UTC

[GitHub] [incubator-mxnet] MaeThird commented on issue #15483: can compile with MKLDNN + MKLML but no MKL

MaeThird commented on issue #15483: can compile with MKLDNN + MKLML but no MKL
URL: https://github.com/apache/incubator-mxnet/issues/15483#issuecomment-509458426
 
 
   Hi @pengzhao-intel
    MKLDNN + MKLML + CBLAS( Atlas or OpenBlas) **works as expected**. 
    MKLDNN + MKLML + USE_BLAS_MKL=1 (Actually there was no MKL,I just replaced it with MKLML) with the error output:
   ```
    53%] Built target mxnet_static
   [ 55%] Built target dmlc
   [ 84%] Built target mkldnn
   [ 84%] Built target libomp-needed-headers
   [ 92%] Built target omp
   [ 93%] Built target mxnet
   [ 94%] Built target gtest
   [ 94%] Built target gtest_main
   [ 94%] Linking CXX executable mxnet_unit_tests
   /usr/bin/ld: ../libmxnet.a(elemwise_unary_op_basic.cc.o): in function `void mxnet::op::UnaryOp::MKL_Compute<mxnet::op::mshadow_op::erf, mxnet::op::mkl_func::erf>(nnvm::NodeAttrs const&, mxnet::OpContext const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&, std::vector<mxnet::OpReqType, std::allocator<mxnet::OpReqType> > const&, std::vector<mxnet::TBlob, std::allocator<mxnet::TBlob> > const&)':
   elemwise_unary_op_basic.cc:(.text._ZN5mxnet2op7UnaryOp11MKL_ComputeINS0_10mshadow_op3erfENS0_8mkl_func3erfEEEvRKN4nnvm9NodeAttrsERKNS_9OpContextERKSt6vectorINS_5TBlobESaISF_EERKSE_INS_9OpReqTypeESaISK_EESJ_[_ZN5mxnet2op7UnaryOp11MKL_ComputeINS0_10mshadow_op3erfENS0_8mkl_func3erfEEEvRKN4nnvm9NodeAttrsERKNS_9OpContextERKSt6vectorINS_5TBlobESaISF_EERKSE_INS_9OpReqTypeESaISK_EESJ_]+0x93): undefined reference to `vsErf'
   /usr/bin/ld: elemwise_unary_op_basic.cc:(.text._ZN5mxnet2op7UnaryOp11MKL_ComputeINS0_10mshadow_op3erfENS0_8mkl_func3erfEEEvRKN4nnvm9NodeAttrsERKNS_9OpContextERKSt6vectorINS_5TBlobESaISF_EERKSE_INS_9OpReqTypeESaISK_EESJ_[_ZN5mxnet2op7UnaryOp11MKL_ComputeINS0_10mshadow_op3erfENS0_8mkl_func3erfEEEvRKN4nnvm9NodeAttrsERKNS_9OpContextERKSt6vectorINS_5TBlobESaISF_EERKSE_INS_9OpReqTypeESaISK_EESJ_]+0xf9): undefined reference to `vdErf'
   collect2: error: ld returned 1 exit status
   make[2]: *** [tests/CMakeFiles/mxnet_unit_tests.dir/build.make:354: tests/mxnet_unit_tests] Error 1
   make[1]: *** [CMakeFiles/Makefile2:1825: tests/CMakeFiles/mxnet_unit_tests.dir/all] Error 2
   ```
   It turns out  **MKLML cannot replace the MKL as the blas using**.
   **Another small issue is** that [https://github.com/intel/mkl-dnn/blob/41bee20d7eb4a67feeeeb8d597b3598994eb1959/src/common/utils.cpp#L53](url)                 `strncpy(value, buffer, value_length);`will case 
   ```
   In file included from /usr/include/string.h:494,
                    from /home/mae/mxnet/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp:17:
   In function ‘char* strncpy(char*, const char*, size_t)’,
       inlined from ‘int mkldnn::impl::mkldnn_getenv(char*, const char*, int)’ at /home/mae/mxnet/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp:53:24:
   /usr/include/bits/string_fortified.h:106:34: error: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
     106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
         |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   /home/mae/mxnet/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp: In function ‘int mkldnn::impl::mkldnn_getenv(char*, const char*, int)’:
   /home/mae/mxnet/incubator-mxnet/3rdparty/mkldnn/src/common/utils.cpp:49:34: note: length computed here
      49 |             value_length = strlen(buffer);
   ```
   **with GCC-9.1** . It's handy to fix it.

----------------------------------------------------------------
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