Skip to content

update mkl_umath to align it with numpy-2.* #65

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/build-with-clang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build project with IntelLLVM clang compiler

on:
pull_request:
push:
branches: [master]

permissions: read-all

jobs:
build-with-clang:
runs-on: ubuntu-latest

strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
numpy_version: ["numpy'<2'", "numpy'>=2'"]

env:
ONEAPI_ROOT: /opt/intel/oneapi

defaults:
run:
shell: bash -el {0}

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Add Intel repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update

- name: Install Intel OneAPI
run: |
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
sudo apt-get install intel-oneapi-tbb
sudo apt-get install intel-oneapi-mkl-devel

- name: Setup Python
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
architecture: x64

- name: Checkout repo
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Install mkl_umath dependencies
run: |
pip install scikit-build cmake ninja cython setuptools">=77"
pip install ${{ matrix.numpy_version }}

- name: List oneAPI folder content
run: ls ${{ env.ONEAPI_ROOT }}/compiler

- name: Build mkl_umath
run: |
source ${{ env.ONEAPI_ROOT }}/setvars.sh
echo $CMPLR_ROOT
export CC=$CMPLR_ROOT/bin/icx
export CFLAGS="${CFLAGS} -fno-fast-math -O2"
pip install . --no-build-isolation --no-deps --verbose

- name: Run mkl_umath tests
run: |
source ${{ env.ONEAPI_ROOT }}/setvars.sh
pip install pytest
# mkl_umath cannot be installed in editable mode, we need
# to change directory before importing it and running tests
cd ..
python -m pytest -sv --pyargs mkl_umath/mkl_umath/tests
62 changes: 62 additions & 0 deletions .github/workflows/build_pip.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build using pip and pre-release NumPy

on:
push:
branches:
- master
pull_request:

permissions: read-all

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}

strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12']
use_pre: ["", "--pre"]

steps:
- name: Install jq
shell: bash -l {0}
run: |
sudo apt-get install jq

- name: Checkout repo
uses: actions/[email protected]
with:
fetch-depth: 0

- uses: conda-incubator/[email protected]
with:
use-mamba: true
miniforge-version: latest
channels: conda-forge
conda-remove-defaults: true
activate-environment: test
python-version: ${{ matrix.python }}

- name: Install Compiler and MKL
run: |
conda install mkl-devel mkl-service dpcpp_linux-64
python -c "import sys; print(sys.executable)"
which python
python -c "import mkl; print(mkl.__file__)"

- name: Build conda package
run: |
pip install --no-cache-dir scikit-build cmake ninja cython
pip install --no-cache-dir numpy ${{ matrix.use_pre }}
echo "CONDA_PREFFIX is '${CONDA_PREFIX}'"
export MKLROOT=${CONDA_PREFIX}
pip install . --no-build-isolation --no-deps --verbose
pip install --no-cache-dir pytest
pip list
# mkl_umath cannot be installed in editable mode, we need
# to change directory before importing it and running tests
cd ..
python -m pytest -v mkl_umath/mkl_umath/tests
Loading
Loading