Does Matlab perform well on AMD Ryzen?

273 visualizaciones (últimos 30 días)
TeichEnterich95
TeichEnterich95 el 20 de Mzo. de 2017
Comentada: Carlo Monjaraz el 26 de En. de 2021
Hi,
i want to buy a new CPU for Matlab but I am not sure if the new AMD Ryzen 1800X performs well on matlab. I know that the performance depends on the code you are running, but maybe there are some Ryzen owners out there who could post the results from the "bench" function.
Thanks. :)
  3 comentarios
Mickaël Tits
Mickaël Tits el 22 de Ag. de 2017
Hi, I'm thinking about buying a ryzen 7 too... Any news about a software patch so far ? Thanks!
Ned Flanders
Ned Flanders el 20 de Dic. de 2020
Editada: Ned Flanders el 20 de Dic. de 2020
Here's the result for an AMD Ryzen 5800x (integrated bench function - matlab 2020a)

Iniciar sesión para comentar.

Respuesta aceptada

Ned Flanders
Ned Flanders el 19 de Nov. de 2019
Editada: Ned Flanders el 16 de Sept. de 2020
AMD Ryzen/Threadripper CPUs perform excellent using Matlab since the 2020a Release, or if you perform a very simple tweak with the versions prior to 2020a.
Here is an example of several CPUs based on a matlab performance benchmark script you'll find in the link below.
As said, since Matlab 2020a, you'll have this performance out of the box. For Matlab versions prior to 2020a, please read the link below.
You should read it if you want to understand the background. If you ended up here because you are on an older Version on Matlab and have low performance with an AMD setup or you just want to apply the tweak, follow these steps: It will take less than a minute.
Solution 1 (Windows - no admin rights needed):
  • Create a .bat file with the following lines to start Matlab in AVX2 Mode
@echo off
set MKL_DEBUG_CPU_TYPE=5
matlab.exe
This is straight forward. You open Notepad, copy and paste the above three lines and save the file as Matlab-AVX2. Notepad will save the file as Matlab-AVX2.txt. Now replace the extension ".txt" with ".bat".
If you double-click that file, Matlab will start the MKL in AVX2 Mode. If you start it the normal way, it will remain as always.
You can also download the .bat file from my highdrive if you trust me (which you of course should not, as I am a random guy in the Internet). If you delete the startup batch file provided in the download or the one you created yourself, its gone and your computer will be as it has been before.
Solution 2 (Windows - admin rights needed): If you are happy with the results (which you will be :-)), you should make the setting permanent by entering MKL_DEBUG_CPU_TYPE=5 into the System Environment Variables. This has several advantages, one of them being that it applies to all instances of Matlab and not just the one opened using the .bat file.
You can do this either by editing the Environmental Variables as shown above, or by opening a command prompt (CMD) with admin rights and typing in:
setx /M MKL_DEBUG_CPU_TYPE 5
Doing this will make the change permanent and available to ALL Programs using the MKL on your system until you delete the entry again from the variables.
LINUX: (Thanks to foreignrobot)
Simply type in a terminal:
export MKL_DEBUG_CPU_TYPE=5
and then run matlab from the same terminal.
For benchmarking, you can use this script:
Permanent solution for Linux:
echo 'export MKL_DEBUG_CPU_TYPE=5' >> ~/.profile
will apply the setting profile-wide, so you can launch it either through a terminal or the graphical launcher.
  8 comentarios
Carlo Monjaraz
Carlo Monjaraz el 26 de En. de 2021
Nice to see @Ned Flanders @Yair Altman in the same post. FYI: https://danieldk.eu/Posts/2020-08-31-MKL-Zen.html best greetings.

Iniciar sesión para comentar.

Más respuestas (3)

Jan
Jan el 21 de Mzo. de 2017
Editada: Jan el 23 de Nov. de 2019
It depends if the used libraries call FMA3 commands. If so, the Ryzen crashes very fast.
The performance will depend on your programs. If writing to the disk is the bottleneck, the processor will not matter. If your code is parallelized, the number of cores rule. If memory is the limitation, buying a cheaper processor can mean, that you install more RAM. Then benchmarks of Matlab have a limited power only. Therefore I do not think that there is a general answer except for: The Ryzen is good!
As usual I mention, that you only have to wait some years to get a processor with the double performance, but writing efficient code can accelerate a program by a factor of 100 easily.

Robert Lee
Robert Lee el 10 de Mayo de 2017
Ryzen 1700 owner here, can't bench atm but I can update this later if you want one.
Ryzen is only worth it if you want to do parallel pool stuff (multi threaded), otherwise you may aswell get yourself a top end i3.
If you are wanting to do parallel pool stuff I'd be wary, I've had a lot of crashes doing parallel pool simulations with Ryzen that aren't occurring with intel CPUs - can't say with any certainty that Ryzen is to blame though.
  2 comentarios
Mickaël Tits
Mickaël Tits el 22 de Ag. de 2017
Hello, I am thinking about buying a Ryzen 7 (1700, 1700x or 1800x). I wonder if you have some news about its use with Matlab ? Does it still crashes ? Did you do a benchmark ?
Georgi rozenman
Georgi rozenman el 2 de Jul. de 2018
Editada: Walter Roberson el 16 de Sept. de 2020
All Ryzen 7 Cpus have weak 8 cores. If you'll be using MATLAB with general routines, without parallel pool, you'll be getting a worse performance than a slow core i3 since 1 core of Ryzen 7 is a lot weaker than 1 intel core.
Ryzen 7 performs well only when all 8 cores are used, therefore, it is very bad for MATLAB and any single core software.

Iniciar sesión para comentar.


Ned Flanders
Ned Flanders el 21 de Nov. de 2019
This here is a pretty good and detailed article!

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by