From 790057a26b5e1b2c1d92dbc1e9cb752c04f67b3f Mon Sep 17 00:00:00 2001 From: Vivek Trivedi <5340687+trivedivivek@users.noreply.github.com> Date: Fri, 23 May 2025 13:39:51 -0700 Subject: [PATCH] [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-poisoned] --- backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.yaml | 4 ++-- backends/vulkan/runtime/graph/ops/impl/Convolution.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.yaml b/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.yaml index 1f0e8fb71be..d4cb69d7648 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.yaml +++ b/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.yaml @@ -9,8 +9,8 @@ conv2d_pw: OPERATOR: X NDIM: 3 DTYPE: float - TILE_SIZE_X: 2 - TILE_SIZE_Y: 2 + TILE_SIZE_X: 1 + TILE_SIZE_Y: 4 generate_variant_forall: DTYPE: - VALUE: half diff --git a/backends/vulkan/runtime/graph/ops/impl/Convolution.cpp b/backends/vulkan/runtime/graph/ops/impl/Convolution.cpp index 381b9de0d6a..a0ac58ea9bc 100644 --- a/backends/vulkan/runtime/graph/ops/impl/Convolution.cpp +++ b/backends/vulkan/runtime/graph/ops/impl/Convolution.cpp @@ -305,8 +305,8 @@ utils::uvec3 create_conv2d_global_wg_size( if (method == Conv2dMethod::Pointwise) { const utils::uvec3 image_extents = graph.logical_limits_of(out); return { - utils::div_up(image_extents[0u], 2u), - utils::div_up(image_extents[1u], 2u), + utils::div_up(image_extents[0u], 1u), + utils::div_up(image_extents[1u], 4u), image_extents[2u]}; } else if (method == Conv2dMethod::Depthwise && stride_equals_dilation) { const utils::uvec3 image_extents = graph.create_global_wg_size(out);