From 3183ab975fad87ca1e0784e0a695c10ecf4958eb Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Wed, 11 Dec 2024 13:07:16 -0800 Subject: [PATCH 1/2] Replace old import names with new cuda.bindings names. --- python/cudf/cudf/core/udf/utils.py | 6 +++--- python/cudf/cudf/utils/gpu_utils.py | 2 +- python/pylibcudf/pylibcudf/utils.pyx | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/cudf/cudf/core/udf/utils.py b/python/cudf/cudf/core/udf/utils.py index bfe716f0afc..4bd5a1e7040 100644 --- a/python/cudf/cudf/core/udf/utils.py +++ b/python/cudf/cudf/core/udf/utils.py @@ -9,7 +9,7 @@ import cupy as cp import llvmlite.binding as ll import numpy as np -from cuda import cudart +from cuda.bindings import runtime from numba import cuda, typeof from numba.core.datamodel import default_manager, models from numba.core.errors import TypingError @@ -356,8 +356,8 @@ def set_malloc_heap_size(size=None): if size is None: size = _STRINGS_UDF_DEFAULT_HEAP_SIZE if size != _heap_size: - (ret,) = cudart.cudaDeviceSetLimit( - cudart.cudaLimit.cudaLimitMallocHeapSize, size + (ret,) = runtime.cudaDeviceSetLimit( + runtime.cudaLimit.cudaLimitMallocHeapSize, size ) if ret.value != 0: raise RuntimeError("Unable to set cudaMalloc heap size") diff --git a/python/cudf/cudf/utils/gpu_utils.py b/python/cudf/cudf/utils/gpu_utils.py index b5387ddeb5f..10ab3f6bb1e 100644 --- a/python/cudf/cudf/utils/gpu_utils.py +++ b/python/cudf/cudf/utils/gpu_utils.py @@ -15,7 +15,7 @@ def validate_setup(): import warnings - from cuda.cudart import cudaDeviceAttr, cudaError_t + from cuda.bindings.runtime import cudaDeviceAttr, cudaError_t from rmm._cuda.gpu import ( CUDARuntimeError, diff --git a/python/pylibcudf/pylibcudf/utils.pyx b/python/pylibcudf/pylibcudf/utils.pyx index ee4421ddeaf..e9365ca1b36 100644 --- a/python/pylibcudf/pylibcudf/utils.pyx +++ b/python/pylibcudf/pylibcudf/utils.pyx @@ -5,7 +5,7 @@ from cython.operator import dereference from libc.stdint cimport uintptr_t from libcpp.functional cimport reference_wrapper from libcpp.vector cimport vector -from cuda import cudart +from cuda.bindings import runtime from pylibcudf.libcudf.scalar.scalar cimport scalar from pylibcudf.libcudf.types cimport bitmask_type @@ -44,13 +44,13 @@ def _is_concurrent_managed_access_supported(): """ # Ensure CUDA is initialized before checking cudaDevAttrConcurrentManagedAccess - cudart.cudaFree(0) + runtime.cudaFree(0) device_id = 0 - err, supports_managed_access = cudart.cudaDeviceGetAttribute( - cudart.cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess, device_id + err, supports_managed_access = runtime.cudaDeviceGetAttribute( + runtime.cudaDeviceAttr.cudaDevAttrConcurrentManagedAccess, device_id ) - if err != cudart.cudaError_t.cudaSuccess: + if err != runtime.cudaError_t.cudaSuccess: raise RuntimeError( f"Failed to check cudaDevAttrConcurrentManagedAccess with error {err}" ) From 4d6edd9f9e86ed7175276665b1edc791ad5342a5 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 17 Dec 2024 17:10:07 -0600 Subject: [PATCH 2/2] Remove ignored deprecation warnings. --- python/cudf/pyproject.toml | 2 -- python/cudf_kafka/pyproject.toml | 2 -- python/cudf_polars/pyproject.toml | 2 -- python/custreamz/pyproject.toml | 2 -- python/dask_cudf/pyproject.toml | 2 -- python/pylibcudf/pyproject.toml | 2 -- 6 files changed, 12 deletions(-) diff --git a/python/cudf/pyproject.toml b/python/cudf/pyproject.toml index 21c18ef0174..2fdf6b34b8f 100644 --- a/python/cudf/pyproject.toml +++ b/python/cudf/pyproject.toml @@ -98,8 +98,6 @@ filterwarnings = [ "error", "ignore:::.*xdist.*", "ignore:::.*pytest.*", - # https://github.com/rapidsai/build-planning/issues/116 - "ignore:.*cuda..* module is deprecated.*:DeprecationWarning", # some third-party dependencies (e.g. 'boto3') still using datetime.datetime.utcnow() "ignore:.*datetime.*utcnow.*scheduled for removal.*:DeprecationWarning:botocore", # Deprecation warning from Pyarrow Table.to_pandas() with pandas-2.2+ diff --git a/python/cudf_kafka/pyproject.toml b/python/cudf_kafka/pyproject.toml index 29fcd161444..a9d937435e9 100644 --- a/python/cudf_kafka/pyproject.toml +++ b/python/cudf_kafka/pyproject.toml @@ -60,8 +60,6 @@ addopts = "--tb=native --strict-config --strict-markers" empty_parameter_set_mark = "fail_at_collect" filterwarnings = [ "error", - # https://github.com/rapidsai/build-planning/issues/116 - "ignore:.*cuda..* module is deprecated.*:DeprecationWarning", ] xfail_strict = true diff --git a/python/cudf_polars/pyproject.toml b/python/cudf_polars/pyproject.toml index b781b13ec10..5904942aea2 100644 --- a/python/cudf_polars/pyproject.toml +++ b/python/cudf_polars/pyproject.toml @@ -66,8 +66,6 @@ addopts = "--tb=native --strict-config --strict-markers" empty_parameter_set_mark = "fail_at_collect" filterwarnings = [ "error", - # https://github.com/rapidsai/build-planning/issues/116 - "ignore:.*cuda..* module is deprecated.*:DeprecationWarning", ] xfail_strict = true diff --git a/python/custreamz/pyproject.toml b/python/custreamz/pyproject.toml index ed43ab83d53..7820157d89b 100644 --- a/python/custreamz/pyproject.toml +++ b/python/custreamz/pyproject.toml @@ -93,8 +93,6 @@ addopts = "--tb=native --strict-config --strict-markers" empty_parameter_set_mark = "fail_at_collect" filterwarnings = [ "error", - # https://github.com/rapidsai/build-planning/issues/116 - "ignore:.*cuda..* module is deprecated.*:DeprecationWarning", "ignore:unclosed