Skip to content

Commit

Permalink
Merge pull request #8505 from stuartarchibald/wip/cherry_pick_056_3
Browse files Browse the repository at this point in the history
Cherry picks for 0.56.3
  • Loading branch information
esc committed Oct 12, 2022
2 parents d6731f6 + 1fbf3fc commit 6982acd
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 22 deletions.
20 changes: 20 additions & 0 deletions 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 <https://github.com/numba/numba/pull/8475>`_: Remove setuptools version pin (`gmarkall <https://github.com/gmarkall>`_)
* PR `#8482 <https://github.com/numba/numba/pull/8482>`_: Fix #8477: Allow copies with different strides for 0-length data (`gmarkall <https://github.com/gmarkall>`_)
* PR `#8486 <https://github.com/numba/numba/pull/8486>`_: Restrict the TBB development package to supported version in Azure. (`stuartarchibald <https://github.com/stuartarchibald>`_)
* PR `#8503 <https://github.com/numba/numba/pull/8503>`_: Update version support table for 0.56.3 (`stuartarchibald <https://github.com/stuartarchibald>`_)
* PR `#8504 <https://github.com/numba/numba/pull/8504>`_: Update CHANGE_LOG for 0.56.3 (`stuartarchibald <https://github.com/stuartarchibald>`_)

Authors:

* `gmarkall <https://github.com/gmarkall>`_
* `stuartarchibald <https://github.com/stuartarchibald>`_

Version 0.56.2 (1 September, 2022)
----------------------------------

Expand Down
6 changes: 0 additions & 6 deletions buildscripts/azure/azure-windows.yml
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions buildscripts/condarecipe.local/meta.yaml
Expand Up @@ -32,7 +32,7 @@ requirements:
host:
- python
- numpy
- setuptools <60
- setuptools
- importlib_metadata # [py<39]
# On channel https://anaconda.org/numba/
- llvmlite 0.39.*
Expand All @@ -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.*
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/gpuci/build.sh
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions buildscripts/incremental/setup_conda_environment.cmd
Expand Up @@ -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
Expand All @@ -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:"
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/incremental/setup_conda_environment.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/environment.yml
Expand Up @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions docs/source/user/installing.rst
Expand Up @@ -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``

Expand Down Expand Up @@ -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 |
Expand Down
4 changes: 3 additions & 1 deletion numba/cuda/cudadrv/devicearray.py
Expand Up @@ -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))
35 changes: 35 additions & 0 deletions numba/cuda/tests/cudadrv/test_cuda_ndarray.py
Expand Up @@ -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):
Expand Down
7 changes: 4 additions & 3 deletions numba/testing/main.py
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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"',
]

Expand Down

0 comments on commit 6982acd

Please sign in to comment.