Skip to content
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] Extend image cleanup for __sycl_unregister_lib #17091

Open
wants to merge 26 commits into
base: sycl
Choose a base branch
from

Conversation

KseniyaTikhomirova
Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova commented Feb 20, 2025

fixes #16031

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
…ion that is not the case for removeImage usage and to be removed

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova marked this pull request as ready for review February 21, 2025 15:27
@KseniyaTikhomirova KseniyaTikhomirova requested a review from a team as a code owner February 21, 2025 15:27
@KseniyaTikhomirova KseniyaTikhomirova changed the title [SYCL] Implement image cleanup in __sycl_unregister_lib [SYCL] Extend image cleanup for __sycl_unregister_lib Feb 21, 2025
@KseniyaTikhomirova
Copy link
Contributor Author

@jopperm hi, we overlapped in code a bit, I was fixing bugs of dynamic images load/unload. I removed duplications and added some extra details. I saw that you didn't cleaned up containers that you can't test with E2E test now - I added unit test where I can check them.
It would be great if you can review this PR. Thanks.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Copy link
Contributor

@jopperm jopperm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking care of this and adding the comprehensive test.

@@ -3594,6 +3629,8 @@ extern "C" void __sycl_register_lib(sycl_device_binaries desc) {

// Executed as a part of current module's (.exe, .dll) static initialization
extern "C" void __sycl_unregister_lib(sycl_device_binaries desc) {
(void)desc;
// TODO implement the function
// No need in fair partial cleanup at shutdown
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// No need in fair partial cleanup at shutdown
// Partial cleanup is not necessary at shutdown

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 42a642f

assert(It != m_KernelName2KernelIDs.end());
m_KernelName2KernelIDs.erase(It);
m_KernelIDs2BinImage.erase(It->second);
// remove Everything associated with this KernelName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// remove Everything associated with this KernelName
// remove everything associated with this KernelName

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 42a642f

Comment on lines 2038 to 2039
std::ignore = m_KernelUsesAssert.erase(EntriesIt->name);
std::ignore = m_KernelImplicitLocalArgPos.erase(EntriesIt->name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to std::ignore the return values? There are plenty of other erase calls where we don't.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I do not know if our code analyzer reacts on unhandled return value in this case. I removed them. It is not a big deal to add them later if needed.
42a642f

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova
Copy link
Contributor Author

KseniyaTikhomirova commented Feb 24, 2025

@uditagarwal97 FYI I don't add extra test for kernel cache update since I reused kernel eviction related code a lot. I rely on unit tests for kernel eviction and E2E test that failed because of absence of cache cleanup in dynamic image loading case - ./sycl/test-e2e/syclcompat/kernel/kernel_lin.cpp.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some RUNs of SharedLib/use_with_dlopen* are disabled since creation
3 participants