slaren commited on
Commit
c55bdf8
·
unverified ·
1 Parent(s): 3a3eb8e

ggml-alloc : add 10% margin to the buffer sizes (llama/5149)

Browse files
Files changed (1) hide show
  1. ggml-alloc.c +3 -1
ggml-alloc.c CHANGED
@@ -335,7 +335,9 @@ bool ggml_tallocr_is_measure(ggml_tallocr_t alloc) {
335
  }
336
 
337
  size_t ggml_tallocr_max_size(ggml_tallocr_t alloc) {
338
- return alloc->max_size;
 
 
339
  }
340
 
341
  // graph allocator
 
335
  }
336
 
337
  size_t ggml_tallocr_max_size(ggml_tallocr_t alloc) {
338
+ // FIXME: changes in the tensor sizes compared to the measure graph may cause allocations to fail
339
+ // to avoid this, we add a 10% margin to the buffer size
340
+ return alloc->max_size + alloc->max_size/10;
341
  }
342
 
343
  // graph allocator