Skip to content

Commit c1ff85c

Browse files
trivedivivekfacebook-github-bot
authored andcommitted
Minor perf improvements to quantized mat mul shader. (#15261)
Summary: The diff includes minor performance improvements to the quantized matrix multiplication shader. Differential Revision: D84998542
1 parent 10a0f8c commit c1ff85c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,14 @@ void main() {
6969
sums[r][${c}] = VEC4_T(0.0);
7070
}
7171

72+
const int in_row_txstride = div4(in_sizes.x);
73+
7274
for (int pos = 0, txpos = 0;
73-
pos < in_sizes.x;
75+
txpos < in_row_txstride;
7476
pos += 4, txpos += 1) {
7577

7678
T mat1[TILE_ROWS][4];
7779

78-
$if IN_STORAGE == "buffer":
79-
uint in_row_txstride = div4(in_sizes.x);
80-
8180
// Preload input tensor
8281
for (int i = 0; i < TILE_ROWS; i++) {
8382
$if IN_STORAGE == "buffer":

0 commit comments

Comments
 (0)