Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ggml/src/ggml-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ static ggml_backend_buffer_t ggml_backend_alloc_ctx_tensors_from_buft_impl(
this_size = GGML_PAD(ggml_backend_buft_get_alloc_size(buft, t), alignment);
}

if (cur_buf_size > 0 && (cur_buf_size + this_size) > max_size) {
if (cur_buf_size > 0 && this_size > 0 && (cur_buf_size + this_size) > max_size) {
// allocate tensors in the current buffer
if (!no_alloc && !alloc_tensor_range(ctx, first, t, buft, cur_buf_size, &buffers, &n_buffers)) {
return NULL;
Expand Down
Loading