remove MKL_EXPERIMENTAL and update make files for MKL-DNN#9810
remove MKL_EXPERIMENTAL and update make files for MKL-DNN#9810marcoabreu merged 8 commits intoapache:masterfrom
Conversation
|
@zheng-da @piiswrong can you please review ... these are minor changes to remove old references to MKL_EXPERIMENTAL and minor updates to other make/doc changes. thanks! |
|
|
||
| 4. Navigate into the python directory | ||
|
|
||
| 5. Run 'sudo python setup.py install' |
There was a problem hiding this comment.
Is it necessary to remove this part? We still need to link to MKL for BLAS, right?
There was a problem hiding this comment.
good point, i added full MKL related instructions back.
| both `USE_MKL2017 = 1` and `USE_MKL2017_EXPERIMENTAL = 1` in | ||
| `config.mk`. Check | ||
| [MKL_README.md](https://github.com/dmlc/mxnet/blob/master/MKL_README.md) for | ||
| details. |
There was a problem hiding this comment.
We need to measure the performance of MKLDNN.
There was a problem hiding this comment.
agree, probably a separate PR, as there are other changes too (MXNet changes/op-refactor etc), not just MKL-DNN. We also have new AWS instance type, it would be nice to add AVX512 instance numbers.
|
|
||
| 5. Run 'sudo python setup.py install' | ||
|
|
||
| # MKL2017 PLUGIN |
There was a problem hiding this comment.
Shouldn't there be new documentation about MKLDNN instead?
There was a problem hiding this comment.
with new MKL-DNN integration, the installation has been tightly integrated (eg: mkl-dnn is a sub-module), no separate instructions are needed; the user just has to pass USE_MKLDNN=1 or modify config.mk or cmake (just as other options).
There was a problem hiding this comment.
@marcoabreu @ashokei I'd like to create a new page (documentation) for MKL-DNN to introduce the installation, feature, performance, coverage, etc.
But we can make this page as-is now and I will back a new PR :)
| # use openmp for parallelization | ||
| USE_OPENMP = 1 | ||
|
|
||
| # MKL ML Library for Intel CPU/Xeon Phi |
There was a problem hiding this comment.
Removing MKL flags from any arm cross compilation configs should be ok. Thanks for updating.
|
@ashokei there's a test for MKLML installation, tests/python/cpu/test_mklml.py. |
| # use openmp for parallelization | ||
| USE_OPENMP = 1 | ||
|
|
||
| # MKL ML Library for Intel CPU/Xeon Phi |
There was a problem hiding this comment.
Removing MKL flags from any arm cross compilation configs should be ok. Thanks for updating.
|
@szha i addressed all the review comments, can you please take a look/approve if ok. thanks! |
|
Would it be possible to fix the CMake build with MKLDNN too? It says mkldnn.hpp not found. |
| ifeq ($(USE_MKL2017), 0) | ||
| USE_STATIC_MKL = NONE | ||
| ifeq ($(USE_BLAS), mkl) | ||
| USE_STATIC_MKL = 1 |
There was a problem hiding this comment.
Do we know why we use static link when use MKL as blas? Is there any mkl related function could not be supported by mklml library (I remembered we used dynamic link to mklml library instead of static link to mkl library before for MKL2017, any change so we need to use static link)?
There was a problem hiding this comment.
Full MKL supports static lib option, the above flag enables that option. mklml only support dynamic; i believe both support all blas API.
There was a problem hiding this comment.
Thanks for the clarification, so do you mean USE_BLAS=mkl is used for using full MKL as blas library (and using static link)? If we want to use mklml as blas library (it is more light weighted if it support all blas API), how should we set the compile option?
I also notice there is some potential conflict here, if set USE_MKLDNN=1 and USE_BLAS=mkl, looks the generated libmxnet.so will both static link to mkl library and dynamic link to mklml library:
Static link to mkl library:
mshadow.mk line 63
MSHADOW_LDFLAGS += -L${MKLROOT}/../compiler/lib/intel64 -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a -Wl,--end-group -liomp5 -ldl -lpthread -lm
Dynamic link to mklml library:
mshadow.mk line 78:
MSHADOW_LDFLAGS += -Wl,--as-needed -lmklml_intel -lmklml_gnu
Is there any potential conflict here or indicate some issue need to fix? If both MKL and MKLML library could provide the blas API, which library it will use?
There was a problem hiding this comment.
Please respond to this que
There was a problem hiding this comment.
@jinhuang415 @marcoabreu
MSHADOW can use MKLML (which is automatically selected when users build with MKLDNN); USE_BLAS=mkl is specifically for full mkl (not related to MKLML or MKLDNN). So there is no conflict here; Either of those options support full BLAS compatible API;
mshadow handles both of these cases already; This PR or MKL-DNN integration PR , do not change this behavior. It is the same as before.
As @zheng-da mentioned, we can modify mshadow to directly use MKL-DNN build flag in another PR. It wasnt done before, as we did not have MKL-DNN integration (we do now).
This PR scope is limited to removing MKL_EXPERIMENTAL and cleaning up minor make file left overs.
| @@ -45,14 +45,14 @@ def test_mklml_install(): | |||
|
|
|||
| pid = os.getpid() | |||
| rc = os.system("cat /proc/" + str(pid) + \ | |||
| "/maps | grep libmklml_ > /dev/null") | |||
There was a problem hiding this comment.
Can you check if we still linked to libmklml_* library even for mkldnn case? If so we also need to add the check for libmklml_* library?
There was a problem hiding this comment.
technically MKL-DNN can be used without mklml, though we recommend users use both together for best performance.
|
@rahul003 cmake should work with mkldnn. mkldnn is a submodule in 3rdparty. did you update update mkldnn with |
marcoabreu
left a comment
There was a problem hiding this comment.
Can you please add a Jenkins compile job (doesn't have to be run by unittests) that uses CMake with MKLDNN? Just take https://github.com/apache/incubator-mxnet/blob/master/Jenkinsfile#L263, copy it and enable the MKL flags.
|
@marcoabreu can you please review requested Jenkins file changes; This PR is primarily targeting at removing MKL_EXPERIMENTAL and minor changes to regular makefiles; we may do a separate PR for cmake mkldnn build as required. thanks! |
| mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, dmlc-core/libdmlc.a, nnvm/lib/libnnvm.a' | ||
| // mxnet cmake libraries, in cmake builds we do not produce a libnvvm static library by default. | ||
| mx_cmake_lib = 'build/libmxnet.so, build/libmxnet.a, build/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, build/3rdparty/openmp/runtime/src/libomp.so' | ||
| mx_cmake_mkldnn_lib = 'build/libmxnet.so, build/libmxnet.a, build/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, /usr/local/lib/libiomp5.so, /usr/local/lib/libmklml_gnu.so, build/3rdparty/mkldnn/install/lib/libmkldnn.so, build/3rdparty/mkldnn/install/lib/libmkldnn.so.0, /usr/local/lib/libmklml_intel.so' |
There was a problem hiding this comment.
I don't understand why we are generating files outside the source directory. This could cause issues because I would not assume that a compile process writes files to /usr/local or any other place outside of the source directory. Since I don't have much experience with cmake, I'd like to ask @larroy and @cjolivier01 for assistance here
There was a problem hiding this comment.
@cjolivier01 /usr/local/lib/libiomp5.so /usr/local/lib/libmklml_gnu.so /usr/local/lib/libmklml_intel.so
There was a problem hiding this comment.
beats me — ask the Intel guys
There was a problem hiding this comment.
Will do. But is this an industry standard or would you expect all artefacts to be written into the source dir?
|
which files exactly?
…On Fri, Feb 23, 2018 at 1:19 AM Marco de Abreu ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Jenkinsfile
<#9810 (comment)>
:
> @@ -24,6 +24,7 @@
mx_lib = 'lib/libmxnet.so, lib/libmxnet.a, dmlc-core/libdmlc.a, nnvm/lib/libnnvm.a'
// mxnet cmake libraries, in cmake builds we do not produce a libnvvm static library by default.
mx_cmake_lib = 'build/libmxnet.so, build/libmxnet.a, build/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, build/3rdparty/openmp/runtime/src/libomp.so'
+mx_cmake_mkldnn_lib = 'build/libmxnet.so, build/libmxnet.a, build/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, /usr/local/lib/libiomp5.so, /usr/local/lib/libmklml_gnu.so, build/3rdparty/mkldnn/install/lib/libmkldnn.so, build/3rdparty/mkldnn/install/lib/libmkldnn.so.0, /usr/local/lib/libmklml_intel.so'
I don't understand why we are generating files outside the source
directory. This could cause issues because I would not assume that a
compile process writes files to /usr/local or any other place outside of
the source directory. Since I don't have much experience with cmake, I'd
like to ask @larroy <https://github.com/larroy> and @cjolivier01
<https://github.com/cjolivier01> for assistance here
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9810 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKts_V4K6R7JHtxWYDj-8E-RY7BJpf5eks5tXoKLgaJpZM4SIufG>
.
|
|
@marcoabreu jenkins issue is fixed, it passes the build. |
|
@marcoabreu i made suggested changes...can you please review/merge if ok. |
marcoabreu
left a comment
There was a problem hiding this comment.
Lgtm. Please address the open questions
* replace MKL2017 references with MKL-DNN * remove MKLML_ROOT * MKL_README.md for Full MKL * update test_mkldnn * update Jenkinsfile * update jenkins * trigger Jenkins with new changes * trigger Jenkins with new changes
* replace MKL2017 references with MKL-DNN * remove MKLML_ROOT * MKL_README.md for Full MKL * update test_mkldnn * update Jenkinsfile * update jenkins * trigger Jenkins with new changes * trigger Jenkins with new changes
Description
remove MKL_EXPERIMENTAL and update make files for MKL-DNN
Checklist
Essentials
make lint)Changes