Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/build-upload-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:

# Select the python variant; 3.14t needs the free-threaded ABI.
if [[ "${{ matrix.python-version }}" == "3.14t" ]]; then
PY_ARGS=(--python "3.14.* *_cp314t" -m buildscripts/conda-recipes/pyomp/freethreading.yaml)
PY_ARGS=(--python "3.14.* *_cp314t")
else
PY_ARGS=(--python ${{ matrix.python-version }})
fi
Expand Down
22 changes: 3 additions & 19 deletions .github/workflows/build-upload-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# Set LLVM_VERSION for the host to forward to the cibuildwheel
# environment.
env:
LLVM_VERSION: "20.1.8"
LLVM_VERSION: "22.1.8"
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand All @@ -69,7 +69,7 @@ jobs:

- name: Build sdist
env:
LLVM_VERSION: "20.1.8"
LLVM_VERSION: "22.1.8"
run: pipx run build --sdist

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand All @@ -85,23 +85,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t']
numba-version: ['0.62.0', '0.62.1', '0.63.0', '0.63.1', '0.64.0', '0.65.0', '0.65.1']
exclude:
- python-version: '3.14'
numba-version: '0.62.0'
- python-version: '3.14'
numba-version: '0.62.1'
# Numba supports free-threaded Python starting with 0.65.
- python-version: '3.14t'
numba-version: '0.62.0'
- python-version: '3.14t'
numba-version: '0.62.1'
- python-version: '3.14t'
numba-version: '0.63.0'
- python-version: '3.14t'
numba-version: '0.63.1'
- python-version: '3.14t'
numba-version: '0.64.0'
numba-version: ['0.66.0', '0.67.0']

steps:
- name: Download built wheels
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ conda install -c python-for-hpc -c conda-forge pyomp

| PyOMP | Numba |
| ----- | --------------- |
| 0.6.x | 0.66.x - 0.67.x |
| 0.5.x | 0.62.x - 0.65.x |
| 0.4.x | 0.61.x |
| 0.3.x | 0.57.x - 0.60.x |

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

Besides a standard installation, we also provide the following options to
quickly try out PyOMP online or through a container.
Expand Down
5 changes: 3 additions & 2 deletions buildscripts/cibuildwheel/setup-miniforge3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ bash _downloads/miniforge3.sh -b -f -p "_stage/miniforge3"
echo "Miniforge installed"
source "_stage/miniforge3/bin/activate" base

# Create conda environment with tools and libraries for the LLVM_VERSION.
# Create conda environment with tools and libraries for the LLVM_VERSION. lld
# links the AMDGPU device runtime.
echo "Installing llvmdev ${LLVM_VERSION}..."
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
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
5 changes: 0 additions & 5 deletions buildscripts/conda-recipes/pyomp/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# --- Free-threading ---
# Default for the is_freethreading selector in meta.yaml; override for 3.14t.
is_freethreading:
- false

# --- Compilers ---
c_compiler_version:
- 9 # [linux]
Expand Down
4 changes: 0 additions & 4 deletions buildscripts/conda-recipes/pyomp/freethreading.yaml

This file was deleted.

16 changes: 7 additions & 9 deletions buildscripts/conda-recipes/pyomp/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0').lstrip('v') %}
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '20.1.8') %}
{% set LLVM_VERSION = environ.get('LLVM_VERSION', '22.1.8') %}
{% set LLVM_VERSION_MAJOR = LLVM_VERSION.split('.')[0] %}
{% set LLVM_VERSION_MINOR = LLVM_VERSION.split('.')[1] %}

Expand Down Expand Up @@ -45,26 +45,24 @@ requirements:
- sysroot_linux-aarch64 # [aarch64]
- setuptools
- setuptools_scm
- numba >=0.62, <0.66
- numba >=0.65, <0.66 # [is_freethreading]
- numba >=0.66, <0.68
- clang {{ LLVM_VERSION }}
- clangxx {{ LLVM_VERSION }}
- clang-tools {{ LLVM_VERSION }}
- llvmdev {{ LLVM_VERSION }}
# lld links the AMDGPU device runtime.
- lld {{ LLVM_VERSION }} # [linux]
- zlib
# require llvm-openmp for the openmp cpu runtime.
- llvm-openmp 21.1.8.* # [osx]
- llvm-openmp {{ LLVM_VERSION }} # [not osx]
- llvm-openmp {{ LLVM_VERSION }}
- elfutils # [linux]
- libffi # [linux]
run:
- python
- setuptools
- numba >=0.62, <0.66
- numba >=0.65, <0.66 # [is_freethreading]
- numba >=0.66, <0.68
# require llvm-openmp for the openmp cpu runtime.
- llvm-openmp 21.1.8.* # [osx]
- llvm-openmp {{ LLVM_VERSION }} # [not osx]
- llvm-openmp {{ LLVM_VERSION }}
- lark
- cffi

