From c2c66eefb42ef565e510594a28dd562fb8fa594f Mon Sep 17 00:00:00 2001 From: Stephen Jia Date: Fri, 17 Jan 2025 09:20:18 -0800 Subject: [PATCH] [ET-VK][ez] Fix `conv2d_pw` shared memory buffer not having a constant size ## Context `conv2d_pw` was failing to compile on Mac due to the shared memory array not having a constant size. Simply hardcode the workgroup size to fix. Differential Revision: [D68331984](https://our.internmc.facebook.com/intern/diff/D68331984/) [ghstack-poisoned] --- backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl b/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl index a5a2097cd50..f72c487fa78 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl +++ b/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl @@ -33,7 +33,9 @@ ${layout_declare_ubo(8, "float", "out_min", "float", "out_max")} layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; // shared memory to hold calculated positions, this would reduce register usage thus improving performance. -shared ivec2 pos_shared[gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z * TILE_SIZE * TILE_SIZE]; +// 64 is the number of threads in the local wg +$num_shared = 64 * TILE_SIZE * TILE_SIZE +shared ivec2 pos_shared[${num_shared}]; /* * Computes a 2D pointwise convolution of an NxN output tile. Calculating an