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

[MKLDNN] Question on installation and use of MKLDNN #14335

@dbsxdbsx

Description

@dbsxdbsx

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:

mxnet_option(USE_MKL_IF_AVAILABLE "Use MKL if found" ON)
mxnet_option(USE_MKLML_MKL        "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE))
mxnet_option(USE_MKLDNN           "Use MKLDNN variant of MKL (if MKL found)" ON IF USE_MKL_IF_AVAILABLE AND (NOT APPLE) AND (NOT MSVC) AND (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") AND (NOT CMAKE_CROSSCOMPILING))

(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 and USE_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 variable USE_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 found config_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 of USE_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 variable MXNET_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 variable MXNET_SUBGRAPH_BACKEND any longer when the feature is matured?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions