From 3c6e839c29bf0cd4d30ccdc2ebcd851aa0f6ba03 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 12:30:04 +0100 Subject: [PATCH 01/18] Fixes for adding data to link - The kind of LTO-IR should have been based on the file extension map, not the string `"ltoir"`. - The `add-data()` method was unimplemented for the Ctypes linker. I have left it unimplemented in the `MVCLinker` and `CudaPythonLinker` as the functionality is not needed immediately in these linkers, and they will eventually be removed. - Add a test of adding data to the link via the active code library for all kinds of linkable code. --- numba_cuda/numba/cuda/cudadrv/driver.py | 65 ++++++++++++-- .../numba/cuda/cudadrv/linkable_code.py | 2 +- .../numba/cuda/tests/cudapy/test_extending.py | 86 +++++++++++++++++++ .../test_device_functions.cu | 4 + 4 files changed, 148 insertions(+), 9 deletions(-) diff --git a/numba_cuda/numba/cuda/cudadrv/driver.py b/numba_cuda/numba/cuda/cudadrv/driver.py index 2741d6ae7..86113565b 100644 --- a/numba_cuda/numba/cuda/cudadrv/driver.py +++ b/numba_cuda/numba/cuda/cudadrv/driver.py @@ -2797,6 +2797,10 @@ def add_cu(self, cu, name): ptx_name = os.path.splitext(name)[0] + ".ptx" self.add_ptx(ptx.encode(), ptx_name) + @abstractmethod + def add_data(self, data, kind, name): + """Add in-memory data to the link""" + @abstractmethod def add_file(self, path, kind): """Add code from a file to the link""" @@ -2948,6 +2952,10 @@ def add_ptx(self, ptx, name=""): except CubinLinkerError as e: raise LinkerError from e + def add_data(self, data, kind, name): + msg = "Adding in-memory data unsupported in the MVC linker" + raise LinkerError(msg) + def add_file(self, path, kind): try: from cubinlinker import CubinLinkerError @@ -3046,17 +3054,32 @@ def info_log(self): def error_log(self): return self.linker_errors_buf.value.decode("utf8") - def add_ptx(self, ptx, name=""): - ptxbuf = c_char_p(ptx) - namebuf = c_char_p(name.encode("utf8")) - self._keep_alive += [ptxbuf, namebuf] + def add_cubin(self, cubin, name=""): + return self._add_data(enums.CU_JIT_INPUT_CUBIN, cubin, name) + + def add_ptx(self, ptx, name=""): + return self._add_data(enums.CU_JIT_INPUT_PTX, ptx, name) + + def add_object(self, object_, name=""): + return self._add_data(enums.CU_JIT_INPUT_OBJECT, object_, name) + + def add_fatbin(self, fatbin, name=""): + return self._add_data(enums.CU_JIT_INPUT_FATBINARY, fatbin, name) + + def add_library(self, library, name=""): + return self._add_data(enums.CU_JIT_INPUT_LIBRARY, library, name) + + def _add_data(self, input_type, data, name): + data_buffer = c_char_p(data) + name_buffer = c_char_p(name.encode("utf8")) + self._keep_alive += [data_buffer, name_buffer] try: driver.cuLinkAddData( self.handle, - enums.CU_JIT_INPUT_PTX, - ptxbuf, - len(ptx), - namebuf, + input_type, + data_buffer, + len(data), + name_buffer, 0, None, None, @@ -3064,6 +3087,28 @@ def add_ptx(self, ptx, name=""): except CudaAPIError as e: raise LinkerError("%s\n%s" % (e, self.error_log)) + def add_data(self, data, kind, name=None): + # We pass the name as **kwargs to ensure the default name for the input + # type is used if none is supplied + kws = {} + if name is not None: + kws["name"] = name + + if kind == FILE_EXTENSION_MAP["cubin"]: + self.add_cubin(data, **kws) + elif kind == FILE_EXTENSION_MAP["fatbin"]: + self.add_fatbin(data, **kws) + elif kind == FILE_EXTENSION_MAP["a"]: + self.add_library(data, **kws) + elif kind == FILE_EXTENSION_MAP["ptx"]: + self.add_ptx(data, **kws) + elif kind == FILE_EXTENSION_MAP["o"]: + self.add_object(data, **kws) + elif kind == FILE_EXTENSION_MAP["ltoir"]: + raise LinkerError("Ctypes linker cannot link LTO-IR") + else: + raise LinkerError(f"Don't know how to link {kind}") + def add_file(self, path, kind): pathbuf = c_char_p(path.encode("utf8")) self._keep_alive.append(pathbuf) @@ -3162,6 +3207,10 @@ def add_ptx(self, ptx, name=""): except CudaAPIError as e: raise LinkerError("%s\n%s" % (e, self.error_log)) + def add_data(self, data, kind, name): + msg = "Adding in-memory data unsupported in the CUDA Python linker" + raise LinkerError(msg) + def add_file(self, path, kind): pathbuf = path.encode("utf8") self._keep_alive.append(pathbuf) diff --git a/numba_cuda/numba/cuda/cudadrv/linkable_code.py b/numba_cuda/numba/cuda/cudadrv/linkable_code.py index 15aab3fe2..244a51741 100644 --- a/numba_cuda/numba/cuda/cudadrv/linkable_code.py +++ b/numba_cuda/numba/cuda/cudadrv/linkable_code.py @@ -87,5 +87,5 @@ class Object(LinkableCode): class LTOIR(LinkableCode): """An LTOIR file in memory.""" - kind = "ltoir" + kind = FILE_EXTENSION_MAP["ltoir"] default_name = "" diff --git a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py index 8d3028d0c..57fa21dd6 100644 --- a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py +++ b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py @@ -1,6 +1,8 @@ from numba.cuda.testing import skip_on_cudasim, unittest, CUDATestCase +from llvmlite import ir import numpy as np +import os from numba import config, cuda, njit, types @@ -160,5 +162,89 @@ def f(r, x): np.testing.assert_allclose(r, expected) +TEST_BIN_DIR = os.getenv("NUMBA_CUDA_TEST_BIN_DIR") +if TEST_BIN_DIR: + test_device_functions_a = os.path.join( + TEST_BIN_DIR, "test_device_functions.a" + ) + test_device_functions_cubin = os.path.join( + TEST_BIN_DIR, "test_device_functions.cubin" + ) + test_device_functions_cu = os.path.join( + TEST_BIN_DIR, "test_device_functions.cu" + ) + test_device_functions_fatbin = os.path.join( + TEST_BIN_DIR, "test_device_functions.fatbin" + ) + test_device_functions_fatbin_multi = os.path.join( + TEST_BIN_DIR, "test_device_functions_multi.fatbin" + ) + test_device_functions_o = os.path.join( + TEST_BIN_DIR, "test_device_functions.o" + ) + test_device_functions_ptx = os.path.join( + TEST_BIN_DIR, "test_device_functions.ptx" + ) + test_device_functions_ltoir = os.path.join( + TEST_BIN_DIR, "test_device_functions.ltoir" + ) + + +class TestExtendingLinkage(CUDATestCase): + def test_extension_adds_linkable_code(self): + files = ( + (test_device_functions_a, cuda.Archive), + (test_device_functions_cubin, cuda.Cubin), + (test_device_functions_cu, cuda.CUSource), + (test_device_functions_fatbin, cuda.Fatbin), + (test_device_functions_o, cuda.Object), + (test_device_functions_ptx, cuda.PTXSource), + (test_device_functions_ltoir, cuda.LTOIR), + ) + + lto = config.CUDA_ENABLE_PYNVJITLINK + + for path, ctor in files: + if ctor == cuda.LTOIR and not lto: + # Don't try to test with LTOIR if LTO is not enabled + continue + + with open(path, "rb") as f: + code_object = ctor(f.read()) + + def external_add(x, y): + return x + y + + @type_callable(external_add) + def type_external_add(context): + def typer(x, y): + if x == types.uint32 and y == types.uint32: + return types.uint32 + + return typer + + @lower_builtin(external_add, types.uint32, types.uint32) + def lower_external_add(context, builder, sig, args): + context.active_code_library.add_linking_file(code_object) + i32 = ir.IntType(32) + fnty = ir.FunctionType(i32, [i32, i32]) + fn = cgutils.get_or_insert_function( + builder.module, fnty, "add_cabi" + ) + return builder.call(fn, args) + + @cuda.jit(lto=lto) + def use_external_add(r, x, y): + r[0] = external_add(x[0], y[0]) + + r = np.zeros(1, dtype=np.uint32) + x = np.ones(1, dtype=np.uint32) + y = np.ones(1, dtype=np.uint32) * 2 + + use_external_add[1, 1](r, x, y) + + np.testing.assert_equal(r[0], 3) + + if __name__ == "__main__": unittest.main() diff --git a/numba_cuda/numba/cuda/tests/test_binary_generation/test_device_functions.cu b/numba_cuda/numba/cuda/tests/test_binary_generation/test_device_functions.cu index f1499dc69..20c66f234 100644 --- a/numba_cuda/numba/cuda/tests/test_binary_generation/test_device_functions.cu +++ b/numba_cuda/numba/cuda/tests/test_binary_generation/test_device_functions.cu @@ -17,3 +17,7 @@ extern "C" __device__ int add_from_numba(uint32_t *result, uint32_t a, *result = a + b; return 0; } + +extern "C" __device__ uint32_t add_cabi(uint32_t a, uint32_t b) { + return a + b; +} From eb3051f8d7078457df20f6094dfa2203911e2b88 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 12:52:10 +0100 Subject: [PATCH 02/18] Support `add_data()` in the `CudaPythonLinker` This was relatively easy to add and fills a gap, so it's been done. --- numba_cuda/numba/cuda/cudadrv/driver.py | 53 +++++++++++++++++++++---- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/numba_cuda/numba/cuda/cudadrv/driver.py b/numba_cuda/numba/cuda/cudadrv/driver.py index 86113565b..5b17db54c 100644 --- a/numba_cuda/numba/cuda/cudadrv/driver.py +++ b/numba_cuda/numba/cuda/cudadrv/driver.py @@ -3196,20 +3196,57 @@ def info_log(self): def error_log(self): return self.linker_errors_buf.decode("utf8") - def add_ptx(self, ptx, name=""): - namebuf = name.encode("utf8") - self._keep_alive += [ptx, namebuf] + def add_cubin(self, cubin, name=""): + input_type = binding.CUjitInputType.CU_JIT_INPUT_CUBIN + return self._add_data(input_type, cubin, name) + + def add_ptx(self, ptx, name=""): + input_type = binding.CUjitInputType.CU_JIT_INPUT_PTX + return self._add_data(input_type, ptx, name) + + def add_object(self, object_, name=""): + input_type = binding.CUjitInputType.CU_JIT_INPUT_OBJECT + return self._add_data(input_type, object_, name) + + def add_fatbin(self, fatbin, name=""): + input_type = binding.CUjitInputType.CU_JIT_INPUT_FATBINARY + return self._add_data(input_type, fatbin, name) + + def add_library(self, library, name=""): + input_type = binding.CUjitInputType.CU_JIT_INPUT_LIBRARY + return self._add_data(input_type, library, name) + + def _add_data(self, input_type, data, name): + name_buffer = name.encode("utf8") + self._keep_alive += [data, name_buffer] try: - input_ptx = binding.CUjitInputType.CU_JIT_INPUT_PTX driver.cuLinkAddData( - self.handle, input_ptx, ptx, len(ptx), namebuf, 0, [], [] + self.handle, input_type, data, len(data), name_buffer, 0, [], [] ) except CudaAPIError as e: raise LinkerError("%s\n%s" % (e, self.error_log)) - def add_data(self, data, kind, name): - msg = "Adding in-memory data unsupported in the CUDA Python linker" - raise LinkerError(msg) + def add_data(self, data, kind, name=None): + # We pass the name as **kwargs to ensure the default name for the input + # type is used if none is supplied + kws = {} + if name is not None: + kws["name"] = name + + if kind == FILE_EXTENSION_MAP["cubin"]: + self.add_cubin(data, **kws) + elif kind == FILE_EXTENSION_MAP["fatbin"]: + self.add_fatbin(data, **kws) + elif kind == FILE_EXTENSION_MAP["a"]: + self.add_library(data, **kws) + elif kind == FILE_EXTENSION_MAP["ptx"]: + self.add_ptx(data, **kws) + elif kind == FILE_EXTENSION_MAP["o"]: + self.add_object(data, **kws) + elif kind == FILE_EXTENSION_MAP["ltoir"]: + raise LinkerError("Ctypes linker cannot link LTO-IR") + else: + raise LinkerError(f"Don't know how to link {kind}") def add_file(self, path, kind): pathbuf = path.encode("utf8") From 04ace102233171fb71400cadd4bf52df57463c7f Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 12:55:15 +0100 Subject: [PATCH 03/18] Build test binaries for test_conda and test_wheel --- ci/test_conda.sh | 16 ++++++++++++++++ ci/test_wheel.sh | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ci/test_conda.sh b/ci/test_conda.sh index 2f86e4f1e..f9aaae7b4 100755 --- a/ci/test_conda.sh +++ b/ci/test_conda.sh @@ -53,6 +53,22 @@ EXITCODE=0 trap "EXITCODE=1" ERR set +e +rapids-logger "Build tests" + +PY_SCRIPT=" +import numba_cuda +root = numba_cuda.__file__.rstrip('__init__.py') +test_dir = root + \"numba/cuda/tests/test_binary_generation/\" +print(test_dir) +" + +NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") +pushd $NUMBA_CUDA_TEST_BIN_DIR +make +popd + + + rapids-logger "Run Tests" python -m numba.runtests numba.cuda.tests -v diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 071c3ea8e..69545d037 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -11,6 +11,19 @@ python -m pip install \ cuda-python \ pytest +rapids-logger "Build tests" +PY_SCRIPT=" +import numba_cuda +root = numba_cuda.__file__.rstrip('__init__.py') +test_dir = root + \"numba/cuda/tests/test_binary_generation/\" +print(test_dir) +" + +NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") +pushd $NUMBA_CUDA_TEST_BIN_DIR +make +popd + rapids-logger "Install wheel" package=$(realpath wheel/numba_cuda*.whl) echo "Wheel path: $package" From b13bb17510f7d9b97bd76c4e80202f35e461a1a7 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 13:46:59 +0100 Subject: [PATCH 04/18] Export NUMBA_CUDA_TEST_BIN_DIR for test_conda and test_wheels --- ci/test_conda.sh | 2 +- ci/test_wheel.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test_conda.sh b/ci/test_conda.sh index f9aaae7b4..d2e29d69b 100755 --- a/ci/test_conda.sh +++ b/ci/test_conda.sh @@ -62,7 +62,7 @@ test_dir = root + \"numba/cuda/tests/test_binary_generation/\" print(test_dir) " -NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") +export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") pushd $NUMBA_CUDA_TEST_BIN_DIR make popd diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 69545d037..9d169b5bb 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -19,7 +19,7 @@ test_dir = root + \"numba/cuda/tests/test_binary_generation/\" print(test_dir) " -NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") +export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") pushd $NUMBA_CUDA_TEST_BIN_DIR make popd From a050633692c6fe6d40da19c983e08ab7d4774791 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 16:18:24 +0100 Subject: [PATCH 05/18] Skip in-memory data link tests on CUDA 11 --- ci/test_conda.sh | 17 ++++++++++------ ci/test_wheel.sh | 20 +++++++++++++------ .../numba/cuda/tests/cudapy/test_extending.py | 3 +++ 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/ci/test_conda.sh b/ci/test_conda.sh index d2e29d69b..3048edba9 100755 --- a/ci/test_conda.sh +++ b/ci/test_conda.sh @@ -53,20 +53,25 @@ EXITCODE=0 trap "EXITCODE=1" ERR set +e -rapids-logger "Build tests" -PY_SCRIPT=" +GET_TEST_BINARY_DIR=" import numba_cuda root = numba_cuda.__file__.rstrip('__init__.py') test_dir = root + \"numba/cuda/tests/test_binary_generation/\" print(test_dir) " -export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") -pushd $NUMBA_CUDA_TEST_BIN_DIR -make -popd +if [ "${CUDA_VER_MAJOR_MINOR%.*}" == "11" ] +then + rapids-logger "Skipping test build for CUDA 11" +else + rapids-logger "Build tests" + export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$GET_TEST_BINARY_DIR") + pushd $NUMBA_CUDA_TEST_BIN_DIR + make + popd +fi rapids-logger "Run Tests" diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 9d169b5bb..95c8abb55 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -11,18 +11,26 @@ python -m pip install \ cuda-python \ pytest -rapids-logger "Build tests" -PY_SCRIPT=" + +GET_TEST_BINARY_DIR=" import numba_cuda root = numba_cuda.__file__.rstrip('__init__.py') test_dir = root + \"numba/cuda/tests/test_binary_generation/\" print(test_dir) " -export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$PY_SCRIPT") -pushd $NUMBA_CUDA_TEST_BIN_DIR -make -popd +if [ "${CUDA_VER_MAJOR_MINOR%.*}" == "11" ] +then + rapids-logger "Skipping test build for CUDA 11" +else + rapids-logger "Build tests" + + export NUMBA_CUDA_TEST_BIN_DIR=$(python -c "$GET_TEST_BINARY_DIR") + pushd $NUMBA_CUDA_TEST_BIN_DIR + make + popd +fi + rapids-logger "Install wheel" package=$(realpath wheel/numba_cuda*.whl) diff --git a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py index 57fa21dd6..58f1790ce 100644 --- a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py +++ b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py @@ -202,6 +202,9 @@ def test_extension_adds_linkable_code(self): (test_device_functions_ltoir, cuda.LTOIR), ) + if cuda.runtime.get_version[0] < 12: + unittest.skip("CUDA 12 required for linking in-memory data") + lto = config.CUDA_ENABLE_PYNVJITLINK for path, ctor in files: From 36de92a6c3b7efc08bfd4a2711e1ba874c2d1ac8 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 16:39:22 +0100 Subject: [PATCH 06/18] Add missing variable to CI scripts --- ci/test_conda.sh | 1 + ci/test_wheel.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/ci/test_conda.sh b/ci/test_conda.sh index 3048edba9..2907c5f8e 100755 --- a/ci/test_conda.sh +++ b/ci/test_conda.sh @@ -61,6 +61,7 @@ test_dir = root + \"numba/cuda/tests/test_binary_generation/\" print(test_dir) " +CUDA_VER_MAJOR_MINOR=${CUDA_VER%.*} if [ "${CUDA_VER_MAJOR_MINOR%.*}" == "11" ] then rapids-logger "Skipping test build for CUDA 11" diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 95c8abb55..5af8f6df7 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -19,6 +19,7 @@ test_dir = root + \"numba/cuda/tests/test_binary_generation/\" print(test_dir) " +CUDA_VER_MAJOR_MINOR=${CUDA_VER%.*} if [ "${CUDA_VER_MAJOR_MINOR%.*}" == "11" ] then rapids-logger "Skipping test build for CUDA 11" From caf438e2c7d368cb183b0f42ec2cfce180d6de2b Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 16:40:15 +0100 Subject: [PATCH 07/18] Fix typo in test_extending --- numba_cuda/numba/cuda/tests/cudapy/test_extending.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py index 58f1790ce..35dfdaa98 100644 --- a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py +++ b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py @@ -202,7 +202,7 @@ def test_extension_adds_linkable_code(self): (test_device_functions_ltoir, cuda.LTOIR), ) - if cuda.runtime.get_version[0] < 12: + if cuda.runtime.get_version()[0] < 12: unittest.skip("CUDA 12 required for linking in-memory data") lto = config.CUDA_ENABLE_PYNVJITLINK From 83507758fa1af7067d7afc2f9c0b2f763da35cba Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 17:46:12 +0100 Subject: [PATCH 08/18] Attempt to get CUDA 11 for CUDA 11 tests in CI --- ci/test_conda.sh | 2 +- ci/test_wheel.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test_conda.sh b/ci/test_conda.sh index 2907c5f8e..2fbc53b71 100755 --- a/ci/test_conda.sh +++ b/ci/test_conda.sh @@ -6,7 +6,7 @@ set -euo pipefail . /opt/conda/etc/profile.d/conda.sh if [ "${CUDA_VER%.*.*}" = "11" ]; then - CTK_PACKAGES="cudatoolkit" + CTK_PACKAGES="cudatoolkit=11" else CTK_PACKAGES="cuda-cccl cuda-nvcc-impl cuda-nvrtc libcurand-dev" apt-get update diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 5af8f6df7..ded6c90f9 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -8,7 +8,7 @@ rapids-logger "Install testing dependencies" python -m pip install \ psutil \ cffi \ - cuda-python \ + "cuda-python=11.8.*" \ pytest From 66fffc2feb96a7a8ec2d06206053b10f2bd4018a Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 6 May 2025 17:49:37 +0100 Subject: [PATCH 09/18] Fix skip of test --- numba_cuda/numba/cuda/tests/cudapy/test_extending.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py index 35dfdaa98..c8ce19341 100644 --- a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py +++ b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py @@ -203,7 +203,7 @@ def test_extension_adds_linkable_code(self): ) if cuda.runtime.get_version()[0] < 12: - unittest.skip("CUDA 12 required for linking in-memory data") + self.skipTest("CUDA 12 required for linking in-memory data") lto = config.CUDA_ENABLE_PYNVJITLINK From 0813ae86287642de12e821e96ed9212e27fe547d Mon Sep 17 00:00:00 2001 From: Graham Markall <535640+gmarkall@users.noreply.github.com> Date: Tue, 6 May 2025 19:05:34 +0100 Subject: [PATCH 10/18] Update ci/test_wheel.sh Co-authored-by: brandon-b-miller <53796099+brandon-b-miller@users.noreply.github.com> --- ci/test_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index ded6c90f9..8d33e1ea7 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -8,7 +8,7 @@ rapids-logger "Install testing dependencies" python -m pip install \ psutil \ cffi \ - "cuda-python=11.8.*" \ + "cuda-python==11.8.*" \ pytest From 6e032912031701b2ad8abaca2611c590e8ac7601 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 7 May 2025 10:44:11 +0100 Subject: [PATCH 11/18] Use appropriate version of cuda-python for wheel tests --- ci/test_wheel.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 8d33e1ea7..62f92e352 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -3,12 +3,14 @@ set -euo pipefail +CUDA_VER_MAJOR_MINOR=${CUDA_VER%.*} + rapids-logger "Install testing dependencies" # TODO: Replace with rapids-dependency-file-generator python -m pip install \ psutil \ cffi \ - "cuda-python==11.8.*" \ + "cuda-python==${CUDA_VER_MAJOR_MINOR}.*" \ pytest @@ -19,7 +21,6 @@ test_dir = root + \"numba/cuda/tests/test_binary_generation/\" print(test_dir) " -CUDA_VER_MAJOR_MINOR=${CUDA_VER%.*} if [ "${CUDA_VER_MAJOR_MINOR%.*}" == "11" ] then rapids-logger "Skipping test build for CUDA 11" From b1e58a2660629ccb3b2d640e9f59a84497461648 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 7 May 2025 10:46:52 +0100 Subject: [PATCH 12/18] Fix skipping of test --- numba_cuda/numba/cuda/tests/cudapy/test_extending.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py index c8ce19341..9f78ec851 100644 --- a/numba_cuda/numba/cuda/tests/cudapy/test_extending.py +++ b/numba_cuda/numba/cuda/tests/cudapy/test_extending.py @@ -192,6 +192,11 @@ def f(r, x): class TestExtendingLinkage(CUDATestCase): def test_extension_adds_linkable_code(self): + cuda_major_version = cuda.runtime.get_version()[0] + + if cuda_major_version < 12: + self.skipTest("CUDA 12 required for linking in-memory data") + files = ( (test_device_functions_a, cuda.Archive), (test_device_functions_cubin, cuda.Cubin), @@ -202,9 +207,6 @@ def test_extension_adds_linkable_code(self): (test_device_functions_ltoir, cuda.LTOIR), ) - if cuda.runtime.get_version()[0] < 12: - self.skipTest("CUDA 12 required for linking in-memory data") - lto = config.CUDA_ENABLE_PYNVJITLINK for path, ctor in files: From 132ac23461e5a73c0f3d3ed7a6e77c42beb20b60 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 7 May 2025 15:54:20 +0100 Subject: [PATCH 13/18] Attempt to use compatible Python and cuda-python versions There is no cuda-python 12.0 or 12.2 for Python 3.11 and 3.12, so we switch these Python versions with the CUDA 11.8.0 config --- .github/actions/compute-matrix/action.yaml | 16 ++++++++-------- .github/workflows/conda-python-tests.yaml | 18 +++++++++--------- .github/workflows/wheels-test.yaml | 16 ++++++++-------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/actions/compute-matrix/action.yaml b/.github/actions/compute-matrix/action.yaml index 5cec88453..86e60bf4d 100644 --- a/.github/actions/compute-matrix/action.yaml +++ b/.github/actions/compute-matrix/action.yaml @@ -20,15 +20,15 @@ runs: " export TEST_MATRIX=" - - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '12.2.2', ARCH: 'amd64', PY_VER: '3.12', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.12', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '12.2.2', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } - { CUDA_VER: '12.8.0', ARCH: 'amd64', PY_VER: '3.13', LINUX_VER: 'ubuntu24.04', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest' } - - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest' } - - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } - - { CUDA_VER: '12.2.2', ARCH: 'arm64', PY_VER: '3.12', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.12', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '12.2.2', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } - { CUDA_VER: '12.8.0', ARCH: 'arm64', PY_VER: '3.13', LINUX_VER: 'ubuntu24.04', GPU: 'a100', DRIVER: 'latest' } " diff --git a/.github/workflows/conda-python-tests.yaml b/.github/workflows/conda-python-tests.yaml index 3d340712e..b84d4179e 100644 --- a/.github/workflows/conda-python-tests.yaml +++ b/.github/workflows/conda-python-tests.yaml @@ -74,19 +74,19 @@ jobs: - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'earliest', DEPENDENCIES: 'oldest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } # arm64 - - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } nightly: # amd64 - - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'earliest', DEPENDENCIES: 'oldest' } - - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'earliest', DEPENDENCIES: 'oldest' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } # arm64 - - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } - - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } " diff --git a/.github/workflows/wheels-test.yaml b/.github/workflows/wheels-test.yaml index b4a2a3a25..24fc909f8 100644 --- a/.github/workflows/wheels-test.yaml +++ b/.github/workflows/wheels-test.yaml @@ -79,15 +79,15 @@ jobs: # export MATRICES=" pull-request: - - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'oldest' } - - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'oldest' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } - - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } " From 6956e16c905d57f9fbadb9987f2601cbc49759e6 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 7 May 2025 16:28:04 +0100 Subject: [PATCH 14/18] Skip tests that need cuda.bindings when it is unavailable --- .../numba/cuda/tests/cudadrv/test_module_callbacks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py b/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py index 304f2131a..84c0ded3b 100644 --- a/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py +++ b/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py @@ -7,7 +7,12 @@ from numba.cuda.cudadrv.linkable_code import CUSource from numba.cuda.testing import CUDATestCase, ContextResettingTestCase -from cuda.bindings.driver import cuModuleGetGlobal, cuMemcpyHtoD +try: + from cuda.bindings.driver import cuModuleGetGlobal, cuMemcpyHtoD + + CUDA_BINDINGS_AVAILABLE = True +except ImportError: + CUDA_BINDINGS_AVAILABLE = False if config.CUDA_USE_NVIDIA_BINDING: from cuda.cuda import CUmodule as cu_module_type @@ -164,6 +169,7 @@ def kernel(): kernel[1, 1]() +@unittest.skipUnless(CUDA_BINDINGS_AVAILABLE, "cuda.bindings not available") class TestModuleCallbacks(CUDATestCase): def setUp(self): super().setUp() From d6f8e4f65fc57499d69ef5f22959a5561e377cb8 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 7 May 2025 16:29:16 +0100 Subject: [PATCH 15/18] Revert "Skip tests that need cuda.bindings when it is unavailable" This reverts commit 6956e16c905d57f9fbadb9987f2601cbc49759e6. --- .../numba/cuda/tests/cudadrv/test_module_callbacks.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py b/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py index 84c0ded3b..304f2131a 100644 --- a/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py +++ b/numba_cuda/numba/cuda/tests/cudadrv/test_module_callbacks.py @@ -7,12 +7,7 @@ from numba.cuda.cudadrv.linkable_code import CUSource from numba.cuda.testing import CUDATestCase, ContextResettingTestCase -try: - from cuda.bindings.driver import cuModuleGetGlobal, cuMemcpyHtoD - - CUDA_BINDINGS_AVAILABLE = True -except ImportError: - CUDA_BINDINGS_AVAILABLE = False +from cuda.bindings.driver import cuModuleGetGlobal, cuMemcpyHtoD if config.CUDA_USE_NVIDIA_BINDING: from cuda.cuda import CUmodule as cu_module_type @@ -169,7 +164,6 @@ def kernel(): kernel[1, 1]() -@unittest.skipUnless(CUDA_BINDINGS_AVAILABLE, "cuda.bindings not available") class TestModuleCallbacks(CUDATestCase): def setUp(self): super().setUp() From 1687b1ce2395ba5cf5da7096fd7263d07df8c370 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 7 May 2025 16:29:32 +0100 Subject: [PATCH 16/18] Revert "Attempt to use compatible Python and cuda-python versions" This reverts commit 132ac23461e5a73c0f3d3ed7a6e77c42beb20b60. --- .github/actions/compute-matrix/action.yaml | 16 ++++++++-------- .github/workflows/conda-python-tests.yaml | 18 +++++++++--------- .github/workflows/wheels-test.yaml | 16 ++++++++-------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/actions/compute-matrix/action.yaml b/.github/actions/compute-matrix/action.yaml index 86e60bf4d..5cec88453 100644 --- a/.github/actions/compute-matrix/action.yaml +++ b/.github/actions/compute-matrix/action.yaml @@ -20,15 +20,15 @@ runs: " export TEST_MATRIX=" - - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.12', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '12.2.2', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } + - { CUDA_VER: '12.2.2', ARCH: 'amd64', PY_VER: '3.12', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest' } - { CUDA_VER: '12.8.0', ARCH: 'amd64', PY_VER: '3.13', LINUX_VER: 'ubuntu24.04', GPU: 'l4', DRIVER: 'latest' } - - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest' } - - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.12', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest' } - - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } - - { CUDA_VER: '12.2.2', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '11.8.0', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } + - { CUDA_VER: '12.2.2', ARCH: 'arm64', PY_VER: '3.12', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest' } - { CUDA_VER: '12.8.0', ARCH: 'arm64', PY_VER: '3.13', LINUX_VER: 'ubuntu24.04', GPU: 'a100', DRIVER: 'latest' } " diff --git a/.github/workflows/conda-python-tests.yaml b/.github/workflows/conda-python-tests.yaml index b84d4179e..3d340712e 100644 --- a/.github/workflows/conda-python-tests.yaml +++ b/.github/workflows/conda-python-tests.yaml @@ -74,19 +74,19 @@ jobs: - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'earliest', DEPENDENCIES: 'oldest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } # arm64 - - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } nightly: # amd64 - - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'earliest', DEPENDENCIES: 'oldest' } - - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'earliest', DEPENDENCIES: 'oldest' } + - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'h100', DRIVER: 'latest', DEPENDENCIES: 'latest' } # arm64 - - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } - - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } + - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } " diff --git a/.github/workflows/wheels-test.yaml b/.github/workflows/wheels-test.yaml index 24fc909f8..b4a2a3a25 100644 --- a/.github/workflows/wheels-test.yaml +++ b/.github/workflows/wheels-test.yaml @@ -79,15 +79,15 @@ jobs: # export MATRICES=" pull-request: - - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'oldest' } - - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'oldest' } + - { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'l4', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } - - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.9', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'oldest' } + - { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '11.8.0', LINUX_VER: 'rockylinux8', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.0.1', LINUX_VER: 'ubuntu20.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } + - { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.2.2', LINUX_VER: 'ubuntu22.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } - { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.8.0', LINUX_VER: 'ubuntu24.04', GPU: 'a100', DRIVER: 'latest', DEPENDENCIES: 'latest' } " From 2212b038bbf92d26d8e5010ee96494b8767d9588 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Wed, 7 May 2025 16:30:30 +0100 Subject: [PATCH 17/18] Use major version only for cuda-python --- ci/test_wheel.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 62f92e352..113810665 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -10,7 +10,7 @@ rapids-logger "Install testing dependencies" python -m pip install \ psutil \ cffi \ - "cuda-python==${CUDA_VER_MAJOR_MINOR}.*" \ + "cuda-python==${CUDA_VER_MAJOR_MINOR%.*}.*" \ pytest From 8fd17beac07972ce64843fca3514b00c4c94f7a5 Mon Sep 17 00:00:00 2001 From: Graham Markall <535640+gmarkall@users.noreply.github.com> Date: Wed, 7 May 2025 17:13:00 +0100 Subject: [PATCH 18/18] Update numba_cuda/numba/cuda/cudadrv/driver.py --- numba_cuda/numba/cuda/cudadrv/driver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numba_cuda/numba/cuda/cudadrv/driver.py b/numba_cuda/numba/cuda/cudadrv/driver.py index 5b17db54c..452239d71 100644 --- a/numba_cuda/numba/cuda/cudadrv/driver.py +++ b/numba_cuda/numba/cuda/cudadrv/driver.py @@ -3244,7 +3244,7 @@ def add_data(self, data, kind, name=None): elif kind == FILE_EXTENSION_MAP["o"]: self.add_object(data, **kws) elif kind == FILE_EXTENSION_MAP["ltoir"]: - raise LinkerError("Ctypes linker cannot link LTO-IR") + raise LinkerError("CudaPythonLinker cannot link LTO-IR") else: raise LinkerError(f"Don't know how to link {kind}")