-
Notifications
You must be signed in to change notification settings - Fork 17
Support numba 0.61 #37
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
base: main
Are you sure you want to change the base?
Conversation
- Add patches for 15.0.7, 16.0.6
- Avoid ffi dlopen namespace issues with initialization
- Recent versions of LLVM use opaque pointers. The numba frontend must communicate the pointee types to the LLVM plugin pass for lowering
- Avoids using other installation directories of LLVM in the path
- Ensure CUDA context is initalized once
- Fix single tests to nest in parallel (as it must) - Skip target data tests that are problematic if no target region executes - Clean up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for Numba 0.61 by updating PyOMP to be compatible with LLVM versions 15, 16, and 17 (beyond the previously required LLVM 14). The changes involve substantial updates to both Python and C++ codebases to handle API changes and the migration to opaque pointers in LLVM.
Changes:
- Updated build system to support dynamic LLVM version selection via environment variable
- Migrated from deprecated Numba APIs (compile_isolated → njit, cffi → ctypes)
- Added opaque pointer support throughout C++ codebase with LLVM version conditionals
- Refactored CUDA codegen into singleton pattern
- Updated tests and documentation to reflect new device numbering (0=CUDA, 1=host)
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Refactored to dynamically download OpenMP sources based on LLVM_VERSION env var; added patch support for multiple LLVM versions |
| src/numba/openmp/init.py | Removed hard-coded LLVM 14 version check; moved decorators to separate module |
| src/numba/openmp/decorators.py | New module for jit/njit decorators extracted from init.py |
| src/numba/openmp/tags.py | Migrated from compile_isolated to njit API; added poison value operands for opaque pointer support |
| src/numba/openmp/omp_runtime.py | Replaced cffi with ctypes+llvmlite.binding for runtime function calls |
| src/numba/openmp/omp_ir.py | Refactored OpenMPCUDACodegen into singleton; removed nogil flag; updated to use new pass manager API |
| src/numba/openmp/libs/pass/.cpp/.h | Added LLVM version conditionals for opaque pointer support; updated OMPIRBuilder API calls for LLVM 16+ |
| src/numba/openmp/libs/pass/CMakeLists.txt | Made LLVM_DIR required parameter; removed LLVM version check |
| src/numba/openmp/tests/test_openmp.py | Updated device IDs in comments; added test for firstprivate arrays; uncommented test code; added skip decorators |
| buildscripts/cibuildwheel/setup-miniconda3.sh | Parameterized LLVM version via environment variable |
| README.md | Added compatibility matrix showing PyOMP 0.3.x supports Numba 0.57.x - 0.61.x |
| examples/hello-target.py | Changed device ID from 1 to 0 (CUDA backend) |
| src/numba/openmp/libs/libomp/patches/* | Added versioned patch directories for LLVM 14.0.6, 15.0.7, and 16.0.6 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DrTodd13
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Todd A. Anderson <drtodd13@comcast.net>
- Append when x is a str - Cleanup dead code in arg_to_str
- Use LLVM 15 for building to be compatible with numba 0.61 - Pin all actions to the commit ref - Add least permissions at the workflow level
- Use command to check if nvidia-smi exists
No description provided.