Skip to content

Commit

Permalink
BUILD: Remove Accelerate support (numpy#15759)
Browse files Browse the repository at this point in the history
Remove support for Apple Accelerate, since it is buggy. A build error should
occur on most or all setups if linked against Accelerate. Test or import failures
should occur on setups where Accelerate is picked up dynamically.

Co-authored-by: Warren Weckesser <[email protected]>
  • Loading branch information
mattip and WarrenWeckesser authored May 22, 2020
1 parent dabf31c commit 78593a1
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 374 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
- BLAS=None
- LAPACK=None
- ATLAS=None
- NPY_BLAS_ORDER=mkl,blis,openblas,atlas,accelerate,blas
- NPY_LAPACK_ORDER=MKL,OPENBLAS,ATLAS,ACCELERATE,LAPACK
- NPY_BLAS_ORDER=mkl,blis,openblas,atlas,blas
- NPY_LAPACK_ORDER=MKL,OPENBLAS,ATLAS,LAPACK
- USE_ASV=1

- python: 3.7
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ include numpy/__init__.pxd
# Note that sub-directories that don't have __init__ are apparently not
# included by 'recursive-include', so list those separately
recursive-include numpy *
recursive-include numpy/_build_utils *
recursive-include numpy/linalg/lapack_lite *
recursive-include tools *
# Add sdist files whose use depends on local configuration.
Expand Down
12 changes: 7 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ stages:
PYTHON_VERSION: '3.6'
NPY_USE_BLAS_ILP64: '1'
USE_OPENBLAS: '1'
USE_XCODE_10: '1'
Accelerate:
PYTHON_VERSION: '3.6'
USE_OPENBLAS: '0'
# Disable this job: the azure images do not create the problematic
# symlink from Accelerate to OpenBLAS. We still have the test
# at import to detect a buggy Accelerate, just cannot easily trigger
# it with azure.
# Accelerate:
# PYTHON_VERSION: '3.6'
# USE_OPENBLAS: '0'

steps:
# the @0 refers to the (major) version of the *task* on Microsoft's
Expand Down Expand Up @@ -145,7 +148,6 @@ stages:
BLAS: None
LAPACK: None
ATLAS: None
ACCELERATE: None
CC: /usr/bin/clang
condition: eq(variables['USE_OPENBLAS'], '1')
- script: python setup.py build -j 4 build_ext --inplace install
Expand Down
4 changes: 4 additions & 0 deletions doc/release/upcoming_changes/15759.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Remove the Accelerate library as a candidate LAPACK library
-----------------------------------------------------------
Apple no longer supports Accelerate. Remove it.

6 changes: 2 additions & 4 deletions doc/source/user/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ The default order for the libraries are:
2. BLIS
3. OpenBLAS
4. ATLAS
5. Accelerate (MacOS)
6. BLAS (NetLIB)
5. BLAS (NetLIB)

If you wish to build against OpenBLAS but you also have BLIS available one
may predefine the order of searching via the environment variable
Expand All @@ -146,8 +145,7 @@ The default order for the libraries are:
2. OpenBLAS
3. libFLAME
4. ATLAS
5. Accelerate (MacOS)
6. LAPACK (NetLIB)
5. LAPACK (NetLIB)


If you wish to build against OpenBLAS but you also have MKL available one
Expand Down
8 changes: 0 additions & 8 deletions numpy/_build_utils/README

This file was deleted.

Empty file removed numpy/_build_utils/__init__.py
Empty file.
26 changes: 0 additions & 26 deletions numpy/_build_utils/apple_accelerate.py

This file was deleted.

253 changes: 0 additions & 253 deletions numpy/_build_utils/src/apple_sgemv_fix.c

This file was deleted.

13 changes: 7 additions & 6 deletions numpy/core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
from numpy.distutils import log
from distutils.dep_util import newer
from distutils.sysconfig import get_config_var
from numpy._build_utils.apple_accelerate import (
uses_accelerate_framework, get_sgemv_fix
)
from numpy.compat import npy_load_module
from setup_common import * # noqa: F403

Expand Down Expand Up @@ -392,7 +389,13 @@ def visibility_define(config):

def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration, dot_join
from numpy.distutils.system_info import get_info
from numpy.distutils.system_info import (get_info, blas_opt_info,
lapack_opt_info)

# Accelerate is buggy, disallow it. See also numpy/linalg/setup.py
for opt_order in (blas_opt_info.blas_order, lapack_opt_info.lapack_order):
if 'accelerate' in opt_order:
opt_order.remove('accelerate')

config = Configuration('core', parent_package, top_path)
local_dir = config.local_path
Expand Down Expand Up @@ -762,8 +765,6 @@ def get_mathlib_info(*args):
common_src.extend([join('src', 'common', 'cblasfuncs.c'),
join('src', 'common', 'python_xerbla.c'),
])
if uses_accelerate_framework(blas_info):
common_src.extend(get_sgemv_fix())
else:
extra_info = {}

Expand Down
Loading

0 comments on commit 78593a1

Please sign in to comment.