-
Notifications
You must be signed in to change notification settings - Fork 797
[SYCL] Merge USMAllocContext for Sub-Devices and Sub-Sub-Devices #8012
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
Fix double free bug in USM (de)allocation for sub-sub-devices on PVC
The issue is reproducible on the existing test (the one being updated in intel/llvm-test-suite#1515). |
should we just avoid freeing the context of sub-sub-devices since they do not carry unique L0 device handle? Tag @igchor , the new owner of USM allocators |
If the ze_device_handle is the same why not just use it as a key for |
Sounds good to me! |
Thanks for the feedback, @igchor and @smaslov-intel. I have made the suggested changes. |
if (SubDevice->isCCS()) | ||
// CCS share USMAllocContext with its root device. | ||
continue; |
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.
Do we really need this intrinsic check here? I thought we would just add an USM allocator for each L0 device. For PI devices that don't have unique L0 device (like this CCS or sub-sub-devices) the allocator wouldn't be added since it would already be there (from sub-device)
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.
Sure, I've removed the intrinsic check and instead added an extra comment to explicitly state the sharing of USM allocators between CCS and subdevices.
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.
LGTM
LGTM |
Failure in SYCL :: dword_atomic_smoke.cpp is known #8098 |
@intel/llvm-gatekeepers The PR is ready! |
Problem:
Currently, sub-devices and sub-sub-devices have different USM allocation contexts (USMAllocContext) but they share the same ze_device_handle. This causes issues with USM memory allocation, for instance, double-free.
Proposed Fix:
I have merged the USMAllocContext of the sub-device and sub-sub-device.