Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9a6554a
CUDA intrinsics tests: correct np.float -> np.float16
gmarkall Nov 24, 2022
83d08f6
TestLinalgSvd.test_no_input_mutation: use reconstruction if necessary
gmarkall Dec 22, 2022
4c619e6
test_comp_nest_with_dependency: skip on NumPy 1.24
gmarkall Nov 24, 2022
f5f5b74
Avoid use of np.bool in stencilparfor.py
gmarkall Nov 24, 2022
90afbca
test_hypot: Tweak regex so it matches NumPy 1.24
gmarkall Nov 24, 2022
99966f4
Don't test summing with timedelta dtype
gmarkall Nov 24, 2022
937f7f8
Replace use of deprecated np.bool with np.bool_
gmarkall Nov 24, 2022
cd867db
Overload np.MachAr only for NumPy < 1.24
gmarkall Nov 24, 2022
8d8abd1
_internal.c: Remove NPY_API_VERSION checks
gmarkall Nov 25, 2022
915a237
init_ufunc_dispatch: Handle unexpected ufunc methods gracefully
gmarkall Jan 3, 2023
da739e1
init_ufunc_dispatch: Update for NumPy 1.24
gmarkall Jan 3, 2023
a4a0b8d
Update NumPy version support documentation
gmarkall Jan 3, 2023
9ffee5d
Mody test matrix to test NumPy versions 1.21-1.24
gmarkall Jan 3, 2023
334be3b
Docs: Correct NumPy upper bound for 0.57 release
gmarkall Jan 11, 2023
1304e64
Update comment on skipped test
gmarkall Jan 11, 2023
444fa1a
Merge remote-tracking branch 'numba/main' into np-124-review
gmarkall Jan 27, 2023
a0a8300
Correct name of ufunc method in fastcall flags error
gmarkall Jan 27, 2023
fbec218
Merge remote-tracking branch 'numba/main' into np-124-review
gmarkall Feb 6, 2023
0d95edb
Merge remote-tracking branch 'numba/main' into np-124-review
gmarkall Feb 17, 2023
9d04211
Merge remote-tracking branch 'numba/main' into np-124-review
gmarkall Feb 28, 2023
2f72663
Merge remote-tracking branch 'numba/main' into np-124-review
gmarkall Mar 6, 2023
2d0f930
Use conda-forge for NumPy 1.24
gmarkall Mar 6, 2023
158033b
Attempt to correct syntax for NumPy package channel setting on Windows
gmarkall Mar 6, 2023
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
68 changes: 34 additions & 34 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
name: macOS
vmImage: macos-11
matrix:
py38_np118:
py38_np121:
PYTHON: '3.8'
NUMPY: '1.18'
NUMPY: '1.21'
CONDA_ENV: 'azure_ci'
TEST_START_INDEX: 0
py310_np123:
py310_np124:
PYTHON: '3.10'
NUMPY: '1.23'
NUMPY: '1.24'
CONDA_ENV: 'azure_ci'
TEST_THREADING: 'tbb'
TEST_START_INDEX: 1
Expand All @@ -29,89 +29,89 @@ jobs:
name: Linux
vmImage: ubuntu-20.04
matrix:
py38_np118_vanilla:
py38_np121_vanilla:
PYTHON: '3.8'
NUMPY: '1.18'
NUMPY: '1.21'
CONDA_ENV: azure_ci
VANILLA_INSTALL: yes
TEST_START_INDEX: 2
py38_np118_cov:
py38_np121_cov:
PYTHON: '3.8'
NUMPY: '1.18'
NUMPY: '1.21'
CONDA_ENV: azure_ci
RUN_COVERAGE: yes
RUN_FLAKE8: yes
RUN_MYPY: yes
TEST_START_INDEX: 3
py38_np119_tbb:
py38_np122_tbb:
PYTHON: '3.8'
NUMPY: '1.19.2=*_0'
NUMPY: '1.22'
CONDA_ENV: azure_ci
TEST_THREADING: 'tbb'
TEST_START_INDEX: 4
py38_np119_omp:
py38_np122_omp:
PYTHON: '3.8'
NUMPY: '1.19.2=*_0'
NUMPY: '1.22'
CONDA_ENV: azure_ci
TEST_THREADING: omp
TEST_START_INDEX: 5
py38_np119_workqueue:
py38_np122_workqueue:
PYTHON: '3.8'
NUMPY: '1.19.2=*_0'
NUMPY: '1.22'
CONDA_ENV: azure_ci
TEST_THREADING: workqueue
TEST_START_INDEX: 6
py38_np120_doc:
py38_np123_doc:
PYTHON: '3.8'
NUMPY: '1.20'
NUMPY: '1.23'
CONDA_ENV: azure_ci
BUILD_DOC: yes
TEST_START_INDEX: 7
py38_np120:
py38_np122:
PYTHON: '3.8'
NUMPY: '1.20'
NUMPY: '1.22'
CONDA_ENV: azure_ci
TEST_START_INDEX: 8
py38_np120_svml:
py38_np123_svml:
PYTHON: '3.8'
NUMPY: '1.20'
NUMPY: '1.23'
CONDA_ENV: azure_ci
TEST_SVML: yes
TEST_START_INDEX: 9
py38_np122:
py38_np124:
PYTHON: '3.8'
NUMPY: '1.22'
NUMPY: '1.24'
CONDA_ENV: azure_ci
TEST_START_INDEX: 10
py39_np119:
py39_np123:
PYTHON: '3.9'
NUMPY: '1.19.2=*_0'
NUMPY: '1.23'
CONDA_ENV: azure_ci
TEST_START_INDEX: 11
py39_np120_typeguard:
py39_np123_typeguard:
PYTHON: '3.9'
NUMPY: '1.20'
NUMPY: '1.23'
CONDA_ENV: azure_ci
RUN_TYPEGUARD: yes
TEST_START_INDEX: 12
py39_np121:
py39_np122:
PYTHON: '3.9'
NUMPY: '1.21'
NUMPY: '1.22'
CONDA_ENV: azure_ci
TEST_START_INDEX: 13
py39_np123:
py39_np124:
PYTHON: '3.9'
NUMPY: '1.23'
NUMPY: '1.24'
CONDA_ENV: azure_ci
TEST_START_INDEX: 14
py310_np121:
py310_np123:
PYTHON: '3.10'
NUMPY: '1.21'
NUMPY: '1.23'
CONDA_ENV: azure_ci
TEST_START_INDEX: 15
py310_np123:
py310_np124:
PYTHON: '3.10'
NUMPY: '1.23'
NUMPY: '1.24'
CONDA_ENV: azure_ci
TEST_START_INDEX: 16

