Skip to content

Commit

Permalink
Prevent Numba Performance Warnings in cuDF (#9320)
Browse files Browse the repository at this point in the history
Numba 0.54 introduces performance warnings whenever a kernel is launched
with low occupancy. Certain operations in cuDF can indirectly cause this
warning to be emitted, for example `DataFrame.iloc` (which one would not
expect to be particularly efficient anyway). This message could be
disconcerting for users and appear in a lot of workflows; therefore,
this commit configures Numba at cuDF import time to suppress the low
occupancy warning.

Fixes #9247.
  • Loading branch information
gmarkall authored Oct 5, 2021
1 parent fc341af commit 442009b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python/cudf/cudf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
validate_setup()

import cupy
from numba import cuda
from numba import config as numba_config, cuda

import rmm

Expand Down Expand Up @@ -104,5 +104,13 @@
cuda.set_memory_manager(rmm.RMMNumbaManager)
cupy.cuda.set_allocator(rmm.rmm_cupy_allocator)

try:
# Numba 0.54: Disable low occupancy warnings
numba_config.CUDA_LOW_OCCUPANCY_WARNINGS = 0
except AttributeError:
# Numba < 0.54: No occupancy warnings
pass
del numba_config

__version__ = get_versions()["version"]
del get_versions

0 comments on commit 442009b

Please sign in to comment.