summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorslaren <slarengh@gmail.com>2023-10-09 14:44:58 +0200
committerGitHub <noreply@github.com>2023-10-09 15:44:58 +0300
commit95bd60a0a69f57e9a2ff1269667ea484a1a9bb40 (patch)
tree5e0df59798d36e299c157d87b35885fcf2e84e39
parentfcca0a700487999d52a525c96d6661e9f6a8703a (diff)
ggml-alloc : fix assert in debug builds (#3555)
-rw-r--r--ggml-alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml-alloc.c b/ggml-alloc.c
index 3321f05e..34eba3f8 100644
--- a/ggml-alloc.c
+++ b/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);
}