Expand Down
2 changes: 1 addition & 1 deletion buildscripts/conda-recipes/pyomp/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export PYTHONFAULTHANDLER=1
# of low accuracy SVML libm replacements in ufunc loops.
_NPY_CMD='from numba.misc import numba_sysinfo;\
sysinfo=numba_sysinfo.get_sysinfo();\
print(sysinfo["NumPy AVX512_SKX detected"] and
print("AVX512_SKX" in sysinfo["NumPy Supported SIMD features"] and
sysinfo["NumPy Version"]>="1.22")'
NUMPY_DETECTS_AVX512_SKX_NP_GT_122=$(python -c "$_NPY_CMD")
echo "NumPy >= 1.22 with AVX512_SKX detected: $NUMPY_DETECTS_AVX512_SKX_NP_GT_122"
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/modal/test_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


PYTHON_VERSIONS = ("3.10", "3.11", "3.12", "3.13", "3.14")
NUMBA_VERSION = "0.65.1"
NUMBA_VERSION = "0.67.0"
MINIFORGE_VERSION = "26.3.2-3"
MINIFORGE_SHA256 = "848194851a98903134187fbb4ab50efe87b003e0c0f808f97644b7524a62bf2c"
WHEEL_DIRECTORY = (
Expand Down
4 changes: 3 additions & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ supported.
+--------+---------------------+
| PyOMP | Numba |
+========+=====================+
| 0.6.x | 0.66.x - 0.67.x |
+--------+---------------------+
| 0.5.x | 0.62.x - 0.65.x |
+--------+---------------------+
| 0.4.x | 0.61.x |
+--------+---------------------+
| 0.3.x | 0.57.x - 0.60.x |
+--------+---------------------+

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

Additional options
------------------
Expand Down
9 changes: 6 additions & 3 deletions docs/source/openmp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ The following table shows tested combinations of PyOMP, Numba, Python, LLVM, and
===================== ==================== ==================== ============ ================================
PyOMP Numba Python LLVM Supported Platforms
===================== ==================== ==================== ============ ================================
0.5.x 0.62.x - 0.63.x 3.10 - 3.14 20.x linux-64, osx-arm64, linux-arm64
0.6.x 0.66.x - 0.67.x 3.10 - 3.14 22.x linux-64, osx-arm64, linux-arm64
0.5.x 0.62.x - 0.65.x 3.10 - 3.14 20.x linux-64, osx-arm64, linux-arm64
0.4.x 0.61.x 3.10 - 3.13 15.x linux-64, osx-arm64, linux-arm64
0.3.x 0.57.x - 0.60.x 3.9 - 3.12 14.x linux-64, osx-arm64, linux-arm64
===================== ==================== ==================== ============ ================================
Expand Down Expand Up @@ -384,7 +385,9 @@ Platform details
Notes
^^^^^

* Python 3.14 free-threaded build (cp314t) is not supported with the current Numba/llvmlite version.
* LLVM version 20.1.8 is used for the current PyOMP 0.5.x releases.
* Python 3.14 free-threaded builds (cp314t) are supported starting with PyOMP
0.5.2 (Numba 0.65.x).
* LLVM version 22.1.8 is used for the current PyOMP 0.6.x releases, and LLVM
version 20.1.8 for the PyOMP 0.5.x releases.
* For GPU offloading support, NVIDIA GPU and NVIDIA driver are required on supported Linux platforms.
* AMD GPU support is in active development.
17 changes: 12 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ classifiers = [
"Intended Audience :: Developers",
"Topic :: Software Development :: Compilers",
]
dependencies = ["numba>=0.62, <0.66", "lark", "cffi", "setuptools"]
dependencies = ["numba>=0.66, <0.68", "lark", "cffi", "setuptools"]
maintainers = [
{ name = "Giorgis Georgakoudis", email = "georgakoudis1@llnl.gov" },
]
Expand Down Expand Up @@ -55,16 +55,23 @@ USE_CXX11_ABI = "1"
PIP_NO_INPUT = "1"

[tool.cibuildwheel.linux]
# The manylinux image has no LLVM_VERSION packages, so use the conda-forge
# toolchain. libzstd-devel is needed by the conda LLVM cmake exports.
before-all = [
"yum install -y elfutils-libelf-devel libffi-devel clang-devel-20.1.8 llvm-devel-20.1.8",
"yum install -y elfutils-libelf-devel libffi-devel libzstd-devel",
"bash buildscripts/cibuildwheel/setup-miniforge3.sh",
]

[tool.cibuildwheel.linux.environment]
ENABLE_BUNDLED_LIBOMP = "1"
ENABLE_BUNDLED_LIBOMPTARGET = "1"
LLVM_DIR = "/usr/lib64/cmake/llvm"
CC = "/usr/bin/clang"
CXX = "/usr/bin/clang++"
LLVM_DIR = "${PWD}/_stage/miniforge3/envs/llvmdev-${LLVM_VERSION}/lib/cmake/llvm"
CC = "${PWD}/_stage/miniforge3/envs/llvmdev-${LLVM_VERSION}/bin/clang"
CXX = "${PWD}/_stage/miniforge3/envs/llvmdev-${LLVM_VERSION}/bin/clang++"
# Compile against the image's gcc-toolset libstdc++ instead of the conda one
# that clang selects by default, so the libraries stay manylinux compatible.
CFLAGS = "--gcc-toolchain=/opt/rh/gcc-toolset-14/root/usr"
CXXFLAGS = "--gcc-toolchain=/opt/rh/gcc-toolset-14/root/usr"

[tool.cibuildwheel.macos]
before-all = ["bash buildscripts/cibuildwheel/setup-miniforge3.sh"]
Expand Down
38 changes: 37 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path
import subprocess
import shlex
import shutil
import tarfile
import urllib
Expand Down Expand Up @@ -133,6 +134,9 @@ def _build_cmake(self, ext: CMakeExtension):
include_dir = install_dir / "lib/cmake"
if include_dir.exists():
shutil.rmtree(include_dir)
# Keep only the device runtime bitcode, not its static archive.
if ext.name.startswith("devicertl"):
(install_dir / "lib/libompdevice.a").unlink(missing_ok=True)
# Remove symlinks in the install directory to avoid copies.
for file in install_dir.rglob("*"):
if file.is_symlink():
Expand Down Expand Up @@ -209,9 +213,11 @@ def _build_loader_wrapper(self):
loader_so = target_lib_dir / f"libpyomp_loader{lib_ext}"
cc = os.environ.get("CC", "gcc")

# Compile the wrapper.
# Compile the wrapper. Pass CFLAGS so it uses the same toolchain as the
# other libraries, e.g., the manylinux --gcc-toolchain.
cmd = [
cc,
*shlex.split(os.environ.get("CFLAGS", "")),
"-shared",
"-fPIC",
str(loader_c),
Expand Down Expand Up @@ -359,13 +365,43 @@ def _check_true(env_var):
cmake_args=[
"-DOPENMP_STANDALONE_BUILD=ON",
"-DLLVM_ENABLE_RUNTIMES=offload",
# Tests depend on liboffload, which is not built.
"-DOFFLOAD_INCLUDE_TESTS=OFF",
# Avoid conflicts in manylinux builds with packaged clang/llvm
# under /usr/include and its gcc-toolset provided header files.
"-DCMAKE_NO_SYSTEM_FROM_IMPORTED=ON",
],
)
)

