-
Notifications
You must be signed in to change notification settings - Fork 6.8k
MXNET compatibility with MKL libraries bundled in Microsoft R Open #8974
Comments
I cannot comment for using the core MKL library, but to use the MKL2017 and MKL2017 Experimental you will need to do the following:
The above works seemlessly, building process take cares of downloading the MKL2017 libraries. Not sure of the added benefits of using MKL instead of openblas if the MKL2017 and Experimental and enabled, but you'll need to modify some parameters in the |
I already did something equivalent for the libraries in /usr/local/lib prior to make rpkg
These are my make flags for building mxnet for MKL CPU acceleration when since mxnet 1.0.0 came out:
But it seems if I add the flag "USE_LAPACK=1", there are incompatibilities with "USE_BLAS=mkl" with several lapack routines unable to be found during linking stage if I don't install LAPACK development packages separately. Since there are LAPACK routines in the following libraries from MRO:
I was wondering if MXNET could be able to link from these without downloading the full MKL installation or installing openblas/atlas/lapack separately. |
@mjmg if you do not want to use full mkl (core), please try the following. export MKLROOT=/usr/local (change to location where you have MKL2017/MKLML , not full MKL) the above export will bypass downloading MKLML/MKL2017, and will just use your location. please build with, The above will build with BLAS set to MKLML and LAPACK enabled by default. The empty USE_BLAS will force the build to use MKLML's blas. |
@mjmg I'm also a MRO user. I don't think we can build MxNet with MKL bundled in Microsoft R Open since it doesn't offer any header files of MKL. You can use MKL-DNN instead. |
The summary of this issue (thanks @xinyu-intel) : https://mran.microsoft.com/documents/rro/multithread But it’s impossible (or not the recommended usage) to export this MKL bundled with MRO to MXNET as a complete BLAS. So, the best way is to install the Intel MKL in your system for MXNET BLAS. I think this is not an issue and a question. |
How about we document this somewhere? |
@marcoabreu good suggestion. I am working on updating the MKL-DNN readme. I will add this parts. https://github.com/apache/incubator-mxnet/blob/master/MKL_README.md |
@xinyu-intel Thanks for clarifying my issue/question. I have now used Intel MKL yum repo to fine tune the packages to be installed needed by MXnet instead of downloading everything as tar.gz. https://software.intel.com/en-us/articles/installing-intel-free-libs-and-python-yum-repo For the record, using the MKL libraries from MRO and installing only the headers from the Intel MKL repo did not work. One needs both the full libraries and headers from the repo. I do not like this solution since my docker images have redundant MKL library files consuming about ~500 MB. The alternative would be to build R from source and link MKL manually and then build MXnet and link from the installed MKL which would require a very complicated dockerfile. @pengzhao-intel |
We will add the doc according to #14399 Closing this one, feel free to reopen if there is any other issue. |
Description
Microsoft R Open (and some very determined people) build their R installations with Intel MKL libraries linked in.
I want to have MKL, MKLML, LAPACK, MKL2017, MKL2017_EXPERIMENTAL enabled in mxnet to use these existing libraries without having to install the full MKL installation from Intel. I'm not sure if mxnet can check for the presence of the MKL libraries and properly link from them during linking or use them properly for best performance in a CPU context.
Environment info (Required)
For R user, please provide R
sessionInfo()
:The following libraries are provided by Microsoft R Open and :
The text was updated successfully, but these errors were encountered: