Is 18GB of shared unified memory enough for MATLAB parfor?

20 次查看(过去 30 天)
I had a macbook air from 2013, very outdated. I ordered a few days ago a macbook pro with the M3 Pro SoC, which has 12 Cores (6 Performance Cores @3.7-4.0 GHz + 6 Efficiency Cores @2.4 GHz) on a die with 3nm technology, a unified RAM of 18GB (LPDDR5-6400) integrated on the CPU and shared with the 18 Cores GPU, memory bandwidth of 150 Gbps, and 1 TB SSD. The main use of this machine will be Matlab 2023b simulations using parfor. My thinking was let's start with 18GB of RAM to see if its enough and I will upgrade later on to the maximum supported RAM of 36GB, if required. But I just found out that such an upgrade is not possible, due to the RAM being integrated on the CPU/SoC, meaning that you have to opt from the beginning for either the 18GB or the 36GB version and you essentially stack with it for life....
Doing some online search after gaining that information, I found out that Mathworks recommends 4GB per worker and each worker corresponds to a physical CPU core. Now, assuming that the GPU will require, let' say, 2GB of RAM when using Matlab (and probably LaTeX, word, PDF, ppt, and a few tabs on the browser at the same time but nothing more, certainly not anything "graphics-intensive"), leaving 16GB of RAM for CPU, that means I will not utilize the full potential of the machine regarding parfor-based simulations due to the 16GB of RAM? In other words, my ignorance regarding the unavailability for RAM extension in the future did result in a wrong purchase for the intended purpose?
  2 个评论
John D'Errico
John D'Errico 2023-11-13
编辑:John D'Errico 2023-11-13
RAM is cheap. I'm sorry if you made the wrong choice. But yes, it would appear the system you chose will not perform to its full abilities.
Honestly, for large scale processing capabilities with multiple cores, trying to run them all flat out, I would not be looking at a laptop anyway, since laptops are typically fan limited. The problem being that if you want to run all cores flat out, then your system will generate too much heat to be properly dissipated. In turn, that will automatically slow down your system clock, to limit the amount of heat generated. Of course, you can purchase external fans that sit underneath your laptop. I have done that, and it did help to avoid frying a laptop in its own heat.
Yes, what you got is way better than what you had, but you might have chosen better, IF you really need that ultimate performance.
Konstantinos Ntougias
I changed my order to the maximum configuration with 36 GB RAM, thanks!

请先登录,再进行评论。

采纳的回答

Shreshth
Shreshth 2023-11-23
I understand that you want to know about whether the 18GB of RAM in your new MacBook Pro will be sufficient for running parallel MATLAB simulations using `parfor`. Let's break down the considerations:
1. MathWorks Recommendation: MathWorks recommends 4GB of RAM per worker. ( Product Requirements & Platform Availability for MATLAB Parallel Server - MATLAB (mathworks.com) )This is a general guideline and actual memory requirements can vary based on the specifics of your simulations. Some simulations might need more memory, while others might use less.
2. Physical Cores: The MacBook Pro you mentioned has 6 performance cores. If you were to follow MathWorks' recommendation strictly, ideally you would want 24GB of RAM to fully utilize all 6 performance cores in parallel computations (4GB per core).
3. Efficiency Cores: The efficiency cores are typically not as powerful as performance cores and are designed to handle background tasks and improve energy efficiency. It is not clear whether MATLAB will effectively utilize these cores for `parfor` loops, but if it does, you would theoretically need even more RAM to fully utilize them.
4. GPU: If your MATLAB simulations can take advantage of GPU computing, then some of the computational load will be offloaded to the GPU. However, the GPU will also need to share the unified memory, which could further constrain the available RAM for CPU tasks.
5. Other Applications: Running additional applications like LaTeX, Word, PDF, PowerPoint, and browser tabs will consume some amount of RAM, leaving less available for MATLAB.
Given these considerations, if your simulations are memory-intensive and require more than what is available per core, then you might indeed face limitations. However, it is also possible that your simulations will not require the full 4GB per worker or that not all cores will be used at maximum capacity simultaneously.
If you find that you are running into memory limitations, there are some strategies you could employ:
  1. Optimize Code: Ensure that your MATLAB code is optimized to use memory efficiently. This might involve vectorization, preallocating arrays, or using data types that require less memory.
  2. Scale Down: Use fewer workers in your `parfor` loops to match the available memory. This means not all cores will be used, but it can prevent out-of-memory errors
  3. External Memory: MATLAB allows you to work with data that doesn't fit into memory using techniques like `tall` arrays or datastores, which can process data in chunks
  4. Cloud or Server: Consider running your simulations on a cloud service or a server with more RAM if your local resources are insufficient.
In summary, while you may not be able to fully utilize all 6 performance cores for memory-intensive parallel tasks, this doesn't necessarily mean your purchase was wrong. It depends on the specifics of your workload. If your simulations are not as memory-intensive as the guideline suggests, you may still be able to run effective parallel simulations. If memory does become a bottleneck, you can explore the strategies mentioned above to mitigate the issue.
Thank you,
Shubham Shreshth.
  3 个评论
Walter Roberson
Walter Roberson 2024-10-31
If your MATLAB simulations can take advantage of GPU computing, then some of the computational load will be offloaded to the GPU
GPU have not been supported on Mac for a number of releases now. Last I heard, there were no plans to support GPU on Mac.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Big Data Processing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by