Skip to content

Commit c733cd0

Browse files
[GPU] Optimize Dispatch Data Configuration for Mirror Padding Kernel (openvinotoolkit#32400)
## [GPU] Optimize Dispatch Data Configuration for Mirror Padding Kernel ### Description: Added a new logic that optimizes the selection of GWS/LWS config for Padding kernels by introducing predefined mapping for special cases. This modification improves hardware resource utilization, resulting in a significant increase in OpenCL kernel performance. Detailed performance results: CVS-174882. ### Implementation-level details: - Added an dispatch optimization for border kernels that improves kernel performance. - For selected GWS, the new logic applies a lookup table with predefined optimal (GWS, LWS) pairs. - The function introduces better local workgroup size (LWS) allocation. - The optimization is stateless, encapsulated, and reusable across all border kernel implementations. - Additional predefined pairs can be added easily. ### Reproduction step and snapshot: Description available at the foot of the description section of the JIRA ticket : CVS-174882. ### Problematic graph: n/a ### Checklist: - [x] Is it a proper fix? - [ ] Did you include test case for this fix, if necessary? - [x] Did you review existing test that can be extended to cover this scenario? ### Tickets: - CVS-174882 - CVS-173805
1 parent be8f36b commit c733cd0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/plugins/intel_gpu/src/kernel_selector/kernels/border/border_kernel_base.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ BorderKernelBase::DispatchData BorderKernelBase::SetDefault(const border_params&
5757
dispatchData.lws = GetOptimalLocalWorkGroupSizes(dispatchData.gws, params.engineInfo, in_layout, out_layout, dims_by_gws);
5858
}
5959

60+
using DispatchDataPair = std::pair<std::array<size_t, 3>, std::array<size_t, 3>>;
61+
static const std::array<DispatchDataPair, 4> lws_mapping_table = {{
62+
DispatchDataPair{{264, 264, 32}, {1, 1, 32}},
63+
DispatchDataPair{{264, 264, 64}, {1, 1, 64}},
64+
DispatchDataPair{{132, 132, 128}, {1, 1, 64}},
65+
DispatchDataPair{{ 3, 336, 336}, {3, 8, 8}}
66+
}};
67+
std::array<size_t, 3> gws = {dispatchData.gws[0], dispatchData.gws[1], dispatchData.gws[2]};
68+
auto it = std::find_if(lws_mapping_table.begin(), lws_mapping_table.end(), [&gws](const DispatchDataPair& ddp) { return ddp.first == gws; });
69+
if (it != lws_mapping_table.end()) { dispatchData.lws = {it->second[0], it->second[1], it->second[2]}; }
70+
6071
return dispatchData;
6172
}
6273

0 commit comments

Comments
 (0)