-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Fix memory leak (queue_impl) due to #5901 #6707
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] Fix memory leak (queue_impl) due to #5901 #6707
Conversation
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Not that anyone asked, but I can confirm that it fixes the problem I was having 👍 |
thank you, good to know |
Is there any case where the queue may die before the event? In that case, are there any operations on the event that would try to lock the queue and fail? |
I was also thinking about this. In event_impl there is very similar approach in event_impl::flushIfNeeded. |
I might worry that this could break if the scenario you mentioned happens and the event is then used as a dependency event in some command. Maybe the worker queue is only really used if the event is the result event of a command? If so, the command constructor should ensure it gets initialized. Is that the case? |
Could you please describe a bit more what you meant here "Maybe the worker queue is only really used if the event is the result event of a command?" I am not sure that understand scenario in a right way |
From my reading of these changes, the worker queue is only set on the result event of a command and not any of the dependency events. I guess my main concern is if someone does something like sycl::event Ev;
{
sycl::queue Q1;
Ev = Q.submit(...); // Ev will have Q1 as its worker queue.
}
{
sycl::queue Q2;
Q.submit([&](sycl::handler &CGH) {
CGH.depends_on(Ev); // Ev.getWorkerQueue() will fail to lock its weak_ptr?
...
}
} it will fail. Is that a possible case? If so, maybe |
What I expect in the scenario above:
|
I will try to add suggested code as unit test tomorrow. |
Admittedly I completely misremembered the semantics of |
Unfortunately scenario above involves host task execution because we connect two Queues via connection task which is always a host task. |
failures are not related, already reported here #6760 |
@intel/llvm-gatekeepers hello, could you please merge it? |
Cross dependency event_impl vs queue_impl prevents objects release. Event_impl now has only weak pointer to queue.
Signed-off-by: Tikhomirova, Kseniya [email protected]