diff --git a/CHANGE_LOG b/CHANGE_LOG index d40e2598f88..0d557e25841 100644 --- a/CHANGE_LOG +++ b/CHANGE_LOG @@ -1,3 +1,23 @@ +Version 0.56.3 (13 October, 2022) +--------------------------------- + +This is a bugfix release to remove the version restriction applied to the +``setuptools`` package and to fix a bug in the CUDA target in relation to +copying zero length device arrays to zero length host arrays. + +Pull-Requests: + +* PR `#8475 `_: Remove setuptools version pin (`gmarkall `_) +* PR `#8482 `_: Fix #8477: Allow copies with different strides for 0-length data (`gmarkall `_) +* PR `#8486 `_: Restrict the TBB development package to supported version in Azure. (`stuartarchibald `_) +* PR `#8503 `_: Update version support table for 0.56.3 (`stuartarchibald `_) +* PR `#8504 `_: Update CHANGE_LOG for 0.56.3 (`stuartarchibald `_) + +Authors: + +* `gmarkall `_ +* `stuartarchibald `_ + Version 0.56.2 (1 September, 2022) ---------------------------------- diff --git a/buildscripts/azure/azure-windows.yml b/buildscripts/azure/azure-windows.yml index c7946c0a188..aa38d8b3273 100644 --- a/buildscripts/azure/azure-windows.yml +++ b/buildscripts/azure/azure-windows.yml @@ -29,12 +29,6 @@ jobs: buildscripts\\incremental\\setup_conda_environment.cmd displayName: 'Before Install' - - script: | - # use TBB - call activate %CONDA_ENV% - conda install -y -c numba tbb=2021 tbb-devel - displayName: 'Add in TBB' - - script: | buildscripts\\incremental\\build.cmd displayName: 'Build' diff --git a/buildscripts/condarecipe.local/meta.yaml b/buildscripts/condarecipe.local/meta.yaml index a43d4c9a116..ad94a68964f 100644 --- a/buildscripts/condarecipe.local/meta.yaml +++ b/buildscripts/condarecipe.local/meta.yaml @@ -32,7 +32,7 @@ requirements: host: - python - numpy - - setuptools <60 + - setuptools - importlib_metadata # [py<39] # On channel https://anaconda.org/numba/ - llvmlite 0.39.* @@ -46,7 +46,7 @@ requirements: - python >=3.7 # NumPy 1.22.0, 1.22.1, 1.22.2 are all broken for ufuncs, see #7756 - numpy >=1.18, !=1.22.0, !=1.22.1, !=1.22.2, <1.24 - - setuptools <60 + - setuptools - importlib_metadata # [py<39] # On channel https://anaconda.org/numba/ - llvmlite 0.39.* @@ -76,7 +76,7 @@ test: # temporarily disable scipy testing on ARM, need to build out more packages - scipy # [not (armv6l or armv7l)] - ipython # [not (armv6l or armv7l or aarch64)] - - setuptools <60 + - setuptools - tbb >=2021 # [not (armv6l or armv7l or aarch64 or linux32 or ppc64le)] - llvm-openmp # [osx] # This is for driving gdb tests diff --git a/buildscripts/gpuci/build.sh b/buildscripts/gpuci/build.sh index 9dcde3bc258..1088b1eebe4 100644 --- a/buildscripts/gpuci/build.sh +++ b/buildscripts/gpuci/build.sh @@ -46,7 +46,7 @@ gpuci_mamba_retry create -n numba_ci -y \ "psutil" \ "gcc_linux-64=7" \ "gxx_linux-64=7" \ - "setuptools<60" + "setuptools" conda activate numba_ci diff --git a/buildscripts/incremental/setup_conda_environment.cmd b/buildscripts/incremental/setup_conda_environment.cmd index 91676a1307c..1a4ecb7c78c 100644 --- a/buildscripts/incremental/setup_conda_environment.cmd +++ b/buildscripts/incremental/setup_conda_environment.cmd @@ -22,7 +22,7 @@ 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 jinja2 ipython gitpython pyyaml "setuptools<60" +conda create -n %CONDA_ENV% -q -y python=%PYTHON% numpy=%NUMPY% cffi pip jinja2 ipython gitpython pyyaml call activate %CONDA_ENV% @rem Scipy comes from conda-forge for NumPy 1.23 @@ -36,7 +36,7 @@ if "%BUILD_DOC%" == "yes" (%CONDA_INSTALL% sphinx sphinx_rtd_theme pygments) @rem Install dependencies for code coverage (codecov.io) if "%RUN_COVERAGE%" == "yes" (%PIP_INSTALL% codecov) @rem Install TBB -%CONDA_INSTALL% -c numba tbb=2021 tbb-devel +%CONDA_INSTALL% -c numba tbb=2021 "tbb-devel>=2021,<2021.6" if %errorlevel% neq 0 exit /b %errorlevel% echo "DEBUG ENV:" diff --git a/buildscripts/incremental/setup_conda_environment.sh b/buildscripts/incremental/setup_conda_environment.sh index 08a1876b6d2..943c428ade1 100755 --- a/buildscripts/incremental/setup_conda_environment.sh +++ b/buildscripts/incremental/setup_conda_environment.sh @@ -43,7 +43,7 @@ conda list if [[ "$CONDA_SUBDIR" == "linux-32" || "$BITS32" == "yes" ]]; then conda create -n $CONDA_ENV -q -y ${EXTRA_CHANNELS} python=$PYTHON pip gitpython pyyaml else - conda create -n $CONDA_ENV -q -y ${EXTRA_CHANNELS} python=$PYTHON numpy=$NUMPY pip gitpython pyyaml "setuptools<60" + conda create -n $CONDA_ENV -q -y ${EXTRA_CHANNELS} python=$PYTHON numpy=$NUMPY pip gitpython pyyaml fi # Activate first @@ -104,7 +104,7 @@ if [ "$RUN_COVERAGE" == "yes" ]; then $PIP_INSTALL codecov; fi # Install SVML if [ "$TEST_SVML" == "yes" ]; then $CONDA_INSTALL -c numba icc_rt; fi # Install Intel TBB parallel backend -if [ "$TEST_THREADING" == "tbb" ]; then $CONDA_INSTALL -c numba tbb=2021 tbb-devel; fi +if [ "$TEST_THREADING" == "tbb" ]; then $CONDA_INSTALL -c numba tbb=2021 "tbb-devel>=2021,<2021.6"; fi # Install pickle5 if [ "$TEST_PICKLE5" == "yes" ]; then $PIP_INSTALL pickle5; fi # Install typeguard diff --git a/docs/environment.yml b/docs/environment.yml index b392a421149..8028a33660c 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -9,7 +9,7 @@ dependencies: - llvmlite=0.39 - numpy - numpydoc - - setuptools<60 + - setuptools # https://stackoverflow.com/questions/67542699/readthedocs-sphinx-not-rendering-bullet-list-from-rst-fileA - docutils==0.16 # The following is needed to fix RTD. diff --git a/docs/source/user/installing.rst b/docs/source/user/installing.rst index 8f6765c078b..f4520025720 100644 --- a/docs/source/user/installing.rst +++ b/docs/source/user/installing.rst @@ -194,14 +194,14 @@ vary with target operating system and hardware. The following lists them all * Required build time: - * ``setuptools<60`` + * ``setuptools`` * ``numpy`` * ``llvmlite`` * Compiler toolchain mentioned above * Required run time: - * ``setuptools<60`` + * ``setuptools`` * ``numpy`` * ``llvmlite`` @@ -278,6 +278,8 @@ information. +===========+==============+===========================+============================+==============================+===================+=============================+ | 0.57.x | TBC | 3.8.x <= version < 3.12 | 1.19 <= version < 1.24 | 0.40.x | 11.x | 2021.x | +-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+ +| 0.56.3 | 2022-10-13 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.24 | 0.39.x | 11.x | 2021.x | ++-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+ | 0.56.2 | 2022-09-01 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.24 | 0.39.x | 11.x | 2021.x | +-----------+--------------+---------------------------+----------------------------+------------------------------+-------------------+-----------------------------+ | 0.56.0 | 2022-07-25 | 3.7.x <= version < 3.11 | 1.18 <= version < 1.23 | 0.39.x | 11.x | 2021.x | diff --git a/numba/cuda/cudadrv/devicearray.py b/numba/cuda/cudadrv/devicearray.py index 651f06bf698..21adaa94cf3 100644 --- a/numba/cuda/cudadrv/devicearray.py +++ b/numba/cuda/cudadrv/devicearray.py @@ -895,6 +895,8 @@ def check_array_compatibility(ary1, ary2): if ary1sq.shape != ary2sq.shape: raise ValueError('incompatible shape: %s vs. %s' % (ary1.shape, ary2.shape)) - if ary1sq.strides != ary2sq.strides: + # We check strides only if the size is nonzero, because strides are + # irrelevant (and can differ) for zero-length copies. + if ary1.size and ary1sq.strides != ary2sq.strides: raise ValueError('incompatible strides: %s vs. %s' % (ary1.strides, ary2.strides)) diff --git a/numba/cuda/tests/cudadrv/test_cuda_ndarray.py b/numba/cuda/tests/cudadrv/test_cuda_ndarray.py index d84d297ebca..1e674df7aca 100644 --- a/numba/cuda/tests/cudadrv/test_cuda_ndarray.py +++ b/numba/cuda/tests/cudadrv/test_cuda_ndarray.py @@ -420,6 +420,41 @@ def test_bug6697(self): got = np.asarray(dary) self.assertEqual(got.dtype, dary.dtype) + @skip_on_cudasim('DeviceNDArray class not present in simulator') + def test_issue_8477(self): + # Ensure that we can copy a zero-length device array to a zero-length + # host array when the strides of the device and host arrays differ - + # this should be possible because the strides are irrelevant when the + # length is zero. For more info see + # https://github.com/numba/numba/issues/8477. + + # Create a device array with shape (0,) and strides (8,) + dev_array = devicearray.DeviceNDArray(shape=(0,), strides=(8,), + dtype=np.int8) + + # Create a host array with shape (0,) and strides (0,) + host_array = np.ndarray(shape=(0,), strides=(0,), dtype=np.int8) + + # Sanity check for this test - ensure our destination has the strides + # we expect, because strides can be ignored in some cases by the + # ndarray constructor - checking here ensures that we haven't failed to + # account for unexpected behaviour across different versions of NumPy + self.assertEqual(host_array.strides, (0,)) + + # Ensure that the copy succeeds in both directions + dev_array.copy_to_host(host_array) + dev_array.copy_to_device(host_array) + + # Ensure that a device-to-device copy also succeeds when the strides + # differ - one way of doing this is to copy the host array across and + # use that for copies in both directions. + dev_array_from_host = cuda.to_device(host_array) + self.assertEqual(dev_array_from_host.shape, (0,)) + self.assertEqual(dev_array_from_host.strides, (0,)) + + dev_array.copy_to_device(dev_array_from_host) + dev_array_from_host.copy_to_device(dev_array) + class TestRecarray(CUDATestCase): def test_recarray(self): diff --git a/numba/testing/main.py b/numba/testing/main.py index 64cab7c92b6..7d9a48b885e 100644 --- a/numba/testing/main.py +++ b/numba/testing/main.py @@ -207,7 +207,8 @@ def git_diff_str(x): parser.add_argument('-g', '--gitdiff', dest='gitdiff', type=git_diff_str, default=False, nargs='?', help=('Run tests from changes made against ' - 'origin/main as identified by `git diff`. ' + 'origin/release0.56 as identified by' + '`git diff`. ' 'If set to "ancestor", the diff compares ' 'against the common ancestor.')) return parser @@ -399,9 +400,9 @@ def _choose_gitdiff_tests(tests, *, use_common_ancestor=False): path = os.path.join('numba', 'tests') if use_common_ancestor: print(f"Git diff by common ancestor") - target = 'origin/main...HEAD' + target = 'origin/release0.56...HEAD' else: - target = 'origin/main..HEAD' + target = 'origin/release0.56..HEAD' gdiff_paths = repo.git.diff(target, path, name_only=True).split() # normalise the paths as they are unix style from repo.git.diff gdiff_paths = [os.path.normpath(x) for x in gdiff_paths] diff --git a/setup.py b/setup.py index 2a6d122775d..68feca4b227 100644 --- a/setup.py +++ b/setup.py @@ -375,7 +375,7 @@ def check_file_at_path(path2file): install_requires = [ 'llvmlite >={},<{}'.format(min_llvmlite_version, max_llvmlite_version), 'numpy >={},<{}'.format(min_numpy_run_version, max_numpy_run_version), - 'setuptools<60', + 'setuptools', 'importlib_metadata; python_version < "3.9"', ]