Different Numerical results between Intel and AMD

70 views (last 30 days)
I am using R2023b on an Intel (desktop) machine and comparing results with the AMD machine (Threadripper using the zen architecture). I noticed tht the Intel machine uses AVX2, while the MKL libraries for the AMD machine uses AVX auto when I check which version is being used.
There have been differences in numerical results between the Intel and AMD machine, which builds up over time and these results don't converge. Using the AOCL libraries on AMD give me worse results, hence I am wondering what are some possible sources of these numerical differences and whether it is possible to force the AMD MKL libraries version to be on AVX2 so we can determine if this affects the results.

Answers (1)

Tejas
Tejas on 13 Aug 2024
Hello Huiyu,
My understanding from the above question is, that you want to know why there is difference in numerical values when using AVX and AVX2, and whether it is possible to configure the MKL libraries to utilize AVX2.
The variation in numerical values arises from the distinct ways AVX and AVX2 interpret and process floating-point numbers. For a more comprehensive explanation, refer to the links provided below.
To configure the MKL libraries to use AVX2, follow these steps:
  • Open Notepad and paste the following code:
@echo off
set MKL_DEBUG_CPU_TYPE=5
matlab.exe
  • Save this file. It will be saved as a .TXT file. Change the extension to .BAT.
  • Double-clicking this file will start MATLAB with MKL in AVX2 mode on an AMD machine.
The above solution creates an instance of MATLAB with MKL in AVX2 mode. Starting MATLAB without this method will start MATLAB with default settings.
To always start MATLAB with MKL in AVX2 mode, make a new variable in System Environment Variables with the name ‘MKL_DEBUG_CPU_TYPE’ and set its value as 5. For more details, refer the MATLAB answer provided below:

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Tags

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!