kpuatamazon commented on issue #17980: When compiled with MKL, fully_connected calls DNNL while dot and batch_dot call MKL URL: https://github.com/apache/incubator-mxnet/issues/17980#issuecomment-613009431 In case somebody finds this issue and wants their optimized build, here is a different workaround that removes the need for `LD_PRELOAD`. Just do this before running cmake the first time: ```bash export CXXFLAGS="${CXXFLAGS} -DUSE_MKL -I/opt/intel/mkl/include" ``` Then `cmake` can be run normally: ```bash cmake -GNinja -DUSE_CUDA=OFF -DCMAKE_BUILD_TYPE=Release .. ``` and the compiled MXNet can be run normally without any special environment variables. To be clear, the above kludge is an undocumented abomination. The problem with `cmake -D_DNNL_USE_MKL=FULL -DMKLINC=/opt/intel/mkl/include` is that it links against MKL twice. DNNL is hard-coded to link dynamically against `libmkl_rt.so`: https://github.com/oneapi-src/oneDNN/blob/1b05a28eb9666efef83b281e4cc1936db5e6cf6c/cmake/MKL.cmake#L64 Then MXNet also links statically against MKL. And it still wants the shared library in `dlopen`. So we should just remove the shared library. How do we do that? Implement everything else directly without using the build file. Specifically it implements in `CXXFLAGS` what the rest of build system does https://github.com/oneapi-src/oneDNN/blob/1b05a28eb9666efef83b281e4cc1936db5e6cf6c/cmake/MKL.cmake#L65-L67
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
