Using MKL with cntk
I have installed the MKL lib and set the preprocessor definition USE_MKL in the Math project. When I compile Math prj, I am seeing these errors related to missing cuda and acml headers: error C1083: Cannot open include file: 'cuda_runtime_api.h': No such file or directory \Source\Repos\cntk\Source\Math\CUDAPageLockedMemAllocator.cpp 5 1 Math
error C1083: Cannot open include file: 'cuda.h': No such file or directory (MatrixQuantizerCPU.cpp) \source\repos\cntk\source\math\ValueQuantizer.h 8 1 Math
error C1083: Cannot open include file: 'acml.h': No such file or directory \Source\Repos\cntk\Source\Math\CPUSparseMatrix.cpp 33 1 Math
Are there any more dependencies which I am missing. Understanding was that CUDA or ACML is not needed when using MKL. I am building for CPU only config
I would recommend to install ACML instead of MKL, it's the mainstream meanwhile. See #447.
Thanks for referring to this post ! Actually I have to use MKL. I will try what some other users have suggested here
We will update CNTK in the very soon to make it easier to build with MKL I would guess this will become available next week in the master branch We will distribute custom MKL libraries for use with CNTK, so you won't need to install the complete MKL kit. You will than be able to switch between building with ACML or MKL custom libraries by changing an environment setting
In the mid-term we plan to deprecate ACML and make MKL-custom-libraries the default
thx Wolfgang
Thanks. Please keep us updated on the check ins. If I want to use an updated version of MKL, is installing the updates sufficient or it requires changes to cntk (source/config) as well.
We are supplying a custom library for you to use with the CNTK source code (https://software.intel.com/en-us/node/528362). this is all you need, so no MKL SDK necessary
If you want extend the usage of MKL or use a different version of the MKL SDK, you should be able to build your own version of the custom library with your version of the MKL SDK (it is a pretty straight forward process, we will supply our scripts as a blueprint) and you build CNTK with that version. This should be possible with very minimal changes to the build config (couple of lines)
Give it a try next week and give us feedback. I hope it will make your life easier ....
Thanks, will try this. I am looking for some answers related to resnet usage with cntk : https://github.com/Microsoft/CNTK/issues/522
Can you help me with this.
@rashee182, @quicktrick - Today we've merged the updated CNTK MKL support based on a CNTK custom MKL into master. Please give it a go, if you want. Updated set up instructions are provided here, specifically in the section on "MKL": https://github.com/Microsoft/CNTK/wiki/Setup-CNTK-on-Windows https://github.com/Microsoft/CNTK/wiki/Setup-CNTK-on-Linux Hope this helps,
Mark
@mahilleb-msft I pulled in the master branch today and downloaded CNTKCustomMKL-Windows-1.zip. Following the build instructions here : https://github.com/Microsoft/CNTK/wiki/Setup-CNTK-on-Windows Still it seems that the prj files need some updates since I am seeing errors like 2>CPUSparseMatrix.cpp(33): fatal error C1083: Cannot open include file: 'acml.h': No such file or directory 2>CPUMatrix.cpp(44): fatal error C1083: Cannot open include file: 'acml.h': No such file or directory
Looks like USE_ACML is still defined in these files.
@rashee182 - can you double-check that the ACML_PATH environment variable is not set (and Visual Studio doesn't see it, i.e., possibly sign-out and sign-in again)?
@mahilleb-msft - There was one stale copy of ACML_PATH which I removed. Also removed ACML_FMA. Now I am able to build. Thanks :)
Glad to hear this! Closing...
Best, Mark
@mahilleb-msft - Are there any plans to release a CNTK custom MKL which is based on AVX 512
@mahilleb-msft : Going through some previous comments on this issue "If you want extend the usage of MKL or use a different version of the MKL SDK, you should be able to build your own version of the custom library with your version of the MKL SDK (it is a pretty straight forward process, we will supply our scripts as a blueprint) and you build CNTK with that version. This should be possible with very minimal changes to the build config (couple of lines)"
Can you provide directions on how to build the custom CNTK MKL lib using a different version of MKL SDK
@rashee182 - can you check out the files and README here: https://github.com/Microsoft/CNTK/tree/master/Dependencies/CNTKCustomMKL If there are additional questions or problems, please open a new issue...
Thanks, Mark