Expand Down
8 changes: 4 additions & 4 deletions buildscripts/azure/azure-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
vmImage: ${{ parameters.vmImage }}
strategy:
matrix:
py310_np123:
py310_np124:
PYTHON: '3.10'
NUMPY: '1.23'
NUMPY: '1.24'
CONDA_ENV: 'testenv'
TEST_START_INDEX: 17
py38_np118:
py38_np121:
PYTHON: '3.8'
NUMPY: '1.18'
NUMPY: '1.21'
CONDA_ENV: 'testenv'
TEST_START_INDEX: 18

Expand Down
13 changes: 11 additions & 2 deletions buildscripts/gpuci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ fi;
# Test with different NumPy versions with each toolkit (it's not worth testing
# the Cartesian product of versions here, we just need to test with different
# CUDA and NumPy versions).
declare -A CTK_NUMPY_VMAP=( ["11.0"]="1.19" ["11.1"]="1.20" ["11.2"]="1.21" ["11.5"]="1.22" ["11.8"]="1.23")
declare -A CTK_NUMPY_VMAP=( ["11.0"]="1.21" ["11.1"]="1.22" ["11.2"]="1.23" ["11.5"]="1.24" ["11.8"]="1.24")
NUMPY_VER="${CTK_NUMPY_VMAP[$CUDA_TOOLKIT_VER]}"

# Use conda-forge for NumPy 1.24 - at the time of writing it is not available
# on the defaults channel.

if [ "${NUMPY}" == "1.24" ]; then
NUMPY_CHANNEL_PKG=conda-forge::numpy
else
NUMPY_CHANNEL_PKG=numpy
fi


################################################################################
# SETUP - Check environment
Expand All @@ -57,7 +66,7 @@ gpuci_mamba_retry create -n numba_ci -y \
"rapidsai::cubinlinker" \
"conda-forge::ptxcompiler" \
"numba/label/dev::llvmlite" \
"numpy=${NUMPY_VER}" \
"${NUMPY_CHANNEL_PKG}=${NUMPY_VER}" \
"scipy" \
"cffi" \
"psutil" \
Expand Down
6 changes: 5 additions & 1 deletion buildscripts/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,18 @@ cmd /C conda info
set CONDA_INSTALL=cmd /C conda install -q -y
set PIP_INSTALL=pip install -q

