-
Notifications
You must be signed in to change notification settings - Fork 915
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
Add HostMemoryAllocator interface #13924
Add HostMemoryAllocator interface #13924
Conversation
Fixes NVIDIA/spark-rapids#8884 Signed-off-by: Gera Shegalov <[email protected]>
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.
The current set of changes look good, but how do we actually inject our own HostMemoryAllocator for something like copying data from the device to the host?
We also will need to look at the C++ code at some point.
jobject allocate_host_buffer(JNIEnv *env, jlong amount, jboolean prefer_pinned); |
That is really only used for I/O operations like arrow and the writer APIs.
If we need full flexibility of initializing in the layer above cuDF/Java, and if it's a singleton I was thinking of an API like
I can add this once it's clear where the singleton allocator lives. |
Lets take the example of I see two ways to do this.
Originally I thought we would do option 1, but the singleton idea is growing on me, and I think we could have the APIs be just as clean. If you do want to do a singleton that is fine. I will just need to make sure that we have an issue to implement a HostMemoryAllocator that would give us the flexibility we need. |
Signed-off-by: Gera Shegalov <[email protected]>
I added explicit HostMemoryAllocator parameter passing because it is indeed simple and gives us most flexibility. still need to think about allocate_host_buffer, maybe in a separate PR after all. |
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.
Looks good. If we want to have a follow on for the native code that is fine.
/merge |
Description
Creates an interface to intercept calls to HostMemoryBuffer.allocate
Fixes NVIDIA/spark-rapids#8884
Signed-off-by: Gera Shegalov [email protected]
Checklist