Skip to content

Commit 87cce87

Browse files
[SYCL] Enable checking the result of max_num_work_groups query with exceeded launch limits on more backends (hip and opencl) (#15369)
The HIP and OpenCL backend implementations of the query had a default return `1` group implementation, which is an incorrect assumptions. They will now be marked as _Unsupported_ with the accompanying UR chagnes (see oneapi-src/unified-runtime#2038), so for these cases the `kernel_queue_specific::max_num_work_groups` launch query will rely on the fallback that returns either `1` or `0` groups based on hardware resource limitation checks for the kernel. --------- Co-authored-by: Aaron Greig <[email protected]>
1 parent d7e9fd2 commit 87cce87

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

sycl/cmake/modules/FetchUnifiedRuntime.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,14 @@ if(SYCL_UR_USE_FETCH_CONTENT)
117117
endfunction()
118118

119119
set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
120-
# commit b79ebe4e98789144bcdf3832088eb6e6b5ae6967
121-
# Merge: 7b4bc761 fbb6e862
122-
# Author: Kenneth Benzie (Benie) <[email protected]>
123-
# Date: Fri Oct 4 16:39:59 2024 +0100
124-
# Merge pull request #2018 from wenju-he/L0-bindless-image-device-query
125-
# [L0] Fix device query of bindless image support
126-
set(UNIFIED_RUNTIME_TAG b79ebe4e98789144bcdf3832088eb6e6b5ae6967)
120+
# commit df6da35d6e67f2383db28dd49ab08c5c0ef541d2
121+
# Merge: 67590533 55bd5636
122+
# Author: aarongreig <[email protected]>
123+
# Date: Mon Oct 7 12:28:07 2024 +0100
124+
# Merge pull request #2038 from GeorgeWeb/georgi/unsupported-max-coop-wgsize
125+
# [UR][hip][opencl] Mark urKernelSuggestMaxCooperativeGroupCountExp as unsupported
126+
# instead of returning misleading default value
127+
set(UNIFIED_RUNTIME_TAG df6da35d6e67f2383db28dd49ab08c5c0ef541d2)
127128

128129
set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
129130
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need

sycl/test-e2e/Basic/launch_queries/max_num_work_groups.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,13 @@ int test_max_num_work_groups(sycl::queue &q, const sycl::device &dev) {
161161
// It cannot be possible to launch a kernel successfully with a configuration
162162
// that exceeds the available resources as in the above defined workGroupSize.
163163
// workGroupSize is larger than maxWorkGroupSize, hence maxWGs must equal 0.
164-
// Note: Level-Zero currently always returns a non-zero value. While other
165-
// backends (i.e., OpenCL, HIP) always return 1 in their implementations.
166-
if (dev.get_backend() == sycl::backend::ext_oneapi_cuda) {
167-
assert(maxWGs == 0 && "max_num_work_groups query failed");
164+
// Note: Level-Zero currently always returns a non-zero value.
165+
// TODO: Remove the backend condition once the Level-Zero API issue is fixed.
166+
if (dev.get_backend() != sycl::backend::ext_oneapi_level_zero) {
167+
assert(maxWGs == 0 &&
168+
"max_num_work_groups query failed.\n"
169+
"It should return 0 possible groups when the requested resources "
170+
"by the lanuch config exceed those available in the hardware.");
168171
}
169172

170173
// As we ensured that the 'max_num_work_groups' query correctly

0 commit comments

Comments
 (0)