ollama/enable-lto.patch

29 lines
1.4 KiB
Diff
Raw Normal View History

diff --git a/llm/generate/gen_linux.sh b/llm/generate/gen_linux.sh
index 28ce1f2..4193a43 100755
--- a/llm/generate/gen_linux.sh
+++ b/llm/generate/gen_linux.sh
@@ -52,6 +52,7 @@ if [ -z "${CUDACXX}" ]; then
fi
fi
COMMON_CMAKE_DEFS="-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off -DLLAMA_OPENMP=off"
+COMMON_CMAKE_DEFS="${COMMON_CMAKE_DEFS} -DLLAMA_LTO=on -DCMAKE_BUILD_TYPE=Release"
source $(dirname $0)/gen_common.sh
init_vars
git_module_setup
@@ -78,6 +79,7 @@ if [ -z "${OLLAMA_SKIP_CPU_GENERATE}" ]; then
Accepting request 1169791 from home:rrahl0:branches:science:machinelearning - Update to version 0.1.32: * scale graph based on gpu count * Support unicode characters in model path (#3681) * darwin: no partial offloading if required memory greater than system * update llama.cpp submodule to `7593639` (#3665) * fix padding in decode * Revert "cmd: provide feedback if OLLAMA_MODELS is set on non-serve command (#3470)" (#3662) * Added Solar example at README.md (#3610) * Update langchainjs.md (#2030) * Added MindsDB information (#3595) * examples: add more Go examples using the API (#3599) * Update modelfile.md * Add llama2 / torch models for `ollama create` (#3607) * Terminate subprocess if receiving `SIGINT` or `SIGTERM` signals while model is loading (#3653) * app: gracefully shut down `ollama serve` on windows (#3641) * types/model: add path helpers (#3619) * update llama.cpp submodule to `4bd0f93` (#3627) * types/model: make ParseName variants less confusing (#3617) * types/model: remove (*Digest).Scan and Digest.Value (#3605) * Fix rocm deps with new subprocess paths * mixtral mem * Revert "types/model: remove (*Digest).Scan and Digest.Value (#3589)" * types/model: remove (*Digest).Scan and Digest.Value (#3589) * types/model: remove DisplayLong (#3587) * types/model: remove MarshalText/UnmarshalText from Digest (#3586) * types/model: init with Name and Digest types (#3541) * server: provide helpful workaround hint when stalling on pull (#3584) * partial offloading * refactor tensor query * api: start adding documentation to package api (#2878) OBS-URL: https://build.opensuse.org/request/show/1169791 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/ollama?expand=0&rev=9
2024-04-23 14:00:24 +02:00
init_vars
echo "OLLAMA_CUSTOM_CPU_DEFS=\"${OLLAMA_CUSTOM_CPU_DEFS}\""
CMAKE_DEFS="${OLLAMA_CUSTOM_CPU_DEFS} -DCMAKE_POSITION_INDEPENDENT_CODE=on ${CMAKE_DEFS}"
+ CMAKE_DEFS="${CMAKE_DEFS} -DLLAMA_LTO=on"
Accepting request 1169791 from home:rrahl0:branches:science:machinelearning - Update to version 0.1.32: * scale graph based on gpu count * Support unicode characters in model path (#3681) * darwin: no partial offloading if required memory greater than system * update llama.cpp submodule to `7593639` (#3665) * fix padding in decode * Revert "cmd: provide feedback if OLLAMA_MODELS is set on non-serve command (#3470)" (#3662) * Added Solar example at README.md (#3610) * Update langchainjs.md (#2030) * Added MindsDB information (#3595) * examples: add more Go examples using the API (#3599) * Update modelfile.md * Add llama2 / torch models for `ollama create` (#3607) * Terminate subprocess if receiving `SIGINT` or `SIGTERM` signals while model is loading (#3653) * app: gracefully shut down `ollama serve` on windows (#3641) * types/model: add path helpers (#3619) * update llama.cpp submodule to `4bd0f93` (#3627) * types/model: make ParseName variants less confusing (#3617) * types/model: remove (*Digest).Scan and Digest.Value (#3605) * Fix rocm deps with new subprocess paths * mixtral mem * Revert "types/model: remove (*Digest).Scan and Digest.Value (#3589)" * types/model: remove (*Digest).Scan and Digest.Value (#3589) * types/model: remove DisplayLong (#3587) * types/model: remove MarshalText/UnmarshalText from Digest (#3586) * types/model: init with Name and Digest types (#3541) * server: provide helpful workaround hint when stalling on pull (#3584) * partial offloading * refactor tensor query * api: start adding documentation to package api (#2878) OBS-URL: https://build.opensuse.org/request/show/1169791 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/ollama?expand=0&rev=9
2024-04-23 14:00:24 +02:00
BUILD_DIR="../build/linux/${ARCH}/cpu"
echo "Building custom CPU"
build
@@ -94,6 +96,7 @@ if [ -z "${OLLAMA_SKIP_CPU_GENERATE}" ]; then
# -DLLAMA_AVX512_VNNI -- 2021 Intel Alder Lake
COMMON_CPU_DEFS="-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off -DLLAMA_OPENMP=off"
+ COMMON_CPU_DEFS="-DLLAMA_LTO=on -DCMAKE_BUILD_TYPE=Release"
if [ -z "${OLLAMA_CPU_TARGET}" -o "${OLLAMA_CPU_TARGET}" = "cpu" ]; then
#
# CPU first for the default library, set up as lowest common denominator for maximum compatibility (including Rosetta)