passkey : apply kv cache updates explicitly

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-02-24 12:44:02 +02:00
parent 8f9fe6dd7f
commit 79e276175e
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

View file

@ -148,6 +148,7 @@ int main(int argc, char ** argv) {
llama_kv_cache_seq_add(ctx, 0, n_past - n_batch, n_past, ib*bd);
llama_kv_cache_seq_div(ctx, 0, n_past - n_batch + ib*bd, n_past + ib*bd, n_grp);
llama_kv_cache_apply (ctx);
n_past -= bd;
}
@ -181,6 +182,7 @@ int main(int argc, char ** argv) {
llama_kv_cache_seq_rm (ctx, 0, n_keep , n_keep + n_discard);
llama_kv_cache_seq_add(ctx, 0, n_keep + n_discard, n_ctx, -n_discard);
llama_kv_cache_apply (ctx);
n_past -= n_discard;
@ -210,6 +212,7 @@ int main(int argc, char ** argv) {
llama_kv_cache_seq_rm (ctx, 0, n_keep , n_keep + n_discard);
llama_kv_cache_seq_add(ctx, 0, n_keep + n_discard, n_ctx, -n_discard);
llama_kv_cache_apply (ctx);
n_past -= n_discard;
}