Skip to content

[SYCL][E2E] Wait for kernels in max_num_work_groups_sync_query test - #23562

Open
HoppeMateusz wants to merge 1 commit into
intel:syclfrom
HoppeMateusz:sycl_e2e_fix_max_num_work_groups_sync_query
Open

HoppeMateusz wants to merge 1 commit into
intel:syclfrom
HoppeMateusz:sycl_e2e_fix_max_num_work_groups_sync_query

Conversation

@HoppeMateusz

@HoppeMateusz HoppeMateusz commented Oct 20, 2026 •

Copy link
Copy Markdown

testFreeFunctionKernel() launches a kernel with use_root_sync and the maximum number of work-groups returned by max_num_work_groups_sync, then frees the kernel's USM allocation without waiting for the kernel to finish.

testFreeFunctionKernel() launches a kernel with use_root_sync and the
maximum number of work-groups returned by max_num_work_groups_sync,
then frees the USM allocation used by the kernel without waiting for
the kernel to finish.

The test runs on a default (out-of-order) queue, so the four
free-function launches are independent and may execute concurrently.
Each launch is sized by max_num_work_groups_sync to occupy the whole
device, so when two of them overlap neither can have all of its
work-groups resident at once and their root-group barriers never
complete. This was observed as a hang on Level Zero, where the
out-of-order queue distributes the launches over several command lists
and hardware contexts. Freeing memory that a running kernel still
writes is also undefined behavior.

Wait on the queue before freeing the allocation, the same way
testLambdaKernel() already does. This serializes the root-group
synchronized launches and removes the use-after-free.

HSD-ES: 21045664176

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
@HoppeMateusz
HoppeMateusz requested a review from a team as a code owner October 20, 2026 12:59

This branch has not been deployed

No deployments
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.

1 participant