llama : add struct llama_kv_cache (wip) [no ci]
This commit is contained in:
parent
178a7eb952
commit
f78b396ee7
8 changed files with 428 additions and 415 deletions
|
@ -952,7 +952,9 @@ struct common_init_result common_init_from_params(common_params & params) {
|
|||
return iparams;
|
||||
}
|
||||
|
||||
if (params.ctx_shift && !llama_kv_cache_can_shift(lctx)) {
|
||||
llama_kv_cache * kv = llama_get_kv_cache(lctx);
|
||||
|
||||
if (params.ctx_shift && !llama_kv_cache_can_shift(kv)) {
|
||||
LOG_WRN("%s: KV cache shifting is not supported for this model, disabling KV cache shifting\n", __func__);
|
||||
params.ctx_shift = false;
|
||||
}
|
||||
|
@ -1057,7 +1059,7 @@ struct common_init_result common_init_from_params(common_params & params) {
|
|||
if (llama_model_has_decoder(model)) {
|
||||
llama_decode(lctx, llama_batch_get_one(tmp.data(), std::min(tmp.size(), (size_t) params.n_batch)));
|
||||
}
|
||||
llama_kv_cache_clear(lctx);
|
||||
llama_kv_cache_clear(kv);
|
||||
llama_synchronize(lctx);
|
||||
llama_perf_context_reset(lctx);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue