-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Description
It might make sense to unify the selection of SIMD kernels used in both ufuncs (via our dispatching) and linalg (by third-party BLAS implementations). We use runtime settings of NPY_DISABLE_CPU_FEATURES and NPY_ENABLE_CPU_FEATURES, OpenBLAS uses OPENBLAS_CORETYPE, I don't see how MKL lets users control the kernels used.
The use of environment variables makes sense since NumPy's dispatch is fixed at import time: function slots are set up to point to the appropriate kernels. So this could not be done via a context manager around the ufunc/linalg function call. But we could try to translate the feature use to OpenBLAS coretype before importing scipy_openblas at startup, or (going the other direction), layer OPENBLAS_CORETYPE on top of the NumPy feature selection logic.