-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MKLDNN] Question on installation and use of MKLDNN #14335
Comments
Hey, this is the MXNet Label Bot. |
@dbsxdbsx Thanks for raising this question. For questions, please submit them on MXNet discussion forum (https://discuss.mxnet.io), where it will get a wider audience and allow others to learn as well. Thanks! @mxnet-label-bot Add [Question, MKL, MKLDNN] |
@dbsxdbsx really thanks for the usage of MKLDNN backend. @xinyu-intel @TaoLv will help you with the specific questions and building issues. |
@mxnet-label-bot Add [Windows] |
@dbsxdbsx could you post the steps for reproducing the build issue? Or typical steps for building mxnet from a Windows user perspective. I also sent an email to you for details. Try to answer part of the questions:
It's possible to build MXNet with MKL/MKL-DNN from source. Please take a look at what we do in CI:
Currently, it is much easier to get MKLML compared with to get full MKL. It has more friendly license to mxnet, smaller binary size and more convenient download source. So now it's the default behavior to download MKLML and link to it when mxnet is built with USE_MKLDNN=1. But you're right, there is no need to link MKLML if full MKL is installed and linked to mxnet. |
@pengzhao-intel @TaoLv , Actually, for the past several days, I've succeeded in build mxnet on win10 with FULL MKL+MKLDNN, and run it in python. But not yet in C++ because of issue #14116. Now I am trying to clear and note everything useful during my compiling. Once it is done, I would post it here, but maybe in Chinese, not English. Hope it is helpful. |
You're very welcomed to contribute them back to mxnet. |
@TaoLv @pengzhao-intel ,Finally, I made it. Too exhausting! link here. Hope it is helpful. |
@dbsxdbsx Really nice summary! Will follow it and try to reproduce the issue. |
@NeoZhangJianyu ,thanks. |
The question is answered so closing |
Target
I am trying to build mxnet from source to use with python and C++ on win10_64, and with MKL+MKLDNN as backbone.
I KNOW what I stated below may be TOO MUCH, but I do think these questions are representative, as I've googled A LOT before, and still not solved.
Question on installation
With the latest
CMakeList.txt
in mxnet source,I see:(Here, I know MKL is the basic intel lib can be installed alone.
MKLML_MKL
is a sub module of MKL.MKLDNN
is lib optimized for deep learning especially, it can be used alone or with MKL( FULL INSTALLTION or MKLML_MKL) or even other blas lib. And from Intel MKLDNNoffically, seems MKL(FUll Installation)+MKLDNN would give the best performance---that is what I want to try. And I've FULLY installed MKL manually before.)Q1: why the explanation of
USE_MKLML_MKL
andUSE_MKLDNN
are all the same, it is confusing. I did found an issue talking about this, but it is still confusing. And after checking CMakeList.txt superficially, I don't know what variableUSE_MKLML_MKL
is used for?Q2: from office tutorial of gluonCV with C++, seems it is feasible to build with MKL+MKLDNN in cmd command. But with CMake Gui, USE_MKLDNN is forbidden, as it need
(NOT MSVC)
. WHY?Q3: To build MKLDNN with MKL(full installed but NOT submodule), with mxnet official tutorial here, I need to:
Copy file 3rdparty/mkldnn/config_template.vcxproj to incubator-mxnet root.
But I only foundconfig_template.vcxproj.user
, does that mean I could build mxnet with MKL+MKLDNN after I copy it to the root path of mxnet but with NO selection ofUSE_MKLDNN
when configuring with CMAKE Gui?Q4: I googled a lot on MKl with mxnet, and I found a discussion within mxnet team, with the content of the discussion and what I found in
downloadMKLML.cmake
, does it mean mxnet recommand install MKLDNN with JUST submodule of MKL at present(and it is still vague to decide whether submodule of MKL is needed when building mxnet from source)?(As far as I know,to build MKLDNN LIB, there is no need to download a submodule of MKL once MKL is FULL installed. And I did succeed without doing it within building mxnet.)
Question on usage of MKL
I know mxnet is just released a new version 1.4, with some update of MKL(+DNN). But after looking into tutorial MKLDNN_README, With MKL+MKLDNN built with mxnet 1.4,I wonder
Q1: does it mean that MKL+MKLDNN is automatically used in cpu mode with net graph BUT NOT include
SUBGRAPH
without setting an OS variableMXNET_SUBGRAPH_BACKEND=MKLDNN
when using mxnet lib?Q2: For optimization, is
MXNET_SUBGRAPH
a concept that always existed within a net graph, if so, I guess there is no need to set OS variableMXNET_SUBGRAPH_BACKEND
any longer when the feature is matured?The text was updated successfully, but these errors were encountered: