Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

CNR setting does not work as expected

Maximilian_B_
Beginner
732 Views

I am working on different machines (notebook and cloud, all Win7) and thus want to set CNR manually to get reproducible results (e.g. when working with Matlab).

Thus, and using the latest MKL version, I run the following in cmd:

cd "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.3.207\windows\mkl\bin"
@call mklvars.bat intel64 && set MKL_CBWR=SSE2 && set BLAS_VERSION=mkl_rt.dll && set LAPACK_VERSION=mkl_rt.dll
"C:\Program Files\MATLAB\R2016a\bin\matlab.exe"

Matlab starts and uses the latest MKL version, as expected.

However, the CNR branch does not change and is still AVX2 (not SSE2, as requested).

Can you help me with that? Thank you!

0 Kudos
6 Replies
Ying_H_Intel
Employee
732 Views

Hi Maximilian

We will check this. Could you please let us know how do you check "the CNR branch does not change and is still AVX2 (not SSE2, as requested)."

Best Regards, 

Ying 

0 Kudos
Maximilian_B_
Beginner
732 Views

Thank you for your fast reply. I give some more information:

I loaded Matlab (2016a) without changing anything and then ran

version -blas

in the Matlab command shell, which gave me following information:

Intel(R) Math Kernel Library Version 11.2.3 Product Build 20150413 for Intel(R) 64 architecture applications, 
CNR branch AVX2

This is the default MKL shipped with Matlab. I then downloaded the latest Intel MKL and Microsoft Visual Studio and ran the above code in the hope to compile a new MKL with CNR set to SSE2 (which is the setting on my cloud, that I cannot change).

In the new Matlab which opens, I run the version check again and get following

Intel(R) Math Kernel Library Version 11.3.3 Product Build 20160413 for Intel(R) 64 architecture applications, 
CNR branch AVX2

Thus, Matlab now uses the latest MKL version, however CNR is still set to AVX2 and not SSE2.

Thats what I would like to change to get reproducible results from the cloud machines and my notebook.

0 Kudos
Ying_H_Intel
Employee
732 Views

Hi Max, 

Thanks for let us know. 

We can see the problem as well. Will test the latest MKL version and let you know. 

But how about you  use Matlab directly?  i guess, this may beyond of our control as Matlab have MKL build in and may be have CNR set internally.   Moreover , change to the unsupported MKL version was undocumented feature and we do not guarantee that it works with addon feature. 

Best Regards,

Ying 

 

 

0 Kudos
Maximilian_B_
Beginner
732 Views

Hi Ying,

thank you very much. It would be great if you could have a look at this issue.

I asked the Matlab support whether Matlab overrides the CNR setting in environment variable MKL_CBWR, or whether CNR has to be set differently to work in Matlab. I am waiting for an answer so far.

Best,

Max

0 Kudos
Ying_H_Intel
Employee
732 Views

Hi Max,

Thanks for the update. 

We tested Matlab2015b with the latest version  MKL 2017, it seems there are some changes when load modules (below) . but it still uses AVX2 dll at my sides(when run A*B).  You may suppose to get MKL 2017 next month, please let us know if any result.  

Best Regards,
Ying

MKL 11.3.3 in Matlab 2015b

We use “version –module”,   when load mkl_rt.dll,  it will load  

mkl_avx2.dll

mkl_core.dll

mkl_intel_thread.dll

automatically. 

 

MKL 2017 in Matlab 2015b

We use “version –module”,   when load mkl_rt.dll,  it will load  two of them

 

mkl_core.dll

mkl_intel_thread.dll

automatically. 

 

0 Kudos
Maximilian_B_
Beginner
732 Views

Hi Ying,

thanks for the investigation. I ran my Matlab 2016a with both versions of MKL (the one shipped with Matlab and the current) and found under "version -modules" only the following MKL related files:

MKL 11.3.3, Matlab 2016a

C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.3.207\windows\redist\intel64\mkl\mkl_core.dll Version 11.3     
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.3.207\windows\redist\intel64\mkl\mkl_intel_thread.dll Version 11.3
C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.3.207\windows\redist\intel64\mkl\mkl_rt.dll Version 11.3    

MKL 11.2.3 (shipped with Matlab), Matlab 2016a

C:\Program Files\MATLAB\R2016a\bin\win64\mkl.dll Version <unknown>

So it seems that an AVX related file is not even loaded in my case. But checking with "version -blas", I find that under both circumstances (and with environment variable MKL_CBWR in Windows set to SSE2) the CNR is still set to AVX2.

I will download the new MKL 2017 as soon as released and give an update.

 

0 Kudos
Reply