-
Notifications
You must be signed in to change notification settings - Fork 35
add support for CUDA allocation flags #1079
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
Conversation
4114f01
to
9d300d4
Compare
6d18197
to
0bbce23
Compare
0bbce23
to
f2dd498
Compare
f2dd498
to
979f212
Compare
979f212
to
0f12c57
Compare
f216ec8
to
43544e5
Compare
43544e5
to
201fe5d
Compare
201fe5d
to
d36d585
Compare
Apologies for the delay. I should be able to properly review this later today.
|
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.
I'm happy with this implementation of this feature as it pertains to CUDA, but do we need to better generalize for other accelerator APIs that also takes flags for allocations? CUDA is one, but HIP supports a different set of flags, and Intel OpenCL extensions also extend allocation to take hints.
As I discussed here I've already got work in progress that does similar things for all accelerator targets, so if UMF can provide a generic way to do this, then I'd prefer that
Please note, I'm still not to be considered competent with understanding how UMF works so feel free to tell me I'm misunderstanding
// Handle to the CUDA context | ||
void *cuda_context_handle; | ||
|
||
// Handle to the CUDA device |
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.
These are no longer doxygen style comments. Is that intended since this is implementation and non-public?
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.
Yes, this code was moved from the public include files to this location when we updated the UMF API to use setters instead of directly exposign the parameter structure. So this change is just a cleanup
@ldrumm UMF doesn't allow flags/hints to be passed to pool allocation APIs. This is because those flags/hints can only be applied to the entire memory page. If we would, for example, allow Our current thinking is that the upper level (UR or SYCL) should decide what to do for every specific flag. For some flags (ones that are used often), it might make sense to create dedicated pools (for which entire memory is allocated with those flags). For others (or when the allocation size is big), it might be better to not do any pooling (just pass the request directly to the driver). UR spec gives as quite a lot of flexibility in how we can implement this in the adapters. |
Add support for CUDA allocation flags.
This PR adds one new API call for CUDA:
umfCUDAMemoryProviderParamsSetAllocFlags()
Checklist