Skip to content

Commit bc2e2c6

Browse files
ggeorgakoudisawennersteenclaude
authored
Support numba 0.66-0.67 with LLVM 22 (#78)
* Port to LLVM 22 and numba 0.66-0.67 numba 0.66 and 0.67 use llvmlite 0.48 (LLVM 22), so build the pass library and the OpenMP runtimes against LLVM 22.1.8. - Port the pass library to the LLVM 22 OpenMPIRBuilder API (__kmpc_parallel_60, TargetKernelArgs, ReductionInfo, PassPlugin.h), and set the OpenMPIRBuilder config, which createReductions now reads. - Build Linux wheels with the conda-forge LLVM 22 toolchain, compiling against the manylinux gcc-toolset libstdc++. - Build the nvptx and amdgcn device runtime bitcode from openmp/device, ignoring host CFLAGS and CXXFLAGS. - Keep three runtime patches for 22.1.8 (static LLVM, skip liboffload, __tgt_get_device_info) and drop the patch sets for older LLVM versions. - Require numba >=0.66,<0.68 and test numba 0.66.0 and 0.67.0. - Drop the conda is_freethreading variant, which no numba pin uses now. The libomptarget CUDA plugin in LLVM 22 includes llvm/llvm-project#159354 (fixes #71), and llvmlite 0.48 knows sm_110 (fixes #68). The OpenMPIRBuilder config setting, the device runtime host-flag reset, and the __tgt_get_device_info patch port are from #75. * Read AVX512_SKX from the NumPy SIMD features in conda tests numba 0.66 removed the "NumPy AVX512_SKX detected" sysinfo entry, so the conda test script failed with a KeyError before running the tests. Check the "NumPy Supported SIMD features" list instead. The fix is from #75. * Document PyOMP 0.6 compatibility --------- Co-authored-by: Aleksander Wennersteen <aleksander.wennersteen@pasqal.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 473dcf5 commit bc2e2c6

29 files changed

Lines changed: 204 additions & 700 deletions

‎.github/workflows/build-upload-conda.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
6565
# Select the python variant; 3.14t needs the free-threaded ABI.
6666
if [[ "${{ matrix.python-version }}" == "3.14t" ]]; then
67-
PY_ARGS=(--python "3.14.* *_cp314t" -m buildscripts/conda-recipes/pyomp/freethreading.yaml)
67+
PY_ARGS=(--python "3.14.* *_cp314t")
6868
else
6969
PY_ARGS=(--python ${{ matrix.python-version }})
7070
fi

‎.github/workflows/build-upload-wheels.yml‎

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
# Set LLVM_VERSION for the host to forward to the cibuildwheel
5353
# environment.
5454
env:
55-
LLVM_VERSION: "20.1.8"
55+
LLVM_VERSION: "22.1.8"
5656
run: python -m cibuildwheel --output-dir wheelhouse
5757

5858
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
@@ -69,7 +69,7 @@ jobs:
6969

7070
- name: Build sdist
7171
env:
72-
LLVM_VERSION: "20.1.8"
72+
LLVM_VERSION: "22.1.8"
7373
run: pipx run build --sdist
7474

7575
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
@@ -85,23 +85,7 @@ jobs:
8585
matrix:
8686
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
8787
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
88-
numba-version: ['0.62.0', '0.62.1', '0.63.0', '0.63.1', '0.64.0', '0.65.0', '0.65.1']
89-
exclude:
90-
- python-version: '3.14'
91-
numba-version: '0.62.0'
92-
- python-version: '3.14'
93-
numba-version: '0.62.1'
94-
# Numba supports free-threaded Python starting with 0.65.
95-
- python-version: '3.14t'
96-
numba-version: '0.62.0'
97-
- python-version: '3.14t'
98-
numba-version: '0.62.1'
99-
- python-version: '3.14t'
100-
numba-version: '0.63.0'
101-
- python-version: '3.14t'
102-
numba-version: '0.63.1'
103-
- python-version: '3.14t'
104-
numba-version: '0.64.0'
88+
numba-version: ['0.66.0', '0.67.0']
10589

10690
steps:
10791
- name: Download built wheels

‎README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ conda install -c python-for-hpc -c conda-forge pyomp
4545

4646
| PyOMP | Numba |
4747
| ----- | --------------- |
48+
| 0.6.x | 0.66.x - 0.67.x |
4849
| 0.5.x | 0.62.x - 0.65.x |
4950
| 0.4.x | 0.61.x |
5051
| 0.3.x | 0.57.x - 0.60.x |
5152

52-
Python 3.14t (free-threaded) requires Numba 0.65.x.
53+
Python 3.14t (free-threaded) requires PyOMP 0.5.2 or later and Numba 0.65.x or later.
5354

5455
Besides a standard installation, we also provide the following options to
5556
quickly try out PyOMP online or through a container.

‎buildscripts/cibuildwheel/setup-miniforge3.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ bash _downloads/miniforge3.sh -b -f -p "_stage/miniforge3"
5858
echo "Miniforge installed"
5959
source "_stage/miniforge3/bin/activate" base
6060

61-
# Create conda environment with tools and libraries for the LLVM_VERSION.
61+
# Create conda environment with tools and libraries for the LLVM_VERSION. lld
62+
# links the AMDGPU device runtime.
6263
echo "Installing llvmdev ${LLVM_VERSION}..."
63-
conda create -n llvmdev-${LLVM_VERSION} --override-channels -c conda-forge -q -y clang=${LLVM_VERSION} clangxx=${LLVM_VERSION} clang-tools=${LLVM_VERSION} llvmdev=${LLVM_VERSION} zstd
64+
conda create -n llvmdev-${LLVM_VERSION} --override-channels -c conda-forge -q -y clang=${LLVM_VERSION} clangxx=${LLVM_VERSION} clang-tools=${LLVM_VERSION} llvmdev=${LLVM_VERSION} lld=${LLVM_VERSION} zstd

‎buildscripts/conda-recipes/pyomp/conda_build_config.yaml‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# --- Free-threading ---
2-
# Default for the is_freethreading selector in meta.yaml; override for 3.14t.
3-
is_freethreading:
4-
- false
5-
61
# --- Compilers ---
72
c_compiler_version:
83
- 9 # [linux]

‎buildscripts/conda-recipes/pyomp/freethreading.yaml‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎buildscripts/conda-recipes/pyomp/meta.yaml‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0').lstrip('v') %}
2-
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '20.1.8') %}
2+
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '22.1.8') %}
33
{% set LLVM_VERSION_MAJOR = LLVM_VERSION.split('.')[0] %}
44
{% set LLVM_VERSION_MINOR = LLVM_VERSION.split('.')[1] %}
55

