{"id":1295,"date":"2023-06-22T14:58:05","date_gmt":"2023-06-22T18:58:05","guid":{"rendered":"https:\/\/blogs.mathworks.com\/matlab\/?p=1295"},"modified":"2024-01-24T09:05:58","modified_gmt":"2024-01-24T14:05:58","slug":"native-apple-silicon-support-in-the-matlab-simulink-r2023b-pre-release","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/matlab\/2023\/06\/22\/native-apple-silicon-support-in-the-matlab-simulink-r2023b-pre-release\/","title":{"rendered":"Native Apple Silicon Support in the MATLAB\/Simulink R2023b pre-release"},"content":{"rendered":"<div class=\"rtcContent\">\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I\u2019ve been following MathWorks\u2019 Apple Silicon developments for some time now. Indeed, my first post on the subject <a href=\"https:\/\/blogs.mathworks.com\/matlab\/2022\/05\/05\/exploring-the-matlab-beta-for-native-apple-silicon\/\"><span style=\"text-decoration: underline;\">Exploring the MATLAB beta for Native Apple Silicon<\/span><\/a> was the 2nd article I ever wrote for this blog. Back then, only MATLAB itself was supported for R2022a.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">A few months later, and I published <a href=\"https:\/\/blogs.mathworks.com\/matlab\/2022\/12\/08\/playing-with-the-r2022b-matlab-apple-silicon-beta-for-m1-m2-mac\/\"><span style=\"text-decoration: underline;\">playing with the R2022b MATLAB Apple Silicon beta for M1\/M2 Mac<\/span><\/a>. 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.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">All of MATLAB, Simulink and 100+ products on Apple Silicon<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">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 <a href=\"https:\/\/www.mathworks.com\/products\/new_products\/pr-faq.html\"><span style=\"text-decoration: underline;\">pre-release<\/span><\/a> 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.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Full details about what\u2019s supported can be found at <a href=\"https:\/\/www.mathworks.com\/support\/requirements\/apple-silicon.html\"><span style=\"text-decoration: underline;\">https:\/\/www.mathworks.com\/support\/requirements\/apple-silicon.html<\/span><\/a><\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Don\u2019t use the new MATLAB Desktop beta with this pre-release (Yet!)<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Back in March, I told you about the <a href=\"https:\/\/blogs.mathworks.com\/matlab\/2023\/03\/17\/try-dark-mode-on-desktop-matlab-with-the-new-desktop-for-matlab\/\"><span style=\"text-decoration: underline;\">new Desktop for MATLAB<\/span><\/a> 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\u2019t try to install it!<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">As such, for Apple machines, we\u2019ve 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.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">If you are reading this having installed it and are wondering how to fix the situation, we have a work-around here <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/answers\/1986689-why-doesn-t-matlab-launch-after-enabling-new-desktop-mode-on-mac-using-the-r2023b-prerelease\"><span style=\"text-decoration: underline;\">Why doesn't MATLAB launch after enabling new desktop mode on Mac using the R2023b prerelease? - MATLAB Answers - MATLAB Central (mathworks.com)<\/span><\/a><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Rest assured, we are working on this.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Speed<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">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 <a href=\"https:\/\/support.apple.com\/en-gb\/HT211861\"><span style=\"text-decoration: underline;\">via Rosetta<\/span><\/a>. Let us know how things look for your workflow.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">The results below are from a 2020 MacBook Pro with an M1 processor<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><img decoding=\"async\" loading=\"lazy\" class=\"imageNode\" style=\"vertical-align: baseline; width: 726px; height: 569px;\" src=\"http:\/\/blogs.mathworks.com\/matlab\/files\/2023\/06\/AppleSilicon3_1.png\" alt=\"\" width=\"726\" height=\"569\" \/><\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Linear algebra<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">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 <a href=\"https:\/\/netlib.org\/lapack\/lug\/node11.html\"><span style=\"text-decoration: underline;\">BLAS and LAPACK libraries<\/span><\/a>. 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 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Math_Kernel_Library\"><span style=\"text-decoration: underline;\">Intel Math Kernel Library (MKL)<\/span><\/a> 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.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">More recently, we offered the possibility for users to <a href=\"https:\/\/blogs.mathworks.com\/matlab\/2022\/07\/13\/linear-algebra-in-matlab-trying-out-amds-aocl\/\"><span style=\"text-decoration: underline;\">switch to using AMD\u2019s implementation of BLAS and LAPACK: The AMD Optimizing CPU Libraries (AOCL)<\/span><\/a> which can have benefits on AMD hardware.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Both AMD\u2019s AOCL and Intel\u2019s 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 <a href=\"https:\/\/blogs.mathworks.com\/matlab\/2022\/12\/08\/playing-with-the-r2022b-matlab-apple-silicon-beta-for-m1-m2-mac\/\"><span style=\"text-decoration: underline;\">https:\/\/blogs.mathworks.com\/matlab\/2022\/12\/08\/playing-with-the-r2022b-matlab-apple-silicon-beta-for-m1-m2-mac\/<\/span><\/a>. I\u2019ll 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.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">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.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Fortran MEX support<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">One of the questions I received during discussions about the previous betas was \u2018Will there be Fortran Mex support?\u2019 Of course, the answer is \u2018yes\u2019 and it is provided via the <a href=\"https:\/\/www.nag.com\/content\/nag-fortran-compiler\"><span style=\"text-decoration: underline;\">NAG Fortran Compiler<\/span><\/a>. 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\u2019 decision to use it though!).<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Back then, it fascinated me how much <a href=\"https:\/\/walkingrandomly.com\/?p=6696\"><span style=\"text-decoration: underline;\">many of us rely on this venerable language<\/span><\/a>, even when we are not aware of it, and MATLAB is no exception.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">No Apple GPU Support for compute<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">Ever since MathWorks started providing GPU Compute support (e.g. in <a href=\"https:\/\/www.mathworks.com\/products\/parallel-computing.html\"><span style=\"text-decoration: underline;\">Parallel Computing Toolbox<\/span><\/a> and <a href=\"https:\/\/www.mathworks.com\/products\/gpu-coder.html\"><span style=\"text-decoration: underline;\">GPU Coder<\/span><\/a>), 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.<\/div>\r\n<h2 style=\"margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;\">Over to you<\/h2>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">I hope you have fun with the new Apple Silicon version of MATLAB and Simulink. It\u2019s the culmination of a huge amount of work by a lot of people and we are proud of it. I\u2019m interested in learning about your thoughts and discoveries\u2026particularly since I haven\u2019t been able to try this out myself yet! I\u2019m currently awaiting delivery of my new M2 MacBook and am excited to be able to use MATLAB natively on this platform.<\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\">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 <a href=\"https:\/\/www.mathworks.com\/support\/contact_us.html\"><span style=\"text-decoration: underline;\">https:\/\/www.mathworks.com\/support\/contact_us.html<\/span><\/a><\/div>\r\n<div style=\"margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: pre-wrap; color: #212121; font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: 400; text-align: left;\"><\/div>\r\n<\/div>\r\n<script type=\"text\/javascript\">var css = ''; var head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); head.appendChild(style); style.type = 'text\/css'; if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); }<\/script>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img src=\"https:\/\/blogs.mathworks.com\/matlab\/files\/2023\/06\/AppleSilicon3_1.png\" class=\"img-responsive attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"\" decoding=\"async\" loading=\"lazy\" \/><\/div><p>\r\nI\u2019ve been following MathWorks\u2019 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... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/matlab\/2023\/06\/22\/native-apple-silicon-support-in-the-matlab-simulink-r2023b-pre-release\/\">read more >><\/a><\/p>","protected":false},"author":176,"featured_media":1289,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11,80,20],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts\/1295"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/users\/176"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/comments?post=1295"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts\/1295\/revisions"}],"predecessor-version":[{"id":1319,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/posts\/1295\/revisions\/1319"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/media\/1289"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/media?parent=1295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/categories?post=1295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/matlab\/wp-json\/wp\/v2\/tags?post=1295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}