# Build the device runtime bitcode (libomptarget-<target>.bc) for each GPU
# target, compiled by clang from openmp/device.
for triple in ("nvptx64-nvidia-cuda", "amdgcn-amd-amdhsa"):
ext_modules.append(
CMakeExtension(
f"devicertl-{triple}",
setup=PrepareOpenMP,
source_dir=PrepareOpenMP.get_source_dir(),
install_dir="openmp",
cmake_args=[
"-DOPENMP_STANDALONE_BUILD=ON",
"-DLLVM_ENABLE_RUNTIMES=openmp",
f"-DLLVM_RUNTIMES_TARGET={triple}",
f"-DLLVM_DEFAULT_TARGET_TRIPLE={triple}",
f"-DCMAKE_C_COMPILER_TARGET={triple}",
f"-DCMAKE_CXX_COMPILER_TARGET={triple}",
# The compiler cannot link host test programs for GPU
# targets.
"-DCMAKE_C_COMPILER_WORKS=ON",
"-DCMAKE_CXX_COMPILER_WORKS=ON",
# Ignore host flags from CFLAGS and CXXFLAGS, such as
# conda's -march, which fail for GPU targets.
"-DCMAKE_C_FLAGS=",
"-DCMAKE_CXX_FLAGS=",
],
)
)


setup(
ext_modules=ext_modules,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading