I finally came around to install the latest Intel MKL libraries under Windows (MKL-2017.3.210) to give it a spin. After a bit of messing around trying to figure out what to link against which mkl libraries in DLIB. as the CMake under Windows doesn't locate BLAS,LAPACK at all it seems.
I finally got it to link and run without the program exiting immediately without giving any error message (which is strange on its own). So I tried dnn_imagenet_ex to see if it makes any difference in terms of execution speed. But when I start the final linked executable it crashes and I see these messages appearing in the console:
Intel MKL ERROR: Parameter 6 was incorrect on entry to DGESVD.
Intel MKL ERROR: Parameter 11 was incorrect on entry to cblas_dgemm.
Intel MKL ERROR: Parameter 9 was incorrect on entry to cblas_dgemm.
Intel MKL ERROR: Parameter 6 was incorrect on entry to DGESVD.
So I guess the external interfaces don't quiet link up correctly?
It does work. There are just a bunch of linker options and only some work. You can find documentation on the intel page somewhere and you will find out that the mkl has a huge number of linking modes on windows. I setup cmake to find it and do the right thing on windows. It seems like the mkl install paths change all the time though. It's probably just that more search paths need to be added to cmake to find them.
Yes you're right there are just too many options, now I've found a combo that at least does not seem to crash in case someone is interested this combo seems to work:
mkl_core.lib
mkl_intel_lp64.lib
mkl_intel_thread.lib
libiomp5md.lib
You should try and see if adding the mkl install folder to the list of paths at the bottom of this file makes cmake work: https://github.com/davisking/dlib/blob/master/dlib/cmake_utils/cmake_find_blas.txt
And submit a PR if it does :)
Well it looks like it mostly seems right but libiomp5md seems to have moved or better say the symbolic link the installer used to set for the directories are slightly different and it doesn't add a link to the compilers directory or maybe it is just my setup that screwed it up. as I had an older version of Intel XE Studio installed I don't know.
Btw should I see a significant speed-up when using MKL and the dnn dlib-examples? As I don't really seem to see any.
Yeah, I've noticed over the years that the MKL very often moves files around and changes folder names, library names, and all kinds of things.
Yes, the DNN code should be obviously faster and you should see multiple cores being used. Maybe not for all the examples but for the computationally demanding ones you should.
@OranjeeGeneral
Thanks for sharing the linker names.
Tested it with intel mkl 2019 update 1.
It is faster than openblas.
Most helpful comment
Yes you're right there are just too many options, now I've found a combo that at least does not seem to crash in case someone is interested this combo seems to work:
mkl_core.lib
mkl_intel_lp64.lib
mkl_intel_thread.lib
libiomp5md.lib