Skip to content

SIMD: unify SIMD kernel selection across NumPy and OpenBLAS/MKL #30172

@mattip

Description

@mattip

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions