Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate rmm._lib #1713

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
Matt711 marked this conversation as resolved.
Show resolved Hide resolved
"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)
Loading