Skip to content

Commit

Permalink
Use cuda-python cuda.bindings import names. (#17585)
Browse files Browse the repository at this point in the history
This PR updates cuDF to use the new cuda-python `cuda.bindings` layout. See rapidsai/build-planning#117.

Authors:
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)
  - James Lamb (https://github.com/jameslamb)

URL: #17585
  • Loading branch information
bdice authored Dec 20, 2024
1 parent 69d62cb commit 3add496
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 21 deletions.
6 changes: 3 additions & 3 deletions python/cudf/cudf/core/udf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion python/cudf/cudf/utils/gpu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand Down
2 changes: 0 additions & 2 deletions python/cudf_kafka/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions python/cudf_polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions python/custreamz/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <socket.socket:ResourceWarning",
"ignore:Port .* is already in use.:UserWarning:distributed",
# Should be fixed in the next streamz release
Expand Down
2 changes: 0 additions & 2 deletions python/dask_cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ empty_parameter_set_mark = "fail_at_collect"
filterwarnings = [
"error::FutureWarning",
"error::DeprecationWarning",
# 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",
"ignore:create_block_manager_from_blocks is deprecated and will be removed in a future version. Use public APIs instead.:DeprecationWarning",
Expand Down
10 changes: 5 additions & 5 deletions python/pylibcudf/pylibcudf/utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
)
Expand Down
2 changes: 0 additions & 2 deletions python/pylibcudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ addopts = "--tb=native --strict-config --strict-markers --import-mode=importlib"
empty_parameter_set_mark = "fail_at_collect"
filterwarnings = [
"error",
# https://github.com/rapidsai/build-planning/issues/116
"ignore:.*cuda..* module is deprecated.*:DeprecationWarning",
"ignore:::.*xdist.*",
"ignore:::.*pytest.*"
]
Expand Down

0 comments on commit 3add496

Please sign in to comment.