Skip to content

Commit

Permalink
Switch to numba 0.58
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa committed Sep 28, 2023
1 parent 8d0457b commit 631d633
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:
PACKAGE_NAME: numba-dpex
MODULE_NAME: numba_dpex
# There is a separate action that removes defaults.
CHANNELS: 'dppy/label/dev,conda-forge,intel'
CHANNELS: 'dppy/label/dev,conda-forge,intel,numba,nodefaults'
VER_JSON_NAME: 'version.json'
VER_SCRIPT1: "import json; f = open('version.json', 'r'); j = json.load(f); f.close(); "
VER_SCRIPT2: "d = j['numba-dpex'][0]; print('='.join((d[s] for s in ('version', 'build'))))"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
numpy_version:
default: '1.24.3'
numba_version:
default: '0.57.0'
default: '0.58'
# dpcpp_llvm_spirv_version:
# default: 'main'
cython_version:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ARG CMAKE_VERSION_BUILD=4

# Python
ARG INTEL_NUMPY_VERSION="==1.24.3"
ARG INTEL_NUMBA_VERSION="==0.57.0"
ARG INTEL_NUMBA_VERSION="==0.58"
ARG CYTHON_VERSION="==0.29.35"
ARG SCIKIT_BUILD_VERSION="==0.17.6"

Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- python=3.9
- gxx_linux-64
- dpcpp_linux-64
- numba >=0.57*
- numba ==0.58*
- dpctl >=0.14*
- dpnp >=0.11*
- mkl >=2021.3.0 # for dpnp
Expand Down
3 changes: 1 addition & 2 deletions environment/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ channels:
- dppy/label/dev
- numba
- intel
- numba/label/dev
- conda-forge
- nodefaults
dependencies:
- libffi
- gxx_linux-64
- dpcpp_linux-64
- numba=0.57
- numba==0.58*
- dpctl
- dpnp
- dpcpp-llvm-spirv
Expand Down
3 changes: 1 addition & 2 deletions environment/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ channels:
- dppy/label/dev
- numba
- intel
- numba/label/dev
- conda-forge
- nodefaults
dependencies:
- libffi
- gxx_linux-64
- dpcpp_linux-64
- numba=0.57
- numba==0.58*
- scikit-build>=0.15*
- cmake>=3.26*
- dpctl
Expand Down
22 changes: 10 additions & 12 deletions numba_dpex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@

from numba_dpex.vectorizers import Vectorize as DpexVectorize

from .numba_patches import (
patch_arrayexpr_tree_to_ir,
patch_is_ufunc,
patch_mk_alloc,
)

# Monkey patches
patch_is_ufunc.patch()
patch_mk_alloc.patch()
patch_arrayexpr_tree_to_ir.patch()
from .numba_patches import patch_arrayexpr_tree_to_ir, patch_is_ufunc


def load_dpctl_sycl_interface():
Expand Down Expand Up @@ -77,12 +68,19 @@ def parse_sem_version(version_string: str) -> Tuple[int, int, int]:


numba_sem_version = parse_sem_version(numba_version)
if numba_sem_version < (0, 57, 0):
if numba_sem_version < (0, 57, 0) or numba_sem_version >= (0, 59, 0):
logging.warning(
"numba_dpex needs numba 0.57.0, using "
"numba_dpex needs at lease numba 0.57.0 but no more than 0.59.0, using "
f"numba={numba_version} may cause unexpected behavior"
)

# Monkey patches
patch_is_ufunc.patch()
if numba_sem_version < (0, 58, 0):
from .numba_patches import patch_mk_alloc

patch_mk_alloc.patch()
patch_arrayexpr_tree_to_ir.patch()

dpctl_sem_version = parse_sem_version(dpctl.__version__)
if dpctl_sem_version < (0, 14):
Expand Down

0 comments on commit 631d633

Please sign in to comment.