-
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
[REVIEW] Remove C++ Wrappers in memory_resource_adaptors.hpp
Needed by Cython
#662
[REVIEW] Remove C++ Wrappers in memory_resource_adaptors.hpp
Needed by Cython
#662
Conversation
I think the problem, as @shwina explained, is with upstream resources. |
I did run into a similar issue where the order of calls to Ultimately this PR is just a nice to have. It wasn't very much work and removes a pain point I ran into with previous PRs: having multiple layers of wrappers for each MR. Figured I would submit it before the holiday break since we're early in the release cycle. |
I think the approach of using If I understand correctly, this approach assumes that a memory resource can have only a single upstream memory resource. That was not the case previously when we had If multiple upstreams is something that we might want to support, then we might have to tweak the approach a bit. In particular, we may have to eliminate |
Side note: our previous hesitation with relying on |
@mdemoret-nv According to @jrhemstad, it may be possible in the future to have multiple upstream memory resources. So we should either:
In either case, I think we can get away with moving the definition of |
fwiw, it's probably safe to leave handling multiple upstreams for future work. We don't have any short term plans to add resources with multiple upstreams, but we definitely shouldn't exclude ever supporting multiple upstreams. |
Excellent. Glad you like it.
Yes, you are correct. The current implementation of
If multiple upstreams are needed, I don't think scrapping the |
Took too long writing my reply and didn't see your comments.
Sounds good to me. Adding support in the future wouldn't be hard and I think the current design with |
So happy that you found a way to manage lifetimes without that extra C++ layer! Adding MR types was such a pain before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool.
Moving to 0.19... |
This PR is ready for a re-review. It depends on #661 and contains the changes in that PR as well for easy merging (and required for the added tests to pass) |
rerun tests |
@kkraus14 Any idea why the ubuntu 18.04 tests are failing but 16.04 and centos is passing? I tried to recreate this locally with the docker build but havent had any success. |
Looks like something in one of these two tests is causing a bad CUDA state that doesn't get cleared:
|
rerun tests |
cuDF builds break after 230369d, because it cimports `device_buffer.pxd`, which in turn includes `memory_resource_wrappers.hpp`. This file isn't curerntly shipped as part of the RMM package. This PR ensures that we do ship it. However, since PR #662 proposes removing this file entirely, we should _undo_ this change in that PR. This PR is being submitted only to unblock CI in cuDF. Authors: - Ashwin Srinath (@shwina) Approvers: - Keith Kraus (@kkraus14) URL: #715
@mdemoret-nv can we undo this change in this PR now? :) |
@gpucibot merge |
Yup. That file no longer exists so I think it's safe to undo that change. |
Depends on #661
While working on PR #661, it looked like it was possible to remove the "owning" C++ memory resource adaptors in
memory_resource_adaptors.hpp
. This PR is a quick implementation of what that would look like to run through CI and get feedback.The main driving factor of this PR is to eliminate the need for 2 layers of wrappers around every memory resource in the library. When adding new memory resources, C++ wrappers must be created in
memory_resource_adaptors.hpp
and Cython wrappers must be created inmemory_resource.pyx
, for any property/function that needs to be exposed at the python level. This removes the C++ wrappers in favor of using pythons reference counting for lifetime management.A few notes:
MemoryResource
was renamedDeviceMemoryResource
to more closely match the C++ class names. Easily can be changed backUpstreamResourceAdaptor
that stores a single propertyupstream_mr
. Any MR that has an upstream, needs to inherit from this class.UpstreamResourceAdaptor
was created, most of the work/changes were updating the Cython imports to use the C++ classes instead of the C++ wrappers.Would appreciate any feedback.