From c472ab4f695e2b91727196b6a4b965f91487b720 Mon Sep 17 00:00:00 2001 From: xaedes Date: Tue, 29 Aug 2023 22:49:01 +0200 Subject: [PATCH] fix error message in ggml_allocr_alloc to display actual max_avail (cherry picked from commit 5854f51188cf6746972c6dc350534686cec09660) --- ggml-alloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ggml-alloc.c b/ggml-alloc.c index cb761d57a..a896601d1 100644 --- a/ggml-alloc.c +++ b/ggml-alloc.c @@ -165,6 +165,7 @@ void ggml_allocr_alloc(struct ggml_allocr * alloc, struct ggml_tensor * tensor) if (best_fit_block == -1) { // the last block is our last resort struct free_block * block = &alloc->free_blocks[alloc->n_free_blocks - 1]; + max_avail = MAX(max_avail, block->size); if (block->size >= size) { best_fit_block = alloc->n_free_blocks - 1; } else {