Skip to content

Commit

Permalink
Use Numba Config to turn on Pynvjitlink Features (#17628)
Browse files Browse the repository at this point in the history
Numba-cuda 0.0.18+ merged in a new feature and made the old way of patching linker with pynvjitlink's `patch_numba_linker` no longer usable by downstream libraries. The current state of Numba-cuda requires that downstream libraries to enable pynvjitlink features only via `CUDA_ENABLE_PYNVJITLINK` environment variable. A recent PR NVIDIA/numba-cuda#91 makes it so that the features can be turned on by a config variable at runtime. 

This PR is an integration test with that PR and changing the way how pynvjitlink is enabled in cuDF. It enables cuDF to use Numba-cuda since 0.2.0+ (which contains the config change).

Supercedes #17359

Authors:
  - Michael Wang (https://github.com/isVoid)
  - Peter Andreas Entschev (https://github.com/pentschev)
  - Bradley Dice (https://github.com/bdice)

Approvers:
  - Peter Andreas Entschev (https://github.com/pentschev)
  - Bradley Dice (https://github.com/bdice)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #17628
  • Loading branch information
isVoid authored Jan 9, 2025
1 parent cb77046 commit bf80433
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ dependencies:
- nbsphinx
- ninja
- notebook
- numba-cuda>=0.0.13,<0.0.18
- numba-cuda>=0.2.0,<0.3.0
- numpy>=1.23,<3.0a0
- numpydoc
- nvcc_linux-64=11.8
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dependencies:
- nbsphinx
- ninja
- notebook
- numba-cuda>=0.0.13,<0.0.18
- numba-cuda>=0.2.0,<0.3.0
- numpy>=1.23,<3.0a0
- numpydoc
- nvcomp==4.1.0.6
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cudf/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
# Copyright (c) 2018-2025, NVIDIA CORPORATION.

{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
Expand Down Expand Up @@ -80,7 +80,7 @@ requirements:
- typing_extensions >=4.0.0
- pandas >=2.0,<2.2.4dev0
- cupy >=12.0.0
- numba-cuda >=0.0.13,<0.0.18
- numba-cuda >=0.2.0,<0.3.0
- numpy >=1.23,<3.0a0
- pyarrow>=14.0.0,<18.0.0a0
- libcudf ={{ version }}
Expand Down
6 changes: 3 additions & 3 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ dependencies:
- output_types: [conda, requirements, pyproject]
packages:
- cachetools
- &numba-cuda-dep numba-cuda>=0.0.13,<0.0.18
- &numba-cuda-dep numba-cuda>=0.2.0,<0.3.0
- nvtx>=0.2.1
- packaging
- rich
Expand Down Expand Up @@ -810,11 +810,11 @@ dependencies:
matrices:
- matrix: {dependencies: "oldest"}
packages:
- *numba-cuda-dep
- numba-cuda==0.2.0
- pandas==2.0.*
- matrix: {dependencies: "latest"}
packages:
- numba-cuda==0.0.15
- *numba-cuda-dep
- pandas==2.2.3
- matrix:
packages:
Expand Down
6 changes: 2 additions & 4 deletions python/cudf/cudf/utils/_numba.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

import glob
import os
Expand Down Expand Up @@ -130,9 +130,7 @@ def _setup_numba():
if driver_version < (12, 0):
patch_numba_linker_cuda_11()
else:
from pynvjitlink.patch import patch_numba_linker

patch_numba_linker()
numba_config.CUDA_ENABLE_PYNVJITLINK = True


class _CUDFNumbaConfig:
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
# Copyright (c) 2021-2025, NVIDIA CORPORATION.

[build-system]
build-backend = "rapids_build_backend.build"
Expand All @@ -24,7 +24,7 @@ dependencies = [
"cupy-cuda11x>=12.0.0",
"fsspec>=0.6.0",
"libcudf==25.2.*,>=0.0.0a0",
"numba-cuda>=0.0.13,<0.0.18",
"numba-cuda>=0.2.0,<0.3.0",
"numpy>=1.23,<3.0a0",
"nvtx>=0.2.1",
"packaging",
Expand Down
2 changes: 1 addition & 1 deletion python/dask_cudf/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cudf = "dask_cudf.backends:CudfBackendEntrypoint"
[project.optional-dependencies]
test = [
"dask-cuda==25.2.*,>=0.0.0a0",
"numba-cuda>=0.0.13,<0.0.18",
"numba-cuda>=0.2.0,<0.3.0",
"pytest-cov",
"pytest-xdist",
"pytest<8",
Expand Down

0 comments on commit bf80433

Please sign in to comment.