Skip to content

Use Apple Accelerate instead of OpenBLAS on Sonoma and later #181251

@vlebert

Description

@vlebert

brew gist-logs <formula> link OR brew config AND brew doctor output

❯ brew config
HOMEBREW_VERSION: 4.3.15
ORIGIN: https://github.com/Homebrew/brew
HEAD: fa53e7b1e51a2deb7ec5a1e12452a1182dc342f7
Last commit: 3 days ago
Core tap JSON: 15 Aug 08:25 UTC
Core cask tap JSON: 15 Aug 08:25 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 3.3.4 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/bin/ruby
CPU: 10-core 64-bit arm_firestorm_icestorm
Clang: 15.0.0 build 1500
Git: 2.39.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
CLT: 15.3.0.0.1.1708646388
Xcode: N/A
Rosetta 2: false

❯ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  openssl@1.1

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

Initially I used miniconda for python on my Mac M1 but now, python provided by brew is compatible with Apple Silicon.

I am trying to use homebrew python on my mac

What happened (include all command output)?

Numpy is installed as a dependency for different packages on my system, however provided installation is not optimized for apple silicon.

see numpy/numpy#24961

On my machine :

> python3
> import numpy
> numpy.show_config()

...
"Build Dependencies": {
    "blas": {
      "name": "openblas",
      "found": true,
      "version": "0.3.27",
      "detection method": "system",
      "include directory": "unknown",
      "lib directory": "unknown",
      "openblas configuration": "unknown",
      "pc file directory": "unknown"
    },

...
> python3 -m venv .env
> source .env/bin/activate
> pip install numpy
> python
> import numpy
> numpy.show_config()

...
"Build Dependencies": {
    "blas": {
      "name": "accelerate",
      "found": true,
      "version": "unknown",
      "detection method": "system",
      "include directory": "unknown",
      "lib directory": "unknown",
      "openblas configuration": "unknown",
      "pc file directory": "unknown"
    },
...

Running performance test is up to 10 time more efficient in my .env than in my system. I suppose this can slow up all packages depending on system numpy

What did you expect to happen?

Numpy provided by brew should be compiled with Apple Silicon optimizations.

Step-by-step reproduction instructions (by running brew commands)

See previous section

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureshelp wantedTask(s) needing PRs from the community or maintainers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions