[SYCL] Throw runtime exception when kernel uses work group scratch memory but has not been launched with the work_group_scratch_size property#21850
Conversation
…y but has not been launched with the work_group_scratch_size property
…thub.com/lbushi25/llvm into diagnose_work_group_scratch_memory_error
iclsrc
left a comment
There was a problem hiding this comment.
This PR adds a new property set SYCL/work group dynamic local mem that is emitted by the compiler for kernels using __sycl_dynamicLocalMemoryPlaceholder, and a corresponding runtime check that throws errc::memory_allocation when such a kernel is submitted without the work_group_scratch_size launch property.
The overall design is sound. A few issues are worth addressing before merge.
| ret void | ||
| } | ||
|
|
||
| ; CHECK-NOT: "sycl-work-group-scratch" |
There was a problem hiding this comment.
I think this check-not is always true and can be removed.
; CHECK: @__sycl_kernel_D{{.*}} #[[STATIC_MEM_ATTRS:[0-9]+]] covers what needs to be checked.
YuriPlyakhin
left a comment
There was a problem hiding this comment.
Review for PropertySet changes and SYCLLowerIR: LGTM. just one small nit left.
|
@intel/llvm-reviewers-runtime friendly ping! |
| ?SetHostTask@handler@_V1@sycl@@AEAAXV?$function@$$A6AXVinterop_handle@_V1@sycl@@@Z@std@@@Z | ||
| ?SetHostTask@handler@_V1@sycl@@AEAAXV?$function@$$A6AXXZ@std@@@Z | ||
| ?SetHostTaskFromExtEnqueueFunctions@handler@_V1@sycl@@AEAAXV?$function@$$A6AXXZ@std@@@Z | ||
| ?SetKernelLaunchpropertiesIfNotEmpty@handler@_V1@sycl@@AEAAXAEBU?$PropsHolder@Uwork_group_scratch_size@experimental@oneapi@ext@_V1@sycl@@Ucache_config@2intel@456@Uuse_root_sync_key@23456@Uwork_group_progress_key@23456@Usub_group_progress_key@23456@Uwork_item_progress_key@23456@U?$cluster_size@$00@cuda@23456@U?$cluster_size@$01@cuda@23456@U?$cluster_size@$02@cuda@23456@@kernel_launch_properties_v1@detail@23@@Z |
There was a problem hiding this comment.
@lbushi25 This change breaks ABI. We should restore SetKernelLaunchpropertiesIfNotEmpty
In light of #20651, this PR implements a runtime exception with error code
errc::memory_allocationwhen a kernel uses work group scratch memory but that it has not been submitted with thework_group_scratch_sizekernel launch property.This is done mainly by adding a new device binary image property that indicates to the runtime whether a kernel uses work group scratch memory, through a direct or indirect call to the function
get_work_group_scratch_memory.