@@ -45,26 +45,24 @@ requirements:
4545
- sysroot_linux-aarch64 # [aarch64]
4646
- setuptools
4747
- setuptools_scm
48-
- numba >=0.62, <0.66
49-
- numba >=0.65, <0.66 # [is_freethreading]
48+
- numba >=0.66, <0.68
5049
- clang {{ LLVM_VERSION }}
5150
- clangxx {{ LLVM_VERSION }}
5251
- clang-tools {{ LLVM_VERSION }}
5352
- llvmdev {{ LLVM_VERSION }}
53+
# lld links the AMDGPU device runtime.
54+
- lld {{ LLVM_VERSION }} # [linux]
5455
- zlib
5556
# require llvm-openmp for the openmp cpu runtime.
56-
- llvm-openmp 21.1.8.* # [osx]
57-
- llvm-openmp {{ LLVM_VERSION }} # [not osx]
57+
- llvm-openmp {{ LLVM_VERSION }}
5858
- elfutils # [linux]
5959
- libffi # [linux]
6060
run:
6161
- python
6262
- setuptools
63-
- numba >=0.62, <0.66
64-
- numba >=0.65, <0.66 # [is_freethreading]
63+
- numba >=0.66, <0.68
6564
# require llvm-openmp for the openmp cpu runtime.
66-
- llvm-openmp 21.1.8.* # [osx]
67-
- llvm-openmp {{ LLVM_VERSION }} # [not osx]
65+
- llvm-openmp {{ LLVM_VERSION }}
6866
- lark
6967
- cffi
7068

‎buildscripts/conda-recipes/pyomp/run_test.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export PYTHONFAULTHANDLER=1
1212
# of low accuracy SVML libm replacements in ufunc loops.
1313
_NPY_CMD='from numba.misc import numba_sysinfo;\
1414
sysinfo=numba_sysinfo.get_sysinfo();\
15-
print(sysinfo["NumPy AVX512_SKX detected"] and
15+
print("AVX512_SKX" in sysinfo["NumPy Supported SIMD features"] and
1616
sysinfo["NumPy Version"]>="1.22")'
1717
NUMPY_DETECTS_AVX512_SKX_NP_GT_122=$(python -c "$_NPY_CMD")
1818
echo "NumPy >= 1.22 with AVX512_SKX detected: $NUMPY_DETECTS_AVX512_SKX_NP_GT_122"

‎buildscripts/modal/test_gpu.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
PYTHON_VERSIONS = ("3.10", "3.11", "3.12", "3.13", "3.14")
11-
NUMBA_VERSION = "0.65.1"
11+
NUMBA_VERSION = "0.67.0"
1212
MINIFORGE_VERSION = "26.3.2-3"
1313
MINIFORGE_SHA256 = "848194851a98903134187fbb4ab50efe87b003e0c0f808f97644b7524a62bf2c"
1414
WHEEL_DIRECTORY = (

‎docs/source/installation.rst‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ supported.
2424
+--------+---------------------+
2525
| PyOMP | Numba |
2626
+========+=====================+
27+
| 0.6.x | 0.66.x - 0.67.x |
28+
+--------+---------------------+
2729
| 0.5.x | 0.62.x - 0.65.x |
2830
+--------+---------------------+
2931
| 0.4.x | 0.61.x |
3032
+--------+---------------------+
3133
| 0.3.x | 0.57.x - 0.60.x |
3234
+--------+---------------------+
3335

34-
Python 3.14t (free-threaded) requires Numba 0.65.x.
36+
Python 3.14t (free-threaded) requires PyOMP 0.5.2 or later and Numba 0.65.x or later.
3537

3638
Additional options
3739
------------------

0 commit comments

Comments
 (0)