Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GPU][PTL] WA: Set max WG size to 512 for reduce_ref kernel in PTL (#35072)

Jade Chobfb47d6f81b7
diff --git a/src/plugins/intel_gpu/src/kernel_selector/kernels/reduce/reduce_kernel_ref.cpp b/src/plugins/intel_gpu/src/kernel_selector/kernels/reduce/reduce_kernel_ref.cpp
index 0c48e584395..0cf300807eb 100644
--- a/src/plugins/intel_gpu/src/kernel_selector/kernels/reduce/reduce_kernel_ref.cpp
+++ b/src/plugins/intel_gpu/src/kernel_selector/kernels/reduce/reduce_kernel_ref.cpp
@@ -43,7 +43,14 @@ CommonDispatchData ReduceKernelRef::SetDefault(const reduce_params& params) cons
dispatchData.gws = { params.outputs[0].X().v * params.outputs[0].Y().v,
params.outputs[0].Z().v * params.outputs[0].W().v * params.outputs[0].U().v * params.outputs[0].V().v,
params.outputs[0].Batch().v * params.outputs[0].Feature().v };
- dispatchData.lws = GetOptimalLocalWorkGroupSizes(dispatchData.gws, params.engineInfo, in_layout, out_layout, dims_by_gws);
+
+ // [WA] PTL (Panther Lake, xe3p) IGC may allocate more than 128 GRF per thread,
+ // which reduces the per-kernel max work-group size below the device max reported at query time.
+ // Enqueuing with the original max WGS then triggers CL_INVALID_WORK_GROUP_SIZE (-54).
+ // Limit to 512 on PTL to stay within the reduced per-kernel limit.
+ auto engineInfo = params.engineInfo;
+ engineInfo.maxWorkGroupSize = std::min(engineInfo.maxWorkGroupSize, static_cast<uint64_t>(512));
+ dispatchData.lws = GetOptimalLocalWorkGroupSizes(dispatchData.gws, engineInfo, in_layout, out_layout, dims_by_gws);
return dispatchData;
}