From 7cec6ac960c4fa19e885a3260b13b7f209d809da Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Thu, 20 Oct 2022 13:30:58 -0700 Subject: [PATCH 1/2] Add deprecation warning for set_allocator. --- python/cudf/cudf/utils/utils.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/cudf/cudf/utils/utils.py b/python/cudf/cudf/utils/utils.py index 63bc6d59524..7f5128409fe 100644 --- a/python/cudf/cudf/utils/utils.py +++ b/python/cudf/cudf/utils/utils.py @@ -4,6 +4,7 @@ import hashlib import os import traceback +import warnings from functools import partial from typing import FrozenSet, Set, Union @@ -213,6 +214,12 @@ def set_allocator( Enable logging (default ``False``). Enabling this option will introduce performance overhead. """ + warnings.warn( + "The cudf.set_allocator function is deprecated and will be removed in " + "a future release. Please use rmm.reinitialize instead.", + FutureWarning, + ) + use_managed_memory = allocator == "managed" rmm.reinitialize( From 15ac947aed4533788b6d4a24a748e228daec1c87 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Fri, 21 Oct 2022 09:55:28 -0700 Subject: [PATCH 2/2] Update message. --- python/cudf/cudf/utils/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/cudf/cudf/utils/utils.py b/python/cudf/cudf/utils/utils.py index 7f5128409fe..87596482d79 100644 --- a/python/cudf/cudf/utils/utils.py +++ b/python/cudf/cudf/utils/utils.py @@ -216,7 +216,10 @@ def set_allocator( """ warnings.warn( "The cudf.set_allocator function is deprecated and will be removed in " - "a future release. Please use rmm.reinitialize instead.", + "a future release. Please use rmm.reinitialize " + "(https://docs.rapids.ai/api/rmm/stable/api.html#rmm.reinitialize) " + 'instead. Note that `cudf.set_allocator(allocator="managed")` is ' + "equivalent to `rmm.reinitialize(managed_memory=True)`.", FutureWarning, )