From: Yavor Ivanov Date: Mon, 9 Oct 2023 12:24:37 +0000 (+0300) Subject: Disable ggml-alloc assert for CPU version of Sam.cpp if the view doesn't have a buffe... X-Git-Tag: upstream/0.0.1642~1225 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=50d7203be22f018f6df1aafea8c22e50391308ea;p=pkg%2Fggml%2Fsources%2Fggml Disable ggml-alloc assert for CPU version of Sam.cpp if the view doesn't have a buffer (#562) --- diff --git a/src/ggml-alloc.c b/src/ggml-alloc.c index 3321f05e..34eba3f8 100644 --- a/src/ggml-alloc.c +++ b/src/ggml-alloc.c @@ -386,7 +386,7 @@ static void init_view(struct ggml_allocr * alloc, struct ggml_tensor * view) { // FIXME: the view should be initialized by the owning buffer, but currently this breaks the CUDA backend // due to the ggml_tensor_extra_gpu ring buffer overwriting the KV cache extras - assert(ggml_allocr_is_measure(alloc) || view->buffer->backend == alloc->buffer->backend); + assert(ggml_allocr_is_measure(alloc) || !view->buffer || view->buffer->backend == alloc->buffer->backend); ggml_backend_buffer_init_tensor(alloc->buffer, view); }