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

Merged
merged 8 commits into from
May 5, 2025
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.
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
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [dev] (MM/DD/YY)

### Added
* `mkl_umath` is now aligned with both numpy-1.26,x and numpy-2.x.x [gh-65](https://github.com/IntelPython/mkl_umath/pull/65)

### Changed
* Migrated from `setup.py` to `pyproject toml` [gh-63](https://github.com/IntelPython/mkl_umath/pull/63)

### Fixed
* Fixed a bug for `mkl_umath.is_patched` function [gh-66](https://github.com/IntelPython/mkl_umath/pull/66)


## [0.1.5] (04/09/2025)

### Fixed
* Fixed failures to import `mkl_umath` from virtual environment on Linux

## [0.1.4] (04/09/2025)

### Added
* Added support for `mkl_umath` out-of-the-box in virtual environments on Windows

### Fixed
* Fixed a bug in in-place addition with negative zeros

## [0.1.2] (10/11/2024)

### Added
* Added support for building with NumPy 2.0 and older

### Changed
* Updated build system from removed NumPy distutils to scikit-build, gain ability to build with Intel LLVM compiler ICX
Loading
Loading