-
Notifications
You must be signed in to change notification settings - Fork 198
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] When using rmm_cupy_allocator
with Cupy, the memory resource is constructed twice.
#1506
Comments
I can't see immediately why this would happen. I believe this just goes to |
This ultimately comes down to Python creating a I think it's harmless as long as the |
Previously we were relying on the C++ and Python-level device resources to agree. But this need not be the case. To avoid this, first get the current deivce resource and then use it when allocating the wrapped C++ device_buffer when creating DeviceBuffers. - Closes rapidsai#1506
This is a consequence of a confluence of factors:
This is only harmless because #1514 is a narrow fix for this issue, but we need to go through all the Cython interfaces and make sure we are explicit about tracking memory resources. |
Previously we were relying on the C++ and Python-level device resources to agree. But this need not be the case. To avoid this, first get the current deivce resource and then use it when allocating the wrapped C++ device_buffer when creating DeviceBuffers. - Closes rapidsai#1506
Previously we were relying on the C++ and Python-level device resources to agree. But this need not be the case. To avoid this, first get the current device resource and then use it when allocating the wrapped C++ device_buffer when creating DeviceBuffers. - Closes #1506 Authors: - Lawrence Mitchell (https://github.com/wence-) Approvers: - Mark Harris (https://github.com/harrism) URL: #1514
Describe the bug
I added print statements to the ctor and dtor in the C++
cuda_memory_resource
and then set Cupy to use RMM's allocator. The constructor print statement is called twice:Steps/Code to reproduce bug
Add print statements to the constructor and destructor (and optionally allocate/deallocate functions) of
cuda_memory_resource
. Then run this code:Notice
cuda_memory_resource constructor
prints twice, showing that the C++ object is constructed twice.Expected behavior
cuda_memory_resource constructor
should only print once (I think).Environment details (please complete the following information):
The text was updated successfully, but these errors were encountered: