From ced8e8d40d69461925b799c42043ef2caa579fd3 Mon Sep 17 00:00:00 2001 From: l3utterfly Date: Mon, 19 Jun 2023 14:46:15 +0800 Subject: [PATCH] fixed issue: memory is not guaranteed to be aligned properly during ggml_init call from loading saved sessions --- llama.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama.cpp b/llama.cpp index 2105e3279..ce33f7fbe 100644 --- a/llama.cpp +++ b/llama.cpp @@ -3122,9 +3122,9 @@ size_t llama_copy_state_data(struct llama_context * ctx, uint8_t * dst) { if (kv_size) { const size_t elt_size = ggml_element_size(kv_self.k); - char buffer[4096]; + //char buffer[4096]; - ggml_context * cpy_ctx = ggml_init({ sizeof(buffer), buffer, /* no_alloc */ true }); + ggml_context * cpy_ctx = ggml_init({ 4096, NULL, /* no_alloc */ true }); ggml_cgraph gf{}; gf.n_threads = 1;