[packages/llama.cpp] - adjusted sizes for 32-bit builds so they don't overflow (although probably no sensible model would
qboosh
qboosh at pld-linux.org
Mon Nov 23 06:40:23 CET 2026
commit b7e2c1c4e32b528daa07234d40027ece70c281e0
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Mon Nov 23 06:40:18 2026 +0100
- adjusted sizes for 32-bit builds so they don't overflow (although probably no sensible model would fit); release 3
llama.cpp-32bit.patch | 28 ++++++++++++++++++++++++++++
llama.cpp.spec | 4 +++-
2 files changed, 31 insertions(+), 1 deletion(-)
---
diff --git a/llama.cpp.spec b/llama.cpp.spec
index 284a687..8ea3782 100644
--- a/llama.cpp.spec
+++ b/llama.cpp.spec
@@ -6,13 +6,14 @@ Summary: LLM inference in C/C++
Summary(pl.UTF-8): Wnioskowanie z użyciem LLM w C/C++
Name: llama.cpp
Version: 1.0.0
-Release: 2
+Release: 3
License: MIT
Group: Libraries
#Source0Download: https://github.com/ggml-org/llama.cpp/releases
Source0: https://github.com/ggml-org/llama.cpp/archive/v%{version}/%{name}-%{version}.tar.gz
# Source0-md5: 688562e96cae0d422272b97afd9ced5f
Patch0: %{name}-x32.patch
+Patch1: %{name}-32bit.patch
URL: https://github.com/ggml-org/llama.cpp
BuildRequires: cmake >= 3.14
BuildRequires: ggml-devel >= 1.0.0
@@ -59,6 +60,7 @@ Pliki nagłówkowe bibliotek LLaMA.
%prep
%setup -q
%patch -P0 -p1
+%patch -P1 -p1
%build
%cmake -B build \
diff --git a/llama.cpp-32bit.patch b/llama.cpp-32bit.patch
new file mode 100644
index 0000000..2ae8d96
--- /dev/null
+++ b/llama.cpp-32bit.patch
@@ -0,0 +1,28 @@
+--- llama.cpp-1.0.0/src/llama-model-loader.cpp.orig 2026-11-13 10:09:55.000000000 +0100
++++ llama.cpp-1.0.0/src/llama-model-loader.cpp 2026-11-23 06:28:46.410990040 +0100
+@@ -1186,7 +1186,11 @@ bool llama_model_loader::lazy_read::add(
+ }
+
+ // do not lazy-read small tensors, it has significant overhead and is not worth it
++#ifdef __LP64__
+ constexpr size_t auto_min_size = 4ull * 1024 * 1024 * 1024;
++#else
++ constexpr size_t auto_min_size = 1ull * 1024 * 1024 * 1024;
++#endif
+ if (mode != LLAMA_LAZY_MODE_ON && ggml_nbytes(t) <= auto_min_size) {
+ return false;
+ }
+--- llama.cpp-1.0.0/src/llama-quant.cpp.orig 2026-11-13 10:09:55.000000000 +0100
++++ llama.cpp-1.0.0/src/llama-quant.cpp 2026-11-23 06:30:47.088564023 +0100
+@@ -41,7 +41,11 @@ enum class tensor_category {
+ };
+
+ // max amount of tensor data kept in memory while quantizing a single tensor
++#ifdef __LP64__
+ static const size_t LLAMA_QUANT_MAX_BUF_SIZE = 8ull*1024*1024*1024;
++#else
++static const size_t LLAMA_QUANT_MAX_BUF_SIZE = 1ull*1024*1024*1024;
++#endif
+
+ static void zeros(std::ofstream & file, size_t n) {
+ char zero = 0;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/llama.cpp.git/commitdiff/b7e2c1c4e32b528daa07234d40027ece70c281e0
More information about the pld-cvs-commit
mailing list