Best hardware configuration for MATLAB

Hi there!
I'm working for a tech company. We are building high performace workstations. Lots of CPU cores, RAM, GPUs.
Some of our clients want to know if our WS's are good for MATLAB. We are intersted in building balanced rigs.
So could you tell me how the software scales with cores, gpu power etc? What are the common bottlenecks? Are there any limitations when addional compute power won't add up?

 Accepted Answer

Rik
Rik on 17 Aug 2022
The questions on this forum are mostly answered by volunteers. If you want an official answer you should contact support.
Apart from the guidance you might glean from the system requirements, there is little to go on. In my experience the performance depends so highly on the workload, that the question does not make much sense. However, I will make an attempt.
GPUs are only used in some workflows (and require specific toolboxes), so they tend to matter little for performance.
Since most of Matlab is singlethreaded, the singlethreaded performance is the most important factor of a CPU. Intel or AMD doesn't matter much for recent releases, but some older releases had bugs with some mathematical instruction set. Note that some functions are multithreaded. One example I noticed is conv (and convn).
RAM only matters as much as you work with large arrays. Matlab is not a web browser, so it needs memory itself as well. More is better, but if you only work with small arrays, benefits drop off fast.

5 Comments

Is it entirely true to say that 'most' of MATLAB is single threaded? I think it depends what you're doing. All core Mathematics including the BLAS and LAPACK are vectorized and multithreaded, for instance, wherever it makes sense.
How many cores can these tasks utilize? Is it limited by the software's engune? Is there a chart of some sort to tell wich task benefits from core count or single thread performance or GPU acceleration?
Convolutions will run on all 6 hyperthreaded cores on my computer, so I think you can assume the core mathematical functions will take advantage of the full computational power.
My remark that 'most' of Matlab would be singlethreaded is indeed exagerated. The computational flow is singlethreaded (unless explicit parallel computing is used), but some functions will take advantage of more power.
I don't think you will be getting an exact chart. I don't even think there is a single list of all Matlab functions anymore (I believe they stopped compiling that list a few years ago), so a complete list of presumed performance bottle necks is probably also not readilly available.
For your stated purpose ('building balanced machines') I think this should be enough information. Unless your clients are planning to use GPU compute, Matlab will not really need it, and an otherwise balanced workstation will be the best choice. Just like with all other things you might plan on doing with a computer: specifics matter.
Most multithreaded MATLAB functions use a scheduling system which is going to do its best to make use of available compute without causing memory issues or other queue related problems. This usually works pretty well. Many algorithms are just fundamentally not parallelizable of course. A good rule of thumb is that if your MATLAB code is highly vectorized it will likely be well parallelized. Don't know whether that helps at all...
Thank you! You were really helpful.

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 17 Aug 2022

Commented:

on 22 Aug 2022

Community Treasure Hunt

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

Start Hunting!