Skip to content

Commit

Permalink
Fix crash for 65B model with pre-allocated memory (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskuehl authored Mar 25, 2023
1 parent 8520fc3 commit 6f1ee4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static bool kv_cache_init(
const int n_mem = n_layer*n_ctx;
const int n_elements = n_embd*n_mem;

cache.buf.resize(2*n_elements*ggml_type_size(wtype) + 2u*MB);
cache.buf.resize(2u*n_elements*ggml_type_size(wtype) + 2u*MB);

struct ggml_init_params params;
params.mem_size = cache.buf.size();
Expand Down

0 comments on commit 6f1ee4b

Please sign in to comment.