dedalus icon indicating copy to clipboard operation
dedalus copied to clipboard

EVP errors on native-arm builds on apple silicon

Open kburns opened this issue 2 years ago • 8 comments

It looks like theres a variety of problems with both the dense and sparse eigenvalue solvers when using a native-arm build on apple silicon. For now I've changed the conda install scripts to build the stack for x86 on apple silicon by default. This comes at a 1.5-2x performance penalty, but seems much more robust for eigenvalue problems.

For dense problems, it seems like pinning libopenblas < 0.3.20 helps things, otherwise there are ggev errors. But for sparse problems, there are still ARPACK convergence errors for problems that work fine on x86.

kburns avatar May 28 '22 14:05 kburns

Still getting ggev errors with libopenblas 0.3.21.

kburns avatar Aug 15 '22 13:08 kburns

Opened an issue on the openblas repo: https://github.com/xianyi/OpenBLAS/issues/3735.

kburns avatar Aug 15 '22 15:08 kburns

Less expensive workaround should be to build OpenBLAS on M1 with TARGET=ARMV8

martin-frbg avatar Aug 15 '22 17:08 martin-frbg

The dense eigenvalue (ggev) errors are fixed with https://github.com/conda-forge/openblas-feedstock/pull/144 and https://github.com/conda-forge/openblas-feedstock/pull/145, so builds 1+ for libopenblas 0.3.21 from conda-forge should work. Sparse problems still persist.

kburns avatar Aug 22 '22 20:08 kburns

Sparse problems seem to be fixed with scipy 1.9.1, so native-arm conda builds now pass all tests and run the examples. They still don't have higher-precision support in numpy, though, so we should add tests that can explicitly tell when e.g. spherical harmonic polynomial construction is failing due to underflow issues with the envelopes.

kburns avatar Sep 16 '22 15:09 kburns

Is this fixed with the conda-forge packages for Dedalus3? (The documentation still says to install the x86_64 packages.)

BenWibking avatar Feb 01 '24 02:02 BenWibking

No, we still need to work around the lack of higher-precision support on apple silicon for spherical problems. But for Cartesian problems I expect everything to work fine. But that said, we haven't tested thoroughly on arm builds yet.

kburns avatar Feb 01 '24 14:02 kburns