-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Support for pooled small allocations. #5438
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
…eters. Signed-off-by: Rajiv Deodhar <rajiv.deodhar@intel.com>
Hi Rajiv, Another nitpick. I was wondering why definition of class Bucket is not in the header file. Thanks |
The entire implementation of pooling is in the .cpp file. The usm_allocator.hpp header is only the external interface of pooling from the pi_level_zero files. |
Changes look good. Can you please comment on adding a test for this? Thanks |
The existing test usm_pooling.cpp will be extended to account for the feature added in this PR. |
/verify with intel/llvm-test-suite#980 |
/verify with intel/llvm-test-suite#980 |
/verify with intel/llvm-test-suite#980 |
/verify with intel/llvm-test-suite#980 |
/verify with intel/llvm-test-suite#980 |
/verify with intel/llvm-test-suite#980 |
/verify with intel/llvm-test-suite#980 |
/verify with intel/llvm-test-suite#980 |
if (chunkedBucket) | ||
NewFreeSlabsInBucket = chunkedSlabsInPool + 1; | ||
else | ||
NewFreeSlabsInBucket = AvailableSlabs.size() + 1; |
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.
Would it be simpler to maintain "chunked" slabs in a separate list, i.e. break the AvailableSlabs into 2?
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 don't know if it would be simpler, but there could be alternative approaches such as adding a third type of list, in effect breaking the AvailableSlabs list into two, with different meaning.
I also tried layering the slab types, to make chunked slabs a specialization of full slabs.
However, the approach implemented here required the least change.
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.
OK, let's go with what we have ready, and only consider a re-design when we need to changes something again.
/verify with intel/llvm-test-suite#980 |
This change enables pooling of USM slabs used for small allocations, i.e. < 32KB. These slabs are used in chunked mode, that is, divided into chunks, and each chunk used for an individual user allocation.
Previously, when all the individual allocations in a chunked slab were freed by the program, the slab was freed from USM. We no longer do that. We retain that slab for future use, in effect, pooling it.
Signed-off-by: Rajiv Deodhar rajiv.deodhar@intel.com