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

pull/1812/head
slaren 2024-01-26 18:18:26 +01:00 committed by Georgi Gerganov
parent 3c8d14e9c5
commit c65edd5b64
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735
1 changed files with 3 additions and 1 deletions

View 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