From b810424edf3e6226be8ee2fe430b8f69c27709b3 Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Wed, 9 Aug 2023 23:33:33 +0300 Subject: [PATCH] ggml-alloc: >= when checking for out-of-bounds Co-authored-by: slaren --- ggml-alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml-alloc.c b/ggml-alloc.c index 200b82ab7..4121f3dba 100644 --- a/ggml-alloc.c +++ b/ggml-alloc.c @@ -397,7 +397,7 @@ static void allocate_node(struct ggml_allocr * alloc, struct ggml_tensor * node) // if the node's data is external, then we cannot re-use it if ((char *) parent->data < (char *) alloc->data || - (char *) parent->data > ((char *) alloc->data + alloc->size)) { + (char *) parent->data >= ((char *) alloc->data + alloc->size)) { AT_PRINTF("not reusing parent %s for %s as %p is external\n", parent->name, node->name, parent->data); continue; }