-
Notifications
You must be signed in to change notification settings - Fork 754
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
[SYCL] Evict program cache on PI_ERROR_OUT_OF_RESOURCES #11987
Conversation
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 like the approach, but we should probably address the race conditions before we consider merging this. Should it be converted to draft for good measure?
cb29584
to
9dce9fb
Compare
// CHECK-CACHE: piKernelRelease | ||
// CHECK-CACHE: piKernelRelease | ||
// CHECK-CACHE: piProgramRelease | ||
// CHECK-CACHE: piProgramRelease |
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 cache is destructed in a different order now, which is why these are swapped. Also the previous version of this test only had 2 checks for release of program/kernel even though there were 3 programs/kernels that should have been created, which is why any extra check was added.
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.
Just need to avoid the error, but just to avoid post-commit failure we should fix the unused variable.
I'm observing cache overflow when running heavy tests on OCL backend with gpu. Clear cache in case of PI_ERROR_OUT_OF_HOST_MEMORY as well as for PI_ERROR_OUT_OF_RESOURCES. Using as reference: intel#11987
I'm observing cache overflow when running heavy tests on OCL backend with gpu. Clear cache in case of PI_ERROR_OUT_OF_HOST_MEMORY as well as for PI_ERROR_OUT_OF_RESOURCES. Using as reference: #11987
I'm observing cache overflow when running heavy tests on OCL backend with gpu. Clear cache in case of PI_ERROR_OUT_OF_HOST_MEMORY as well as for PI_ERROR_OUT_OF_RESOURCES. Using as reference: intel#11987
This PR adds resource cleanup mechanisms when
PI_ERROR_OUT_OF_RESOURCES
occurs onpiProgramBuild
andpiProgramLink
. Currently. the whole cache is cleared, but this behavior can be extended in the future. In order to ensure thread safety of the cache clearing mechanism, the maps of the cache now hold theirBuildResult
's inshared_ptr
's, which allows the cache to be cleared even if there are still threads that still hold references to aBuildResult
.