From ccd02cfaeb21649a1a77640996ce75c26a2ed302 Mon Sep 17 00:00:00 2001 From: Graham Markall Date: Tue, 28 Sep 2021 09:19:18 +0100 Subject: [PATCH] Prevent Numba Performance Warnings in cuDF 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. --- python/cudf/cudf/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/__init__.py b/python/cudf/cudf/__init__.py index 2e4c1ccebd5..df09a72ce25 100644 --- a/python/cudf/cudf/__init__.py +++ b/python/cudf/cudf/__init__.py @@ -4,7 +4,7 @@ validate_setup() import cupy -from numba import cuda +from numba import config as numba_config, cuda import rmm @@ -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