Skip to content

Commit d564e04

Browse files
committed
cont : reset shift[i]
ggml-ci
1 parent eee8d48 commit d564e04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/llama-kv-cells.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ class llama_kv_cells_unified {
144144
assert(pos[i] != -1);
145145

146146
seq_pos_rm(i);
147+
seq[i].reset();
147148

148149
pos[i] = -1;
149-
seq[i].reset();
150+
shift[i] = 0;
150151

151152
used.erase(i);
152153
}
@@ -164,6 +165,7 @@ class llama_kv_cells_unified {
164165

165166
if (seq[i].none()) {
166167
pos[i] = -1;
168+
shift[i] = 0;
167169

168170
used.erase(i);
169171

@@ -192,6 +194,7 @@ class llama_kv_cells_unified {
192194
seq[i].reset();
193195

194196
pos[i] = -1;
197+
shift[i] = 0;
195198

196199
used.erase(i);
197200

@@ -320,8 +323,6 @@ class llama_kv_cells_unified {
320323
has_shift = true;
321324

322325
if (pos[i] < 0) {
323-
seq_pos_rm(i);
324-
325326
seq[i].reset();
326327
pos[i] = -1;
327328
shift[i] = 0;

0 commit comments

Comments
 (0)