Skip to content

Commit 8494b90

Browse files
pytorchbotSS-JIA
andauthored
[ET-VK][ez] Fix conv2d_pw shared memory buffer not having a constant size (#7734)
## 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-source-id: 261911463 Pull Request resolved: #7729 Co-authored-by: Stephen Jia <[email protected]>
1 parent 04f764e commit 8494b90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ ${layout_declare_ubo(8, "float", "out_min", "float", "out_max")}
3333
layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
3434

3535
// shared memory to hold calculated positions, this would reduce register usage thus improving performance.
36-
shared ivec2 pos_shared[gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z * TILE_SIZE * TILE_SIZE];
36+
// 64 is the number of threads in the local wg
37+
$num_shared = 64 * TILE_SIZE * TILE_SIZE
38+
shared ivec2 pos_shared[${num_shared}];
3739

3840
/*
3941
* Computes a 2D pointwise convolution of an NxN output tile. Calculating an

0 commit comments

Comments
 (0)