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

[BUG] RMM Python Docs use nonexistant rmm.to_device() method #668

Closed
lphan opened this issue Dec 21, 2020 · 6 comments · Fixed by #902
Closed

[BUG] RMM Python Docs use nonexistant rmm.to_device() method #668

lphan opened this issue Dec 21, 2020 · 6 comments · Fixed by #902
Labels
bug Something isn't working doc Documentation Python Related to RMM Python API

Comments

@lphan
Copy link

lphan commented Dec 21, 2020

Describe the bug
AttributeError: module 'rmm' has no attribute 'to_device'

Steps/Code to reproduce bug
Step 1: Install RAPIDS from RAPIDS.ai
conda create -n rapids-0.17 -c rapidsai -c nvidia -c conda-forge -c defaults rapids-blazing=0.17 python=3.7 cudatoolkit=10.2

Step 2: activate environment rapids-0.17
conda activate rapids-0.17

Step 3:
import rmm
import numpy as np

DeviceBuffer represents an untyped, uninitialized device memory allocation. DeviceBuffers can be created by providing the size of the allocation in bytes

buf = rmm.DeviceBuffer(size=100)
print("Buffer Size: ", buf.size, "Buffer Pointer: ", buf.ptr)

DeviceBuffers can also be created by copying data from host memory

a = np.array([1, 2, 3], dtype='float64')
buf = rmm.to_device(a.tobytes())
print(buf.size)

Source: https://docs.rapids.ai/api/rmm/stable/basics.html

Expected behavior
function to_device should exist or documentation should be updated.

or maybe do I miss something?

Thank you for your work.
Best, Long Phan

@lphan lphan added ? - Needs Triage Need team to review and classify bug Something isn't working labels Dec 21, 2020
@ysq151944
Copy link

maybe the api is rmm.DeviceBuffer.to_device?

@lphan
Copy link
Author

lphan commented Dec 25, 2020

Thanks, it worked.

@lphan lphan closed this as completed Dec 25, 2020
@Wuppus
Copy link

Wuppus commented Nov 1, 2021

Documentation still says rmm.to_device
from https://docs.rapids.ai/api/rmm/stable/basics.html#installation stable(21.10)

import rmm
import numpy as np
a = np.array([1, 2, 3], dtype='float64')
buf = rmm.to_device(a.tobytes())
buf.size

@harrism harrism reopened this Nov 1, 2021
@harrism
Copy link
Member

harrism commented Nov 1, 2021

Reopening and changing to a doc bug.

@harrism harrism added Python Related to RMM Python API doc Documentation and removed ? - Needs Triage Need team to review and classify labels Nov 1, 2021
@harrism harrism changed the title [BUG] AttributeError: module 'rmm' has no attribute 'to_device' [BUG] RMM Python Docs use nonexistant 'rmm.to_device()' method Nov 1, 2021
@harrism harrism changed the title [BUG] RMM Python Docs use nonexistant 'rmm.to_device()' method [BUG] RMM Python Docs use nonexistant rmm.to_device() method Nov 1, 2021
@shwina
Copy link
Contributor

shwina commented Nov 1, 2021

The to_device() method was removed in a previous method of RMM. The solution today is to use CuPy directly to allocate device arrays. See here for how to use RMM with CuPy.

@Wuppus
Copy link

Wuppus commented Nov 2, 2021

Ok thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working doc Documentation Python Related to RMM Python API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants