Repository navigation
fix: use OpenBLAS instead of Accelerate on macOS - #1193
Merged
Merged
Conversation
Apple's Accelerate LAPACK is not thread-safe: concurrent dgeev calls silently corrupt the returned eigenvectors while the eigenvalues stay exact. VDISORT diagonalizes one operator per frequency inside an OpenMP loop, so the pyarts test vdisort-workspace.rt3 failed intermittently. Have FindBLAS/FindLAPACK pick the environment's plain libblas/liblapack (OpenBLAS in the conda environments) on macOS via BLA_VENDOR=Generic; an explicit -DBLA_VENDOR still wins. Add the openblas openmp variant to the macOS dev environment, mirroring the Linux environment files.
Member
Author
|
@riclarsson I'm wondering, did you also see the high failure rate on |
Contributor
|
@olemke I have never had a test fail locally. But this is all using a lot of lapack and a lot of that is really processor dependent. My processors are just some intel card, an amd card, and a M3 Ultra (or whatever it is called, maybe max?). So just standard AMD64 and standard Mac. Edit: though I have not tested OpenBLAS on mac. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Apple's Accelerate BLAS/LAPACK is not thread-safe: concurrent
dgeevcalls silently corrupt the returned eigenvectors while the eigenvalues stay exact. VDISORT diagonalizes one transport operator per frequency inside an OpenMP loop, sopyarts.arts.tests.core.disort.vdisort-workspace.rt3failed intermittently and any parallel use of the LAPACK diagonalization was affected. This PR makes macOS builds select the environment's OpenBLAS instead of Accelerate and pins OpenBLAS in the macOS dev environment, mirroring the Linux environment files.Changes
CMakeLists.txt: setsBLA_VENDOR=Genericbeforefind_package(LAPACK REQUIRED)when building on macOS, soFindBLAS/FindLAPACKpick the environment's plainlibblas/liblapack(OpenBLAS in the conda environments) instead of Accelerate; an explicit-DBLA_VENDOR=...is still honored.environment-dev-mac.yml: adds theopenblas=*=*openmp*dependency so macOS dev environments always provide OpenBLAS, consistent with the Linux dev environment files.Breaking Changes
libblas/liblapack(such as the OpenBLAS the conda environments install); configuration fails if neither is found. Existing macOS environments needmamba env update -f environment-dev-mac.yml, or pass-DBLA_VENDOR=Appleto keep using Accelerate.