Skip to content

Commit

Permalink
Replace use of custom CUDA bindings with CUDA-Python (#930)
Browse files Browse the repository at this point in the history
This PR removes many of the custom CUDA bindings we wrote in RMM to support calls to the driver/runtime APIs from Python in downstream libraries (cudf, cuml, cugraph). We should now use [CUDA Python](https://github.com/NVIDIA/CUDA-Python) instead.

However, the module `rmm._cuda.gpu` is not being removed. It _has_ been converted from an extension module (`.pyx`) to a regular `.py` module. This module contains high-level wrappers around raw CUDA bindings, with some niceties like converting errors to exceptions with the appropriate error message. Reimplementing that functionality in each downstream library would be a bad idea. When CUDA Python rolls its own higher-level API, we can remove the `gpu` module as well.

One API change worth mentioning here is to the function `rmm._cuda.gpu.getDeviceAttribute`. Previously, the API accepted a `cudaDeviceAttr`, a type defined as part of RMM's custom CUDA bindings. The API has now changed to accept a `cudaDeviceAttr` defined in CUDA-Python. This requires changes in downstream libraries that use this API.

I am marking this PR _non-breaking_ as it does not affect the user-facing API. It does cause breakages in downstream libraries that are currently relying on internal APIs (from the `rmm._cuda` module).

Authors:
  - Ashwin Srinath (https://github.com/shwina)

Approvers:
  - AJ Schmidt (https://github.com/ajschmidt8)
  - Bradley Dice (https://github.com/bdice)
  - https://github.com/jakirkham

URL: #930
  • Loading branch information
shwina authored Jan 19, 2022
1 parent 5584a0c commit d94bdfd
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 1,398 deletions.
21 changes: 0 additions & 21 deletions conda/environments/rmm_dev_cuda10.2.yml

This file was deleted.

21 changes: 0 additions & 21 deletions conda/environments/rmm_dev_cuda11.0.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ dependencies:
- numpy
- cffi>=1.10.0
- pytest
- cudatoolkit=10.1
- cudatoolkit=11.5
- spdlog>=1.8.5,<1.9
- cython>=0.29,<0.30
- gcovr>=5.0
- cuda-python>=11.5,<12.0
2 changes: 2 additions & 0 deletions conda/recipes/rmm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ requirements:
- cython >=0.29,<0.30
- spdlog>=1.8.5,<2.0.0a0
- cudatoolkit {{ cuda_version }}.*
- cuda-python >=11.5,<12.0
run:
- python
- numba >=0.49
Expand All @@ -39,6 +40,7 @@ requirements:
{% else %}
- {{ pin_compatible('cudatoolkit', upper_bound='11.2', lower_bound='11.0') }} # cudatoolkit >=11.0,<11.2
{% endif %}
- cuda-python >=11.5,<12.0

test:
imports:
Expand Down
Loading

0 comments on commit d94bdfd

Please sign in to comment.