LLM inference in C/C++
C++ ggml
sync : ggml (#29396)
Georgi Gerganovbced4595b87f
diff --git a/ggml/CMakeLists.txt b/ggml/CMakeLists.txtindex 1df78fddfd..752dabbb63 100644--- a/ggml/CMakeLists.txt+++ b/ggml/CMakeLists.txt@@ -5,7 +5,7 @@ project("ggml" C CXX ASM)### GGML Versionset(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.cindex 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 *)); // nodesincr_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.lastindex 8f4afc721b..35cd376dbb 100644--- a/scripts/sync-ggml.last+++ b/scripts/sync-ggml.last@@ -1 +1 @@-e565a8f4ce2e462c4973a24c51098dd3c81c0256+353b63b439f27ab2cc19dac97ab1681ba6d2d084