Skip to content

Commit c9d79db

Browse files
committed
1
1 parent 9ec19e1 commit c9d79db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ggml/src/ggml-vulkan/vulkan-shaders/ssm_scan.comp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ void main() {
6868
state[j] = s0[s0_base_idx + j * D_STATE + tid];
6969
}
7070

71+
if (tid >= D_STATE) {
72+
return;
73+
}
74+
7175
for (int i = 0; i < int(n_tok); i++) {
7276
float dt_soft_plus = dt[dt_base_idx + i * stride_dt];
7377
dt_soft_plus = softplus(dt_soft_plus);
@@ -119,9 +123,8 @@ void main() {
119123
barrier();
120124
}
121125

122-
y = warp_sdata[tid & ~(SUBGROUP_SIZE - 1)];
123-
124126
if (tid % SUBGROUP_SIZE == 0) {
127+
y = warp_sdata[tid & ~(SUBGROUP_SIZE - 1)];
125128
const int k = tid / SUBGROUP_SIZE + j * (D_STATE / SUBGROUP_SIZE);
126129
d[y_base_idx + uint(i) * uint(stride_y) + uint(k)] = y;
127130
}

0 commit comments

Comments
 (0)