|
|
@@ -133,9 +133,8 @@ int main(int argc, char ** argv) {
|
|
|
const int ib = i/n_batch - 1;
|
|
|
const int bd = n_batch_grp*(n_grp - 1);
|
|
|
|
|
|
- llama_kv_self_seq_add (ctx, 0, n_past - n_batch, n_past, ib*bd);
|
|
|
- llama_kv_self_seq_div (ctx, 0, n_past - n_batch + ib*bd, n_past + ib*bd, n_grp);
|
|
|
- llama_kv_self_update (ctx);
|
|
|
+ llama_kv_self_seq_add(ctx, 0, n_past - n_batch, n_past, ib*bd);
|
|
|
+ llama_kv_self_seq_div(ctx, 0, n_past - n_batch + ib*bd, n_past + ib*bd, n_grp);
|
|
|
|
|
|
n_past = llama_kv_self_seq_pos_max(ctx, 0) + 1;
|
|
|
}
|
|
|
@@ -169,8 +168,6 @@ int main(int argc, char ** argv) {
|
|
|
|
|
|
llama_kv_self_seq_rm (ctx, 0, n_keep , n_keep + n_discard);
|
|
|
llama_kv_self_seq_add(ctx, 0, n_keep + n_discard, n_ctx, -n_discard);
|
|
|
- //llama_kv_self_defrag (ctx);
|
|
|
- llama_kv_self_update (ctx);
|
|
|
|
|
|
n_past = llama_kv_self_seq_pos_max(ctx, 0) + 1;
|
|
|
|
|
|
@@ -200,8 +197,6 @@ int main(int argc, char ** argv) {
|
|
|
|
|
|
llama_kv_self_seq_rm (ctx, 0, n_keep , n_keep + n_discard);
|
|
|
llama_kv_self_seq_add(ctx, 0, n_keep + n_discard, n_ctx, -n_discard);
|
|
|
- //llama_kv_self_defrag (ctx);
|
|
|
- llama_kv_self_update (ctx);
|
|
|
|
|
|
n_past = llama_kv_self_seq_pos_max(ctx, 0) + 1;
|
|
|
}
|