Why matlab benchmark extreamly slow on AMD EPYC CPU

61 views (last 30 days)
Hello, I have a Rack server with AMD EPYC 75F2 (16core 3.5GHz) CPU + 512G 3200MHz ECCRAM + P620 GPU +windows server 2019, build for CPU based finiate elements simulation. After I recieved the mechine, I tried t = bench (on MATLAB 2020b) to see the performance of it, but result it really bad, it can't even fight $100 Ryzen 1700, but hardware check gives no hardware error, other softawre such as COMSOL also behaves bad, can someone help me with this? Thank you!
  3 Comments
Walter Roberson
Walter Roberson on 3 Jan 2021
It might be worth experimenting with the work-around at
R2020a and later are supposed to have the fix in place, but it is hypothetically possible that the fix does not properly detect your particular hardware.
Chengkuan Gao
Chengkuan Gao on 3 Jan 2021
Yeah I think that's possible, it may be fixed on AMD Ryzen, but still have some issue on EPYC, hope Mathwork or AMD can fix this problem...

Sign in to comment.

Answers (3)

Kevin
Kevin on 22 Jul 2021
Hopefully mathworks will actually fix this problem. It seems to be specifically localized to Linux based Epyc systems. If you utilize a Windows OS for your Epyc system on R2021A Update 3 or R2021B you will get the expected levels of performance out of your system.
It appears right now though, at least on CentOS 7.8 installs, Epyc CPUs have improperly defined vectorization characteristics. A given vectorized operation e.g.:
A = magic(20000);
[L,U,P] = lu(A);
May take 10x longer on the exact same AMD Epyc CPU on Linux compared to the same CPU running in Windows. Other functions with notable problems include isonormals, gradient, and bwareaopen to name a few. It appears to only run on a single thread in those sections of code rather than properly multithreading vectorized code operations.
  10 Comments
Robert
Robert on 20 Nov 2021
Thanks @Kevin, that is helpful.
From the comments, it seems the issue specific to Matlab is probably resolved, but there may be some CPU/OS/kernel issue associated with memory allocation and/or use under some circumstances (e.g. moderately high pre-existing memory usage). If I understand correctly, you think the issue affects both Zen2 and Zen3?
It is likely to be exasperating, but I suppose I have little recourse but to buy the system we want and then test our loads under different operating systems to see how it affects performance.
Kevin
Kevin on 21 Nov 2021
My sense is there’s no issue with the CPU at all; it’s purely down to the kernel/distro selection. I haven’t even been able to disprove whether this bug exists for Intel processors when similar memory utilization conditions exist. I would say just think about what sort of memory load you put on the system, and test how your MATLAB workloads coexist under different distros. My guess is if you use a bleeding edge kernel you’ll probably be better.

Sign in to comment.


gophi7
gophi7 on 3 Jan 2021
Edited: gophi7 on 3 Jan 2021
I am seeing the same issue with a rack EPYC cpu, and modifying maxNumCompThreads did not seem to help. Did you happen to learn what the issue is / if there is a workaround?
  9 Comments
Bernhard Wistawel
Bernhard Wistawel on 24 Feb 2021
Edited: Bernhard Wistawel on 24 Feb 2021
Ok, will check soon. But MathWorks should let us choose which BLAS we want to use. The AMD BLIS could be much faster.

Sign in to comment.


Robert
Robert on 9 Apr 2021
With the original poor performance for Ryzen, it was possible to set an environment variable that had the effect of forcing the Intel MKL to use AVX2, greatly improving performance. Have you tried if this also works for EPYC? Procedure is described half-way down this post.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!