Native Apple Silicon Support in the MATLAB/Simulink R2023b pre-release
I’ve been following MathWorks’ Apple Silicon developments for some time now. Indeed, my first post on the subject Exploring the MATLAB beta for Native Apple Silicon was the 2nd article I ever wrote for this blog. Back then, only MATLAB itself was supported for R2022a.
A few months later, and I published playing with the R2022b MATLAB Apple Silicon beta for M1/M2 Mac. The linear algebra core had been tuned up quite a bit and now we also had support for MATLAB, Simulink and 14 additional products such as Image Processing Toolbox, Deep Learning Toolbox and more.
All of MATLAB, Simulink and 100+ products on Apple Silicon
The popularity of these posts has been testament to how much you all wanted this and so it gives me great pleasure to announce that on Wednesday 14th June 2023, the MATLAB R2023b pre-release was made available which includes support for Apple Silicon. This includes MATLAB, Simulink and almost all products and support packages that are already supported on Mac.
Full details about what’s supported can be found at https://www.mathworks.com/support/requirements/apple-silicon.html
Don’t use the new MATLAB Desktop beta with this pre-release (Yet!)
Back in March, I told you about the new Desktop for MATLAB and many of you downloaded, tried it out and enjoyed it. Unfortunately, right now, this does not work with the pre-release on Mac. If you try to install it, MATLAB R2023b will no longer start. So don’t try to install it!
As such, for Apple machines, we’ve disabled it for now from the Add-ons menu in the MATLAB Desktop so its more difficult to install by accident but you could still go to File Exchange and do it from there.
If you are reading this having installed it and are wondering how to fix the situation, we have a work-around here Why doesn't MATLAB launch after enabling new desktop mode on Mac using the R2023b prerelease? - MATLAB Answers - MATLAB Central (mathworks.com)
Rest assured, we are working on this.
Speed
The start-up time of MATLAB on Apple Silicon is pretty fast, typically around 3-4 seconds, according to my source. We are also very happy with the speed of ODEs which are among the fastest on any processor according to bench. Looking at the other results of bench, we can see that everything is faster when run natively compared to running the Intel-Mac version of MATLAB via Rosetta. Let us know how things look for your workflow.
The results below are from a 2020 MacBook Pro with an M1 processor
Linear algebra
In my previous Apple Silicon blog posts, I focused on Linear Algebra support. In particular, the work we have been doing behind the scenes with respect to BLAS and LAPACK libraries. These are the fundamental linear algebra libraries underlying a huge amount of modern scientific computing of which MATLAB is no exception. For many years, the implementation of BLAS and LAPACK used by MATLAB has been the Intel Math Kernel Library (MKL) which is highly tuned by Intel for use on Intel and AMD Hardware. Fast linear algebra critically depends on fast implementations of BLAS and LAPACK.
More recently, we offered the possibility for users to switch to using AMD’s implementation of BLAS and LAPACK: The AMD Optimizing CPU Libraries (AOCL) which can have benefits on AMD hardware.
Both AMD’s AOCL and Intel’s MKL are not native Apple Silicon libraries. As such, it stands to reason that we would be looking closely at the best BLAS and LAPACK options for use on Apple Silicon. Some of this work is described at https://blogs.mathworks.com/matlab/2022/12/08/playing-with-the-r2022b-matlab-apple-silicon-beta-for-m1-m2-mac/. I’ll not repeat it all here because that article also describes the current state of play since no additional linear algebra optimizations made it into this release.
Thanks to this work, a lot of linear algebra on Apple Silicon is already pretty fast and this is nicely demonstrated by the LU factorization result above. However, we are not finished yet and you can expect further linear algebra optimizations in future releases.
Fortran MEX support
One of the questions I received during discussions about the previous betas was ‘Will there be Fortran Mex support?’ Of course, the answer is ‘yes’ and it is provided via the NAG Fortran Compiler. This is of personal interest to me because I used to work for NAG and was there when they announced Apple Silicon Support for their compiler (No connection to MathWorks’ decision to use it though!).
Back then, it fascinated me how much many of us rely on this venerable language, even when we are not aware of it, and MATLAB is no exception.
No Apple GPU Support for compute
Ever since MathWorks started providing GPU Compute support (e.g. in Parallel Computing Toolbox and GPU Coder), it has been for NVIDIA hardware and this has not changed here. There is no support for using the Apple Silicon GPU or Neural Engine for compute.
Over to you
I hope you have fun with the new Apple Silicon version of MATLAB and Simulink. It’s the culmination of a huge amount of work by a lot of people and we are proud of it. I’m interested in learning about your thoughts and discoveries…particularly since I haven’t been able to try this out myself yet! I’m currently awaiting delivery of my new M2 MacBook and am excited to be able to use MATLAB natively on this platform.
We appreciate any feedback you can give us on the R2023b prerelease to help ensure that our full R2023b release planned for this September comes off without a hitch. If you have any issues (or maybe just praise!) please contact MathWorks at https://www.mathworks.com/support/contact_us.html
评论
要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。