Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into guilhermeleobas/exc…
Browse files Browse the repository at this point in the history
…eption-handling
  • Loading branch information
guilhermeleobas committed Mar 7, 2023
2 parents c0d8a7f + 7cab2c4 commit af82ab9
Show file tree
Hide file tree
Showing 51 changed files with 1,404 additions and 252 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,25 @@ jobs:
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v7
with:
# issues
stale-issue-message: >
This issue is marked as stale as it has had no activity in the past
30 days. Please close this issue if no further response or action is
needed. Otherwise, please respond with any updates and confirm that
this issue still needs to be addressed.
stale-issue-label: 'stale'
any-of-labels: 'question,needtriage,more info needed'
any-of-issue-labels: 'question,needtriage,more info needed'
days-before-issue-stale: 30
days-before-issue-close: 7
# pull requests
stale-pr-message: >
This pull request is marked as stale as it has had no activity in
the past 3 months. Please respond to this comment if you're still
interested in working on this. Many thanks!
days-before-pr-stale: 90 # 3 months
days-before-pr-close: 7
any-of-pr-labels: '2 - In progress,4 - Waiting on author'
stale-pr-label: 'stale'
close-pr-label: 'abandoned - stale'
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
1 change: 1 addition & 0 deletions buildscripts/gpuci/axis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CUDA_TOOLKIT_VER:
- "11.1"
- "11.2"
- "11.5"
- "11.8"

LINUX_VER:
- ubuntu18.04
Expand Down
23 changes: 21 additions & 2 deletions buildscripts/gpuci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,29 @@ else
export NUMBA_CUDA_USE_NVIDIA_BINDING=0;
fi;

# Test with Minor Version Compatibility on CUDA 11.8
if [ $CUDA_TOOLKIT_VER == "11.8" ]
then
export NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY=1;
else
export NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY=0;
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.21" ["11.2"]="1.22" ["11.5"]="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 @@ -46,8 +63,10 @@ gpuci_logger "Create testing env"
gpuci_mamba_retry create -n numba_ci -y \
"python=${PYTHON_VER}" \
"cudatoolkit=${CUDA_TOOLKIT_VER}" \
"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/cuda-reference/kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ creating a specialized instance:
.. autoclass:: numba.cuda.dispatcher.CUDADispatcher
:members: inspect_asm, inspect_llvm, inspect_sass, inspect_types,
get_regs_per_thread, specialize, specialized, extensions, forall,
get_shared_mem_per_block, get_const_mem_size,
get_local_mem_per_thread
get_shared_mem_per_block, get_max_threads_per_block,
get_const_mem_size, get_local_mem_per_thread



Expand Down
1 change: 1 addition & 0 deletions docs/source/cuda/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ Numba for CUDA GPUs
bindings.rst
cuda_ffi.rst
caching.rst
minor_version_compatibility.rst
faq.rst
64 changes: 64 additions & 0 deletions docs/source/cuda/minor_version_compatibility.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.. _minor-version-compatibility:

CUDA Minor Version Compatiblity
===============================

CUDA `Minor Version Compatibility
<https://docs.nvidia.com/deploy/cuda-compatibility/index.html#minor-version-compatibility>`_
(MVC) enables the use of a newer CUDA toolkit version than the CUDA version
supported by the driver, provided that the toolkit and driver both have the same
major version. For example, use of CUDA toolkit 11.5 with CUDA driver 450 (CUDA
version 11.0) is supported through MVC.

Numba supports MVC for CUDA 11 on Linux using the external ``cubinlinker`` and
``ptxcompiler`` packages, subject to the following limitations:

- Linking of archives is unsupported.
- Cooperative Groups are unsupported, because they require an archive to be
linked.

MVC is not supported on Windows.


Enabling MVC Support
--------------------

To use MVC support, the ``cubinlinker`` and ``ptxcompiler`` compiler packages
must be installed from the appropriate channels. To install using conda, use:

.. code:: bash
conda install rapidsai::cubinlinker conda-forge::ptxcompiler
To install with pip, use the NVIDIA package index:

.. code:: bash
pip install ptxcompiler-cu11 cubinlinker-cu11 --extra-index-url=https://pypi.ngc.nvidia.com
MVC support is enabled by setting the environment variable:

.. code:: bash
export NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY=1
or by setting a configuration variable prior to using any CUDA functionality in
Numba:

.. code:: python
from numba import config
config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY = True
References
----------

Further information about Minor Version Compatibility may be found in:

- The `CUDA Compatibility Guide
<https://docs.nvidia.com/deploy/cuda-compatibility/index.html>`_.
- The `README for ptxcompiler
<https://github.com/rapidsai/ptxcompiler/blob/main/README.md>`_.

4 changes: 2 additions & 2 deletions docs/source/cuda/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Software
--------

Numba aims to support CUDA Toolkit versions released within the last 3 years.
An NVIDIA driver sufficient for the toolkit version is also required.
Presently:
An NVIDIA driver sufficient for the toolkit version is also required (see also
:ref:`minor-version-compatibility`). Presently:

* 11.0 is the minimum required toolkit version.
* 11.2 or later is recommended, as it uses an NVVM version based on LLVM 7 (as
Expand Down
Loading

0 comments on commit af82ab9

Please sign in to comment.