Skip to content

Commit 1d3f7e3

Browse files
authored
[ET-VK] Minor tuning for conv2d pw op to improve performance.
Differential Revision: D75251145 Pull Request resolved: #11113
1 parent 1b64329 commit 1d3f7e3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ void main() {
4949
const uint div_by_x = gl_GlobalInvocationID.x / out_limits_scaled.x;
5050
const ivec3 gpos = ivec3(
5151
gl_GlobalInvocationID.x % out_limits_scaled.x,
52-
div_by_x % out_limits_scaled.y,
53-
div_by_x / out_limits_scaled.y);
52+
div_by_x,
53+
gl_GlobalInvocationID.y);
5454

5555
// If the top left position is out of bounds, then this invocation will have
5656
// no work to do.
57-
if (gpos.z >= out_limits.z) {
57+
if (gpos.y >= out_limits_scaled.y || gpos.z >= out_limits.z) {
5858
return;
5959
}
6060

backends/vulkan/runtime/graph/ops/impl/Convolution.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,10 @@ void add_conv2d_node(
398398
utils::uvec3 wg_size = create_conv2d_global_wg_size(
399399
graph, method, out, weight_data, stride_equals_dilation);
400400

401-
if (method == Conv2dMethod::Pointwise || method == Conv2dMethod::Depthwise) {
401+
if (method == Conv2dMethod::Depthwise) {
402402
wg_size = {wg_size[0] * wg_size[1] * wg_size[2], 1, 1};
403+
} else if (method == Conv2dMethod::Pointwise) {
404+
wg_size = {wg_size[0] * wg_size[1], wg_size[2], 1};
403405
}
404406

405407
vkapi::ParamsBindList param_buffers;

0 commit comments

Comments
 (0)