Skip to content

Commit fe5afd4

Browse files
committed
SYCL: mmq add condition to prevent blocks_per_tile_x_row variable from becoming 0
1 parent 71d84a5 commit fe5afd4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ggml/src/ggml-sycl/mmq.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ load_tiles_q4_K(const void *__restrict__ vx, int *__restrict__ x_ql,
815815
x_ql[i * (WARP_SIZE + 1) + k] = get_int_from_uint8_aligned(bxi->qs, kqsx);
816816
}
817817

818-
const int blocks_per_tile_x_row = WARP_SIZE / QI4_K; // == 1 if QK_K == 256
818+
constexpr int blocks_per_tile_x_row = QI4_K > WARP_SIZE ? 1 : WARP_SIZE / QI4_K; // == 1 if QK_K == 256
819819
const int kbxd = k % blocks_per_tile_x_row; // == 0 if QK_K == 256
820820

821821
#pragma unroll
@@ -963,7 +963,7 @@ load_tiles_q5_K(const void *__restrict__ vx, int *__restrict__ x_ql,
963963
x_ql[i * (2*WARP_SIZE + 1) + kq1] = ql1 | qh1;
964964
}
965965

966-
const int blocks_per_tile_x_row = WARP_SIZE / QI5_K; // == 1 if QK_K == 256
966+
constexpr int blocks_per_tile_x_row = QI5_K > WARP_SIZE ? 1 : WARP_SIZE / QI5_K; // == 1 if QK_K == 256
967967
const int kbxd = k % blocks_per_tile_x_row; // == 0 if QK_K == 256
968968

969969
#pragma unroll
@@ -1111,7 +1111,7 @@ load_tiles_q6_K(const void *__restrict__ vx, int *__restrict__ x_ql,
11111111
dpct::sub_sat());
11121112
}
11131113

1114-
const int blocks_per_tile_x_row = WARP_SIZE / QI6_K; // == 1 if QK_K == 256
1114+
constexpr int blocks_per_tile_x_row = QI6_K > WARP_SIZE ? 1 : WARP_SIZE / QI6_K; // == 1 if QK_K == 256
11151115
const int kbxd = k % blocks_per_tile_x_row; // == 0 if QK_K == 256
11161116
float * x_dmf = (float *) x_dm;
11171117

0 commit comments

Comments
 (0)