Skip to content

Commit

Permalink
Deprecate rmm._lib (#1713)
Browse files Browse the repository at this point in the history
Follows up #1676 to add deprecation warnings to the `rmm._lib` sub package.

Authors:
  - Matthew Murray (https://github.com/Matt711)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #1713
  • Loading branch information
Matt711 authored Oct 31, 2024
1 parent 47dae24 commit 8d49fff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/rmm/rmm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings

from rmm import mr
from rmm._version import __git_commit__, __version__
from rmm.mr import disable_logging, enable_logging, get_log_filenames
Expand Down Expand Up @@ -58,6 +60,12 @@ def __getattr__(name):
if name == "_lib":
import importlib

warnings.warn(
"The `rmm._lib` module is deprecated in will be removed in a future release. Use `rmm.pylibrmm` instead.",
FutureWarning,
stacklevel=2,
)

module = importlib.import_module("rmm.pylibrmm")
return module
else:
Expand Down
8 changes: 8 additions & 0 deletions python/rmm/rmm/_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings

from rmm.pylibrmm import *

warnings.warn(
"The `rmm._lib` module is deprecated in will be removed in a future release. Use `rmm.pylibrmm` instead.",
FutureWarning,
stacklevel=2,
)
6 changes: 6 additions & 0 deletions python/rmm/rmm/tests/test_rmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,3 +1076,9 @@ def test_available_device_memory():
assert initial_memory[1] == final_memory[1]
assert initial_memory[0] > 0
assert final_memory[0] > 0


# TODO: Remove test when rmm._lib is removed in 25.02
def test_deprecate_rmm_lib():
with pytest.warns(FutureWarning):
rmm._lib.device_buffer.DeviceBuffer(size=100)

0 comments on commit 8d49fff

Please sign in to comment.