From: slaren Date: Fri, 26 Jan 2024 17:18:26 +0000 (+0100) Subject: ggml-alloc : add 10% margin to the buffer sizes (llama/5149) X-Git-Tag: upstream/0.0.1642~1039 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=c24981204bec6fe4e5045f4df76314042f33afc5;p=pkg%2Fggml%2Fsources%2Fggml ggml-alloc : add 10% margin to the buffer sizes (llama/5149) --- diff --git a/src/ggml-alloc.c b/src/ggml-alloc.c index 60141a34..95a93c99 100644 --- a/src/ggml-alloc.c +++ b/src/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