@rem Use conda-forge for NumPy 1.24 - at the time of writing it is not available
@rem on the defaults channel.
if %NUMPY%==1.24 (set NUMPY_CHANNEL_PKG="conda-forge::numpy") else (set NUMPY_CHANNEL_PKG="numpy")

@echo on

@rem Deactivate any environment
call deactivate
@rem Display root environment (for debugging)
conda list
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
conda create -n %CONDA_ENV% -q -y python=%PYTHON% numpy=%NUMPY% cffi pip scipy jinja2 ipython gitpython pyyaml
conda create -n %CONDA_ENV% -q -y python=%PYTHON% %NUMPY_CHANNEL_PKG%=%NUMPY% cffi pip scipy jinja2 ipython gitpython pyyaml

call activate %CONDA_ENV%
@rem Install latest llvmlite build
Expand Down
12 changes: 11 additions & 1 deletion buildscripts/incremental/setup_conda_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@ source deactivate
# Display root environment (for debugging)
conda list

# Use conda-forge for NumPy 1.24 - at the time of writing it is not available
# on the defaults channel.

if [ "${NUMPY}" == "1.24" ]; then
NUMPY_CHANNEL_PKG=conda-forge::numpy
else
NUMPY_CHANNEL_PKG=numpy
fi

# If VANILLA_INSTALL is yes, then only Python, NumPy and pip are installed, this
# is to catch tests/code paths that require an optional package and are not
# guarding against the possibility that it does not exist in the environment.
# Create a base env first and then add to it...
# NOTE: gitpython is needed for CI testing to do the test slicing
# NOTE: pyyaml is used to ensure that the Azure CI config is valid
conda create -n $CONDA_ENV -q -y ${EXTRA_CHANNELS} python=$PYTHON numpy=$NUMPY pip gitpython pyyaml

conda create -n $CONDA_ENV -q -y ${EXTRA_CHANNELS} python=$PYTHON $NUMPY_CHANNEL_PKG=$NUMPY pip gitpython pyyaml

# Activate first
set +v
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Installation
Compatibility
-------------

Numba is compatible with Python 3.8--3.10, and NumPy versions 1.18 or later.
Numba is compatible with Python 3.8--3.10, and NumPy versions 1.21--1.24.

Our supported platforms are:

Expand Down Expand Up @@ -260,7 +260,7 @@ information.
+----------++--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| Numba | Release date | Python | NumPy | llvmlite | LLVM | TBB |
+===========+==============+===========================+============================+==============================+===================+=============================+
| 0.57.x | TBC | 3.8.x <= version < 3.12 | 1.19 <= version < 1.24 | 0.40.x | 11.x | 2021.x |
| 0.57.0 | TBC | 3.8.x <= version < 3.12 | 1.21 <= version < 1.25 | 0.40.x | 11.x | 2021.x |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
| 0.56.4 | 2022-11-03 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.24 | 0.39.x | 11.x | 2021.x |
+-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+
Expand Down
4 changes: 2 additions & 2 deletions numba/cuda/tests/cudapy/test_intrinsics.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ def test_hmax(self):
arg2 = np.float16(4.)
compiled[1, 1](ary, arg1, arg2)
np.testing.assert_allclose(ary[0], arg2)
arg1 = np.float(5.)
arg1 = np.float16(5.)
compiled[1, 1](ary, arg1, arg2)
np.testing.assert_allclose(ary[0], arg1)

Expand All @@ -845,7 +845,7 @@ def test_hmin(self):
arg2 = np.float16(4.)
compiled[1, 1](ary, arg1, arg2)
np.testing.assert_allclose(ary[0], arg1)
arg1 = np.float(5.)
arg1 = np.float16(5.)
compiled[1, 1](ary, arg1, arg2)
np.testing.assert_allclose(ary[0], arg2)

Expand Down
4 changes: 4 additions & 0 deletions numba/np/arraymath.py
Original file line number Diff line number Diff line change
Expand Up @@ -4028,6 +4028,10 @@ def histogram_impl(a, bins=10, range=None):
# This module is imported under the compiler lock which should deal with the
# lack of thread safety in the warning filter.
def _gen_np_machar():
# NumPy 1.24 removed np.MachAr
if numpy_version >= (1, 24):
return

np122plus = numpy_version >= (1, 22)
w = None
with warnings.catch_warnings(record=True) as w:
Expand Down
26 changes: 12 additions & 14 deletions numba/np/ufunc/_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,7 @@ static struct _ufunc_dispatch {
PyCFunctionWithKeywords ufunc_accumulate;
PyCFunctionWithKeywords ufunc_reduceat;
PyCFunctionWithKeywords ufunc_outer;
#if NPY_API_VERSION >= 0x00000008
PyCFunction ufunc_at;
#endif
} ufunc_dispatch;

