ggml : fix ggml_backend_buft_get_alloc_size() guard (llama/28038)

This commit is contained in:
Georgi Gerganov
2026-09-04 13:39:35 +03:00
parent e9583f075a
commit 749683d30f
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -70,6 +70,7 @@ size_t ggml_backend_buft_get_alloc_size(ggml_backend_buffer_type_t buft, const s
// if you hit this assert, update ggml_backend_op_alloc_size_may_expand() accordingly
GGML_ASSERT(size <= ggml_nbytes(tensor) ||
ggml_op_is_empty(tensor->op) ||
ggml_is_quantized(tensor->type) || // [TAG_ALLOC_SIZE_EXPAND]
ggml_backend_op_alloc_size_may_expand(tensor->op));
return size;
+1
View File
@@ -915,6 +915,7 @@ static size_t ggml_backend_cuda_buffer_type_get_alloc_size(ggml_backend_buffer_t
: ggml_nbytes(tensor);
int64_t ne0 = tensor->ne[0];
// [TAG_ALLOC_SIZE_EXPAND]
if (ggml_is_quantized(tensor->type)) {
if (ne0 % MATRIX_ROW_PADDING != 0) {
GGML_ASSERT(tensor->nb[0] == ggml_element_size(tensor));