Inconsistent results in MKL computations because of a missing environment variable in Microsoft R Server or Machine Learning Server


When you run Microsoft R Server 9.0, 9.1, 9.2, 9.3.x, or Microsoft Machine Learning Server as part of Microsoft SQL Server 2017, you experience inconsistent results in Intel Math Kernel Library (MKL) computations. This issue occurs because of a missing MKL_CBWR environment variable.


This issue occurs because a new feature was added to the Intel MKL library that's included together with Microsoft R Server and SQL Server 2017. For more information about this feature, go to the following Intel website:


To fix this issue, configure conditional numeric reproducibility in Microsoft R Server or Machine Learning Server by setting the MKL_CBWR=AUTO system environment variable. To do this, follow these steps:

  1. In Control Panel, select System and Security > System > Advanced System Settings > Environment Variables.

  2. Create a new User or System variable, and specify the following values:

    • Set the variable name to MKL_CBWR.

    • Set the variable value to AUTO.

  3. Restart Microsoft R Server.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

In future versions of Microsoft R Server, the MKL_CBWR=AUTO setting will be the default setting.


Known issues in Machine Learning Services

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.