From 743ec9b221a4235ce072a5077355a4a7dfd3a27a Mon Sep 17 00:00:00 2001 From: Chris Kuehl Date: Fri, 24 Mar 2023 19:17:34 -0500 Subject: [PATCH] Fix crash for 65B model with pre-allocated memory --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 9d48ccd4c..447fa91f3 100644 --- a/llama.cpp +++ b/llama.cpp @@ -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();