Add Apple Accelerate as DeviceBLAS. #68
Open
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.
Hi RSTSR maintainers,
As discussed in RESTGroup/rstsr-ffi#10, I was interested in exploring whether the Apple Accelerate Framework could serve as a BLAS/LAPACK backend for RSTSR. After some experimentation, I was able to get it working by reusing parts of the existing
lapack-ffi,rstsr-openblas, andrstsr-blisimplementations. With this PR, macOS users can enable Accelerate support simply by addingfeatures = ["accelerate"]torstsrand includingrstsr-acceleratein theirCargo.toml—no custombuild.rsrequired.However, the current implementation still has a few limitations:
Threading support
Prior to macOS 15 (Sequoia), threading can only be controlled via environment variables, and explicit
set_num_threads-style APIs are only available starting in macOS 15. For now, all threading-related functions are stubbed out, soset_num_threadsis effectively a no-op.One failing LAPACK test
Running
results in a single test failure (output below). I'm not sure whether this is an Accelerate issue or something that requires adjustment on our side; possibly it should be reported to Apple.
No LAPACKE support
Accelerate does not provide LAPACKE bindings, so the corresponding Cargo feature has been removed.
I’m not expecting this PR to be merged immediately—feedback, suggestions, and improvements are all very welcome.
Looking forward to your thoughts!