Skip to content

[SYCL] Disable L0 leak check with host task on Windows - #22918

Open
KseniyaTikhomirova wants to merge 1 commit into
intel:syclfrom
KseniyaTikhomirova:disable_host_task_leak_check_win
Open

[SYCL] Disable L0 leak check with host task on Windows#22918
KseniyaTikhomirova wants to merge 1 commit into
intel:syclfrom
KseniyaTikhomirova:disable_host_task_leak_check_win

Conversation

@KseniyaTikhomirova

Copy link
Copy Markdown
Contributor

CMPLRLLVM-74630

Disabling tests that can potentially produce flaky failures due to a known issue. host_task.cpp has confirmed flaky issue due to the following.
What happens and why behavior is flaky:
in a case with HT we have at least 2 threads in a program: main thread where submission happens and a thread where host task is executed.
HT thread: Worker for HT performs work as: wait for HT dependencies, execute host task, signal host task event to the completed state, try to enqueue all dependent operations (for this HT event must be signaled), do commands cleanup as the last stage. Note that in order to enqueue all dependent tasks we keep shared_ptr to QueueImpl alive, see https://github.com/intel/llvm/blob/sycl/sycl/source/detail/scheduler/scheduler.cpp#L517.
Main thread: do all submissions then wait for kernels via urEventsWait (or QueueFinish) and explicitly wait for host event representation of HT (polling of var value). That means that Queue.wait() will wait for HT event to be signalled and dependent kernel to be completed but won't wait for all operations of HT worker (cleanup). That means that in some cases main thread can finish before last HT worker completion (cleanup). That means that shared pointer to Queue in the main thread may be released while shared pointer to the same queue in HT thread is still alive. Some commands and related resources can be not yet destroyed as well.
Since on Windows we can't properly wait for threads to be joined (we intentionally leak resources that can be affected by this, so it is a known issue) exit handlers that triggers static variables destruction and LEAK analysis may run before queue (and other resources) destruction. Windows system will reclaim resources itself.

Note: List of updated tests contains some scenarios with HT that is unlikely to be affected since they have a lot of work after HT so it is unlikely to have so big delay in resource release to trigger the issue. Although LEAK check with HT in Windows is problematic in general so I included all entries.

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
@KseniyaTikhomirova
KseniyaTikhomirova marked this pull request as ready for review August 11, 2026 11:06
@KseniyaTikhomirova
KseniyaTikhomirova requested a review from a team as a code owner August 11, 2026 11:06
@KseniyaTikhomirova

Copy link
Copy Markdown
Contributor Author

windows failure is in unrelated test
Failed Tests (1):
SYCL :: Adapters/level_zero/batch_event_status.cpp

@adamfidel adamfidel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

I tried looking into these leaks for a bit but couldn't figure it out. Thanks for root causing this and guarding these tests!

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.

2 participants