-
Notifications
You must be signed in to change notification settings - Fork 29
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
[DRAFT] Implement IPC API of the Coarse provider #907
base: main
Are you sure you want to change the base?
[DRAFT] Implement IPC API of the Coarse provider #907
Conversation
0a806a3
to
a4646f7
Compare
a4646f7
to
40e3160
Compare
please add the following test:
|
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.
This PR will not work with L0/Cuda providers as they do not (and probably will not) have split/merge functionality.
Not sure how we should solve this issue. Tracking provider all ready has this functionality on the pool level . We could copy it to coarse provider - but is this HORRIBLE idea (code duplication and performance implications).
Performance is something which should also consider. We have too much trackers, list, and trees. I'm currently working on benchmark those, but still in my opinion, we should try to limit those to absolute minimum. When at each level we have minimum one extra data structure with non constant time complexity of inserts or delete.
For now i would recommend to make this PR a draft, and have good architectural discussion about this issue.
I totally agree with @lplewa. In fact, the coarse provider implements memory pooling logic, but it is implemented as a provider and used inside UMF stack as a provider. As a result, it resides below our memory tracker, because tracking provider is always on the top (between the pool manager and memory providers). I agree that we need an architecture discussion current implementation experience shows that current approach has issues. |
static umf_result_t ze_memory_provider_allocation_split(void *provider,
void *ptr,
size_t totalSize,
size_t firstSize) {
(void)provider;
(void)ptr;
(void)totalSize;
(void)firstSize;
// TODO not supported yet
return UMF_RESULT_ERROR_NOT_SUPPORTED;
} I added such test for the file provider. |
Signed-off-by: Lukasz Dorau <[email protected]>
Coarse provider has to always call: - umfMemoryProviderAllocationSplit(upstream_provider) or - umfMemoryProviderAllocationMerge(upstream_provider) when splitting or merging memory blocks, because the IPC API would not work on split/merged memory blocks otherwise. Signed-off-by: Lukasz Dorau <[email protected]>
Fixes: oneapi-src#900 Signed-off-by: Lukasz Dorau <[email protected]>
Signed-off-by: Lukasz Dorau <[email protected]>
d6d3337
to
2ac56a1
Compare
Description
Implement IPC API of the Coarse provider.
Split and merge in Coarse provider to enable IPC API.
Coarse provider should always call:
umfMemoryProviderAllocationSplit(upstream_provider)
orumfMemoryProviderAllocationMerge(upstream_provider)
when splitting or merging memory blocks, because the IPC API would not work on split/merged memory blocks otherwise.
Fixes: #900
Checklist