From c65edd5b648564f1923103ffbb38df92006d981c Mon Sep 17 00:00:00 2001 From: slaren Date: Fri, 26 Jan 2024 18:18:26 +0100 Subject: [PATCH] ggml-alloc : add 10% margin to the buffer sizes (llama/5149) --- ggml-alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ggml-alloc.c b/ggml-alloc.c index 60141a3..95a93c9 100644 --- a/ggml-alloc.c +++ b/ggml-alloc.c @@ -335,7 +335,9 @@ bool ggml_tallocr_is_measure(ggml_tallocr_t alloc) { } size_t ggml_tallocr_max_size(ggml_tallocr_t alloc) { - return alloc->max_size; + // FIXME: changes in the tensor sizes compared to the measure graph may cause allocations to fail + // to avoid this, we add a 10% margin to the buffer size + return alloc->max_size + alloc->max_size/10; } // graph allocator