diff options
author | slaren <slarengh@gmail.com> | 2024-01-26 18:18:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 19:18:26 +0200 |
commit | 15b4538ff29b280a395a1406d711497d8eaa2564 (patch) | |
tree | 25d9a53faaae5c9c0bd5ded53272a155c47c62ef | |
parent | 7032f4f6349c17a8352f9f93f7d2122f45469e59 (diff) |
ggml-alloc : add 10% margin to the buffer sizes (#5149)
-rw-r--r-- | ggml-alloc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ggml-alloc.c b/ggml-alloc.c index 60141a34..95a93c99 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 |