Skip to content

Commit b401a87

Browse files
committed
kv-cells : update comments [no ci]
1 parent eda2e13 commit b401a87

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/llama-kv-cells.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,15 @@ class llama_kv_cells_unified {
194194
return shift[i];
195195
}
196196

197+
// check if a cell is not empty and its position is within [p0, p1)
197198
bool pos_in(uint32_t i, llama_pos p0, llama_pos p1) const {
198199
assert(i < pos.size());
199200

200201
return pos[i] >= p0 && pos[i] < p1;
201202
}
202203

204+
// set the position of an empty cell
205+
// does not modify "has_shift"
203206
// note: call only if the cell is empty
204207
void pos_set(uint32_t i, llama_pos p) {
205208
assert(i < pos.size());
@@ -210,6 +213,7 @@ class llama_kv_cells_unified {
210213
}
211214

212215
// pos[i] = pos[i] + d
216+
// sets "has_shift" to true
213217
// note: call only if the cell is not empty
214218
bool pos_add(uint32_t i, llama_pos d) {
215219
assert(i < pos.size());
@@ -233,6 +237,7 @@ class llama_kv_cells_unified {
233237
}
234238

235239
// pos[i] = pos[i] / d
240+
// sets "has_shift" to true
236241
// note: call only if the cell is not empty
237242
void pos_div(uint32_t i, int d) {
238243
assert(i < pos.size());
@@ -267,7 +272,6 @@ class llama_kv_cells_unified {
267272
//
268273
std::vector<llama_pos> shift;
269274

270-
// TODO: assert n_seq_max <= 64
271275
std::vector<std::bitset<LLAMA_MAX_PARALLEL_SEQUENCES>> seq;
272276
};
273277

0 commit comments

Comments
 (0)