Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use -framework Accelerate on OS X. #3308

Merged
merged 1 commit into from Nov 14, 2022
Merged

Conversation

rcurtin
Copy link
Member

@rcurtin rcurtin commented Nov 11, 2022

This patch modifies CMake to link against the Accelerate framework on OS X, using -framework Accelerate. This is a port of what Armadillo's CMake configuration already does.

The Accelerate framework is Apple's BLAS/LAPACK replacement; if it's available, Armadillo will use it, and with this patch, mlpack will use it too.

@conradsnicta
Copy link
Contributor

Good idea for several reasons. While OpenBLAS is often assumed to be faster on deprecated x86-64 macs, the situation doesn't appear to be the same on newer macs with M1 and M2 CPUs.

Apparently the new M apple processors have hidden functionality to accelerate matrix multiplication, which is likely used by veclib (part of the Accelerate framework?). The OpenBLAS project is (so far) not willing to use processor instructions that are not officially documented: OpenMathLib/OpenBLAS#3789

Copy link

@mlpack-bot mlpack-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second approval provided automatically after 24 hours. 👍

@rcurtin rcurtin merged commit 7c237e2 into mlpack:master Nov 14, 2022
@rcurtin rcurtin deleted the osx-accelerate branch November 14, 2022 15:34
@rcurtin rcurtin mentioned this pull request Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants