From bced4595b87ff6355f86467a12e62bd2dc71573e Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Thu, 24 Sep 2026 22:44:05 +0300 Subject: [PATCH] sync : ggml (#29396) * ggml : bump version to 0.25.2 (ggml/1642) * ggml : fix ubsan error in `ggml_graph_nbytes` (ggml/1644) * ggml : bump version to 0.25.3 (ggml/1645) * sync : ggml --- ggml/CMakeLists.txt | 2 +- ggml/src/ggml.c | 4 ++-- scripts/sync-ggml.last | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ggml/CMakeLists.txt b/ggml/CMakeLists.txt index 1df78fddfd..752dabbb63 100644 --- a/ggml/CMakeLists.txt +++ b/ggml/CMakeLists.txt @@ -5,7 +5,7 @@ project("ggml" C CXX ASM) ### GGML Version set(GGML_VERSION_MAJOR 0) set(GGML_VERSION_MINOR 25) -set(GGML_VERSION_PATCH 1) +set(GGML_VERSION_PATCH 3) set(GGML_VERSION_BASE "${GGML_VERSION_MAJOR}.${GGML_VERSION_MINOR}.${GGML_VERSION_PATCH}") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/") diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c index a286083b93..cdc10a7597 100644 --- a/ggml/src/ggml.c +++ b/ggml/src/ggml.c @@ -7450,7 +7450,7 @@ static void * incr_ptr_aligned(void ** p, size_t size, size_t align) { static size_t ggml_graph_nbytes(size_t size, bool grads) { size_t hash_size = ggml_hash_size(size * 2); - void * p = 0; + void * p = (char *) 1024; // workaround for ubsan error "applying non-zero offset X to null pointer" incr_ptr_aligned(&p, sizeof(struct ggml_cgraph), 1); incr_ptr_aligned(&p, size * sizeof(struct ggml_tensor *), sizeof(struct ggml_tensor *)); // nodes incr_ptr_aligned(&p, size * sizeof(struct ggml_tensor *), sizeof(struct ggml_tensor *)); // leafs @@ -7463,7 +7463,7 @@ static size_t ggml_graph_nbytes(size_t size, bool grads) { incr_ptr_aligned(&p, ggml_bitset_size(hash_size) * sizeof(ggml_bitset_t), sizeof(ggml_bitset_t)); size_t nbytes = (size_t) p; - return nbytes; + return nbytes - 1024; } size_t ggml_graph_overhead_custom(size_t size, bool grads) { diff --git a/scripts/sync-ggml.last b/scripts/sync-ggml.last index 8f4afc721b..35cd376dbb 100644 --- a/scripts/sync-ggml.last +++ b/scripts/sync-ggml.last @@ -1 +1 @@ -e565a8f4ce2e462c4973a24c51098dd3c81c0256 +353b63b439f27ab2cc19dac97ab1681ba6d2d084