Leserartikel AMD Ryzen 1700 Matlab parfor(ode45) benchmark

confused

Lt. Junior Grade
Registriert
Apr. 2010
Beiträge
324
Since i couldn't find any meaningfull benchmarks for my Matlab application, and i finally got hands on an Ryzen 1700, i decided to make some myself. I wanted to know if Matlab can make use of all the virtual cores and how much the workflow can be improved with this cpu.

The task is solving with parfor parallelized sets of coupled differential equations. The parfor loop is 50 long. Each of the 50 parfor sections has to solve a set of coupled differential equations 50 times. The solver is ode45.

Parfor is a command that, compared to a normal for-loop, isn't working through all iterations one after the other in numerical order, but it spreads the single iterations of the loop to all selected workers, so each can calculate for himself.

In matlab one can choose on how many workers (cores) the tasks are to be spread. I selected different numbers x of workers with parpool(x) and let the same skript run. The time needed to finish all calculations is shown depending on the numbers of workers.

Machine with Ryzen:
Matlab R2017a
Windows 10 64bit
16GByte DDR4 2133MHz

Machine with i5:
Matlab R2016b
Windows 7 64bit
8GByte DDR3 1066MHz


As comparison i let the same script run on a i5 4570.

A first positive surprise: It's possible for matlab to select up to 16 workers. Thats as far as i know not possible for the virtual cores in Intel CPU's. I could tink thats because Ryzen uses 2 floatpoint-units per core.

Results for my little benchmark:

Ryzen 1700:
Workers: 4
Time: 512s

Workers: 8
Time: 283.4s

Workers: 12
Time: 265.8s

Workers: 16
Time: 250.6s

i5 4570
Workers: 4
Time 692.4s

As one can see, the biggest impact does make going from 4 to 8 workers. But going from 8 workers to 16 is improving calculation time only by 13%.

So in total the calculationtime can, in this scenario, compared to the i5 4570 be improved by a factor of 2.7.

There have been other configurations of the benchmark script i wrote in which the performance improfed by up to a factor of 3.3.


Grettings,

confused
 
Zuletzt bearbeitet: (Systeminfos)
Can you attach the benchmark?
Which Matlab version did you use?
Which OS did you use?
 
Zurück
Oben