Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to build Intel Caffe with full MKL, MKL-ML and MKL-DNN #10

Closed
psyhtest opened this issue Feb 19, 2018 · 2 comments
Closed

Allow to build Intel Caffe with full MKL, MKL-ML and MKL-DNN #10

psyhtest opened this issue Feb 19, 2018 · 2 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@psyhtest
Copy link
Contributor

As I understand from here, it is potentially possible to use Intel Caffe with 3 options:

  1. Full MKL - a big manual download; some set up is required (specifying MKLROOT?).
  2. MKL-ML - a smaller automatic download during Caffe installation.
  3. MKL-DNN - a small automatic download during Caffe installation.

Initially, I tried to build Intel Caffe using GCC-6 and OpenBLAS (BLAS=open). Unfortunately, Caffe got linked against GNU OpenMP (libgomp.so), and the performance was terrible (#1).

Then, I tried to use Intel OpenMP (libiomp.so) from the full MKL (#5) and from the built-in Ubuntu package (#6). However, it became clear from looking at CMakeLists.txt that the build system would only try to link against libiomp.so when BLAS=mkl was specified.

So I updated the lib-caffe-intel-master-cpu and lib-caffe-intel-request-cpu packages to use that option. From the increased download times, I conclude this is equivalent to option 2 above (i.e. MKL-ML).

It would be interesting to be able to build with any BLAS option (i.e. full MKL or MKL-ML or MKL-DNN), if the Intel Caffe code is suitably updated.

@psyhtest psyhtest added enhancement New feature or request help wanted Extra attention is needed labels Feb 19, 2018
@jgong5
Copy link

jgong5 commented Feb 21, 2018

@psyhtest Anton, please allow me to explain the complicated library dependencies so that you can understand better how to provide the best configuration.

IntelCaffe is different from BVLC Caffe in that it links with MKL-DNN library which is the only recommended configuration for best performance. There are other build options to link IntelCaffe with MKLML alone but it is due to historical reasons and not recommended. IntelCaffe would download MKL-DNN library (3) and MKLML library (2) which MKL-DNN relies on. The latter provides the minimal BLAS functionalities that Caffe needs and these functionalities are equivalent to what the full MKL package (1) could provide. MKLML package also includes the Intel OpenMP library that both MKL-DNN and MKLML depend on.

Building with the full MKL could probably work but it is not recommended.

@psyhtest
Copy link
Contributor Author

@jgong5 Many thanks for your clarification! It sounds that linking Caffe with MKLML for Intel platforms would be similar to linking Caffe with cuBLAS for NVIDIA platforms (which was indeed due to historical reasons and got dropped quite some time ago). Therefore, since the currently implemented option is both necessary and sufficient, I'm marking this as wontfix.

@psyhtest psyhtest added wontfix This will not be worked on and removed help wanted Extra attention is needed labels Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants