-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Fix the incorrect MKLDNN/MKL logic in cmake #14829
Conversation
fix the mxnet cmake build systems to make MKLDNN, MKL logic correct.
unlock MKLDNN and MKL dependency
We planned to update the 3 cmakefiles : ChooseBLAS.cmake, FindMKL.cmake and mshadow.cmake. The logic diagram is as the pdf. Red parts are original logic and green parts are new. and we test both windows and linux,and get the build passed, thanks |
@yinghu5 do we need the build test in CI for these change? |
@mxnet-label-bot add[CMake] |
agree with pengzhao. we should add test to CI to check if flags link MKL and MKLDNN correctly. |
@zixuanweeei please help verify the change in local |
Add WIN_CPU_MKLDNN WIN_CPU_MKLDNN_MKL
update for mkl/mkldnn cmake test
custom_steps.compile_windows_cpu_mkldnn(), custom_steps.compile_windows_cpu_mkldnn_mkl(), custom_steps.compile_windows_cpu_nomkldnn_mkl()
WIN_CPU_MKLDNN
WIN_CPU_NOMKLDNN_MKL
thank you @pengzhao-intel @azai91 , I try to add CI test first windows. and run into two issues.
It fails with the following output:
|
@marcoabreu @KellenSunderland @larroy to help for the CI issue. |
Can you please adjust ci/build_windows.py with the changes required for your modifications? |
Is the control flow chart autogenerated if so how? does it reflect our current state or where we want to be at? |
How can we be of additional help? Is because MKL is not found in win? I guess MKL is not installed in our windows AMI. @Chancebair |
MKL is not installed via the AMI baking process |
@@ -43,55 +43,7 @@ endif() | |||
# ---[ Root folders | |||
set(INTEL_ROOT "/opt/intel" CACHE PATH "Folder contains intel libs") | |||
|
|||
if(USE_MKLDNN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though now it is convoluted in 1 file there is a configuration difference between full MKL and MKLML. For example, the librt
library is present only in full MKL, OpenMP library needs to be configured explicitly for MKLML. Previously, I made an attempt to separate it to 2 different files, maybe you can reuse some code from there #11148
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Chancebair . @lebeg thank you a lot for the review. Yes, we actually need full MKL package install on CI machine. There are mainly two factors , which
- MKLDNN will don't depend on the MKLML in the future,
- second, but important, MXNET will use more MKL functions other than in MKLML.
So we decide to unlock MKLDNN (MKLML) and MKL dependency, which means,
use MKLDNN and USE_BLAS=mkl completely independent.
- MKLDNN is on, it will download MKLML automatically. doesn't use full MKL package.
- when USE_BLAS=mkl, only use the full MKL. (MKL_ROOT). won't detect MKLML (from MKLDNN).
Thanks
I remember we have build and test for USE_BLAS=mkl in CI. MKL is installed through apt-get on ubuntu: https://github.com/apache/incubator-mxnet/blob/master/ci/docker/install/ubuntu_mkl.sh#L28 |
@Chancebair @marcoabreu Can you help to install a full MKL library for window CI? As showed in the changes of this PR, usually full MKL will be installed to C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl on windows. You can get the executable here: http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15247/w_mkl_2019.3.203.exe |
@larroy @lebeg @pengzhao-intel @TaoLv @Chancebair @marcoabreu . sorry i close the PR by accident when rebase my branch , and reopen it into #14877. please help to review there. thanks |
No, we draw it manually :) |
@larroy, in the PR, we only change the MKLDNN and MKL part, and keep the OpenBLAS untouched. About #14028 agree the latest solution, I will update the install guide of windows
|
@TaoLv I created a ticket with my teams oncall to look into this |
Please continuous review on #14877 |
Fix the mxnet cmake build systems to make MKLDNN, MKL as BLAS logic correct.
3 files : incubator-mxnet\cmake\ChooseBLAS.cmake
\incubator-mxnet\cmake\Modules\FindMKL.cmake
and Update incubator-mxnet\3rdparty\mshadow\cmake\mshadow.cmake to set BLAS #374
are updated.
Description
(Brief description on what this PR is about)
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments