]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml-alloc : add 10% margin to the buffer sizes (llama/5149)
authorslaren <redacted>
Fri, 26 Jan 2024 17:18:26 +0000 (18:18 +0100)
committerGeorgi Gerganov <redacted>
Sat, 27 Jan 2024 15:19:52 +0000 (17:19 +0200)
ggml-alloc.c

index 60141a34d8f6a22a13238934e66ba920f3ea99ac..95a93c99d2427f50ee46d5d93180a85ca99c890b 100644 (file)
@@ -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