STAN (pySTAN) on upcoming Apple Silicon

Apologies if this has been asked before.

It seems like Apple will be introducing the first computers (likely MacBooks and MacBookPros) based on their proprietary “Apple Silicon” chips by the end of this year. I’m contemplating an upgrade and need to decide whether to go with the last gasp of Intel based hardware (available now) or wait for the bleeding edge of Apple Silicon later this year (with all the risks that entails).

Is anyone able to speak to whether STAN (pySTAN, cmdSTAN, etc) are expected to work straight away on the new chips using Apple’s on-the-fly instruction translation (Rosetta 2)? If so, any sense of how the performance of that would likely compare with the same quality of hardware without the translator sitting in between? And looking toward the future, is there a sense of how long it would take for the new hardware to be supported natively both in terms of leveraging the CPU itself and leveraging whatever Apple is calling their new integrated CPU/GPU horsepower?


1 Like

Their new chips are ARM I believe; so long as they stick to the ARM standards, I don’t think compilation should be an issue. I assume that if Stan can currently work on ARM, then it should work on the new apple arm chips, pending any extensions they may add to it.

No idea about GPU support on those though. Apple does not seem particularly invested in GPU compute, given that they dropped CL, don’t care about Vulkan, etc.

I’m sure something will go wrong, but it is presumably something that can be fixed. The fact that CRAN is now using the Xcode toolchain on Macs rather than the open-source LLVM toolchain should mitigate some of scope for problems, presuming new Macs are shipped with an XCode that works with the ARM hardware.


it will be supported right away natively if you use cmdstan which will compile Stan models using the system provided compiler.

It’s just that the GPU support of Stan will most likely not work as OpenCL support does not look like to be in place.

Anyway it will be a mess with CRAN or any other binary distribution…

How fast is CRAN typically with adding builders for new architectures? I guess there is no precedent, apart from some ARM notebooks, so probably difficult to guess.

Until then mac ARM users will probably have to install from source? Or maybe R will run Rosetta which will be a bit slower.

Yep. No GPU support on Apple, apart from their own compute language. Google is still actively working on a project that does enable running OpenCL on top of Vulkan. But that is still not production-ready.

The other thing to note is that ARM CPUs should come with more cores than x86 CPUs, which means parallelization will become more important if this trend continues.

It would be funny… but the Intel TBB may actually be a perfect fit for running on Apple Silicon if that‘s an ARM based processor with many cores…


I have no idea about the particulars, but upgrading to bleeding edge hardware or software is always risky for both speed and compatibility. You won’t be sure about any of the questions you’re asking until the thing’s out and someone tries to use it. It might be possible to get involved in developer betas, etc. and figure this out now.

I personally just got an 8-core Macbook Pro and iMac Pro with Intel chips. I hate dealing with hardware and software compatibility myself.

When the new hardware’s compatible and notably faster (say a factor of at least 1.5 everywhere), I’ll be more than happy to upgrade, even if that’s in 3 months. But then I come from a time when we upgraded our computers frequently because they doubled in speed every 1.5 years or so.