Skip to content

[SYCL] Unload libraries in jit_compiler and kernel_compiler_opencl destructors #16517

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

Merged

Conversation

KseniyaTikhomirova
Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova commented Jan 3, 2025

Fixes memory leaks in jit_compiler and kernel_compiler_opencl classes.
Libraries loaded to provide compilation utils have to be released.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova changed the title Fix leak in online compiler [SYCL] Unload ocloc in jit_compiler and kernel_compiler_opencl Jan 3, 2025
@KseniyaTikhomirova KseniyaTikhomirova marked this pull request as ready for review January 3, 2025 16:17
@KseniyaTikhomirova KseniyaTikhomirova requested review from a team as code owners January 3, 2025 16:17
Copy link
Contributor

@uditagarwal97 uditagarwal97 left a comment

Choose a reason for hiding this comment

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

LGTM. Would it be possible to also add a test covering these changes?

@KseniyaTikhomirova
Copy link
Contributor Author

LGTM. Would it be possible to also add a test covering these changes?

both objects are static so not sure if it is possible to track with UT

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.

Makes sense, but please add a PR description and consider updating the title, which is a bit misleading because jit_compiler doesn't load ocloc but rather the sycl-jit library.

@@ -98,6 +98,7 @@ class jit_compiler {
CompileSYCLFuncT CompileSYCLHandle = nullptr;
ResetConfigFuncT ResetConfigHandle = nullptr;
AddToConfigFuncT AddToConfigHandle = nullptr;
void *MLibraryHandle = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this be a unique pointer as well, reusing the custom deleter from the newly-added unique pointer in jit_compiler's constructor? Then we wouldn't need to duplicate the unload logic in the destructor.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: The other members here don't carry the M prefix.

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 c86ef55

Copy link
Contributor Author

Choose a reason for hiding this comment

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

title is slightly updated too.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova KseniyaTikhomirova changed the title [SYCL] Unload ocloc in jit_compiler and kernel_compiler_opencl [SYCL] Unload libraries in jit_compiler and kernel_compiler_opencl destructors Jan 7, 2025
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova
Copy link
Contributor Author

@intel/llvm-gatekeepers hi, this PR is ready to be merged

@steffenlarsen steffenlarsen merged commit ac9e5d9 into intel:sycl Jan 9, 2025
17 checks passed
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.

5 participants