Skip to content

Commit

Permalink
Revert "Revert "ggml-alloc : add 10% margin to the buffer sizes (gger…
Browse files Browse the repository at this point in the history
…ganov#5149)""

This reverts commit 611ff55.
  • Loading branch information
Nexesenex committed Feb 11, 2024
1 parent cbe37a6 commit 8c772a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ggml-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8c772a0

Please sign in to comment.