static int
Expand All @@ -324,10 +322,8 @@ init_ufunc_dispatch(int *numpy_uses_fastcall)
if (strncmp(crnt_name, "accumulate", 11) == 0) {
ufunc_dispatch.ufunc_accumulate =
(PyCFunctionWithKeywords)crnt->ml_meth;
#if NPY_API_VERSION >= 0x00000008
} else if (strncmp(crnt_name, "at", 3) == 0) {
ufunc_dispatch.ufunc_at = crnt->ml_meth;
#endif
} else {
result = -1;
}
Expand All @@ -347,10 +343,15 @@ init_ufunc_dispatch(int *numpy_uses_fastcall)
} else if (strncmp(crnt_name, "reduceat", 9) == 0) {
ufunc_dispatch.ufunc_reduceat =
(PyCFunctionWithKeywords)crnt->ml_meth;
} else if (strncmp(crnt_name, "resolve_dtypes", 15) == 0) {
/* Ignored */
} else {
result = -1;
}
break;
case '_':
// We ignore private methods
break;
default:
result = -1; /* Unknown method */
}
Expand All @@ -362,6 +363,9 @@ init_ufunc_dispatch(int *numpy_uses_fastcall)
*numpy_uses_fastcall = crnt->ml_flags & METH_FASTCALL;
}
else if (*numpy_uses_fastcall != (crnt->ml_flags & METH_FASTCALL)) {
PyErr_Format(PyExc_RuntimeError,
"ufunc.%s() flags do not match numpy_uses_fastcall",
crnt_name);
return -1;
}
}
Expand All @@ -372,11 +376,13 @@ init_ufunc_dispatch(int *numpy_uses_fastcall)
&& (ufunc_dispatch.ufunc_accumulate != NULL)
&& (ufunc_dispatch.ufunc_reduceat != NULL)
&& (ufunc_dispatch.ufunc_outer != NULL)
#if NPY_API_VERSION >= 0x00000008
&& (ufunc_dispatch.ufunc_at != NULL)
#endif
);
} else {
char const * const fmt = "Unexpected ufunc method %s()";
PyErr_Format(PyExc_RuntimeError, fmt, crnt_name);
Comment thread
stuartarchibald marked this conversation as resolved.
}

return result;
}

Expand Down Expand Up @@ -446,13 +452,11 @@ dufunc_outer_fast(PyDUFuncObject * self,
}


#if NPY_API_VERSION >= 0x00000008
static PyObject *
dufunc_at(PyDUFuncObject * self, PyObject * args)
{
return ufunc_dispatch.ufunc_at((PyObject*)self->ufunc, args);
}
#endif

static PyObject *
dufunc__compile_for_args(PyDUFuncObject * self, PyObject * args,
Expand Down Expand Up @@ -630,11 +634,9 @@ static struct PyMethodDef dufunc_methods[] = {
{"outer",
(PyCFunction)dufunc_outer,
METH_VARARGS | METH_KEYWORDS, NULL},
#if NPY_API_VERSION >= 0x00000008
{"at",
(PyCFunction)dufunc_at,
METH_VARARGS, NULL},
#endif
{"_compile_for_args",
(PyCFunction)dufunc__compile_for_args,
METH_VARARGS | METH_KEYWORDS,
Expand Down Expand Up @@ -664,11 +666,9 @@ static struct PyMethodDef dufunc_methods_fast[] = {
{"outer",
(PyCFunction)dufunc_outer_fast,
METH_FASTCALL | METH_KEYWORDS, NULL},
#if NPY_API_VERSION >= 0x00000008
{"at",
(PyCFunction)dufunc_at,
METH_VARARGS, NULL},
#endif
{"_compile_for_args",
(PyCFunction)dufunc__compile_for_args,
METH_VARARGS | METH_KEYWORDS,
Expand Down Expand Up @@ -837,9 +837,7 @@ MOD_INIT(_internal)
if (PyModule_AddIntMacro(m, PyUFunc_One)
|| PyModule_AddIntMacro(m, PyUFunc_Zero)
|| PyModule_AddIntMacro(m, PyUFunc_None)
#if NPY_API_VERSION >= 0x00000007
|| PyModule_AddIntMacro(m, PyUFunc_ReorderableNone)
#endif
)
return MOD_ERROR_VAL;

Expand Down
Loading