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

ENH: Vectorizing umath module using AVX-512 (open sourced from Intel Short Vector Math Library, SVML) #19478

Merged
merged 17 commits into from Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .circleci/config.yml
Expand Up @@ -19,6 +19,12 @@ jobs:
command: |
if [[ -v CI_PULL_REQUEST ]] ; then git pull --ff-only origin "refs/pull/${CI_PULL_REQUEST//*pull\//}/merge" ; fi

- run:
name: update submodules
command: |
git submodule init
git submodule update

- run:
name: create virtual environment, install dependencies
command: |
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Expand Up @@ -11,6 +11,7 @@ numpy/linalg/lapack_lite/f2c.c linguist-vendored
numpy/linalg/lapack_lite/f2c.h linguist-vendored
tools/npy_tempita/* linguist-vendored
numpy/core/include/numpy/libdivide/* linguist-vendored
numpy/core/src/umath/svml/* linguist-vendored

# Mark some files as generated
numpy/linalg/lapack_lite/f2c_*.c linguist-generated
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
@@ -1,3 +1,6 @@
[submodule "doc/source/_static/scipy-mathjax"]
path = doc/source/_static/scipy-mathjax
url = https://github.com/scipy/scipy-mathjax.git
[submodule "numpy/core/src/umath/svml"]
path = numpy/core/src/umath/svml
url = https://github.com/numpy/SVML.git
9 changes: 9 additions & 0 deletions azure-pipelines.yml
Expand Up @@ -23,6 +23,9 @@ stages:
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
git submodule update --init
displayName: 'Fetch submodules'
- script: |
if ! `gcc 2>/dev/null`; then
sudo apt install gcc
Expand Down Expand Up @@ -71,6 +74,9 @@ stages:
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
git submodule update --init
displayName: 'Fetch submodules'
- script: |
docker run -v $(pwd):/numpy -e CFLAGS="-msse2 -std=c99 -UNDEBUG" \
-e F77=gfortran-5 -e F90=gfortran-5 quay.io/pypa/manylinux2014_i686 \
Expand Down Expand Up @@ -258,6 +264,9 @@ stages:
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
git submodule update --init
displayName: 'Fetch submodules'
- script: |
# create and activate conda environment
conda env create -f environment.yml
Expand Down
11 changes: 11 additions & 0 deletions doc/release/upcoming_changes/19478.performance.rst
@@ -0,0 +1,11 @@
Vectorize umath module using AVX-512
-------------------------------------

By leveraging Intel Short Vector Math Library (SVML), 18 umath functions
(``exp2``, ``log2``, ``log10``, ``expm1``, ``log1p``, ``cbrt``, ``sin``,
``cos``, ``tan``, ``arcsin``, ``arccos``, ``arctan``, ``sinh``, ``cosh``,
``tanh``, ``arcsinh``, ``arccosh``, ``arctanh``) are vectorized using AVX-512
instruction set for both single and double precision implementations. This
change is currently enabled only for Linux users and on processors with
AVX-512 instruction set. It provides an average speed up of 32x and 14x for
single and double precision functions respectively.