Skip to content

Commit 5814dda

Browse files
committed
[ET-VK] Tuning conv 2d pw op tile size to improve perf.
This diff tunes the tile size for the conv 2d pw op to improve performance. The changes include updating the `TILE_SIZE_X` and `TILE_SIZE_Y` values in the `conv2d_pw.yaml` files and modifying the `Convolution.cpp` files to adjust the image extents calculation. The `TILE_SIZE_X` value is changed from 2 to 1, and the `TILE_SIZE_Y` value is changed from 2 to 4. Differential Revision: [D75317820](https://our.internmc.facebook.com/intern/diff/D75317820/) ghstack-source-id: 285956546 Pull Request resolved: #11112
1 parent fab35e1 commit 5814dda

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ conv2d_pw:
99
OPERATOR: X
1010
NDIM: 3
1111
DTYPE: float
12-
TILE_SIZE_X: 2
13-
TILE_SIZE_Y: 2
12+
TILE_SIZE_X: 1
13+
TILE_SIZE_Y: 4
1414
generate_variant_forall:
1515
DTYPE:
1616
- VALUE: half

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ utils::uvec3 create_conv2d_global_wg_size(
305305
if (method == Conv2dMethod::Pointwise) {
306306
const utils::uvec3 image_extents = graph.logical_limits_of(out);
307307
return {
308-
utils::div_up(image_extents[0u], 2u),
309-
utils::div_up(image_extents[1u], 2u),
308+
utils::div_up(image_extents[0u], 1u),
309+
utils::div_up(image_extents[1u], 4u),
310310
image_extents[2u]};
311311
} else if (method == Conv2dMethod::Depthwise && stride_equals_dilation) {
312312
const utils::uvec3 image_extents = graph.create_global_wg_size(out);

0 commit comments

Comments
 (0)