2024-04-23 14:00:24 +02:00
|
|
|
diff -rub ollama/llm/generate/gen_linux.sh ollama-patched/llm/generate/gen_linux.sh
|
|
|
|
--- ollama/llm/generate/gen_linux.sh 2024-04-23 04:40:58.246062467 +0200
|
|
|
|
+++ ollama-patched/llm/generate/gen_linux.sh 2024-04-23 04:37:36.432294889 +0200
|
|
|
|
@@ -51,7 +51,7 @@
|
2024-02-26 10:11:49 +01:00
|
|
|
export CUDACXX=$(command -v nvcc)
|
|
|
|
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"
|
|
|
|
+COMMON_CMAKE_DEFS="-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_LTO=on -DCMAKE_BUILD_TYPE=Release -DLLAMA_NATIVE=off -DLLAMA_AVX=on -DLLAMA_AVX2=off -DLLAMA_AVX512=off -DLLAMA_FMA=off -DLLAMA_F16C=off"
|
|
|
|
source $(dirname $0)/gen_common.sh
|
|
|
|
init_vars
|
|
|
|
git_module_setup
|
2024-04-23 14:00:24 +02:00
|
|
|
@@ -77,7 +77,7 @@
|
2024-02-26 10:11:49 +01:00
|
|
|
if [ -n "${OLLAMA_CUSTOM_CPU_DEFS}" ]; then
|
2024-04-23 14:00:24 +02:00
|
|
|
init_vars
|
2024-02-26 10:11:49 +01:00
|
|
|
echo "OLLAMA_CUSTOM_CPU_DEFS=\"${OLLAMA_CUSTOM_CPU_DEFS}\""
|
|
|
|
- CMAKE_DEFS="${OLLAMA_CUSTOM_CPU_DEFS} -DCMAKE_POSITION_INDEPENDENT_CODE=on ${CMAKE_DEFS}"
|
|
|
|
+ CMAKE_DEFS="${OLLAMA_CUSTOM_CPU_DEFS} -DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_LTO=on -DCMAKE_BUILD_TYPE=Release ${CMAKE_DEFS}"
|
2024-04-23 14:00:24 +02:00
|
|
|
BUILD_DIR="../build/linux/${ARCH}/cpu"
|
2024-02-26 10:11:49 +01:00
|
|
|
echo "Building custom CPU"
|
|
|
|
build
|
2024-04-23 14:00:24 +02:00
|
|
|
@@ -93,7 +93,7 @@
|
2024-02-26 10:11:49 +01:00
|
|
|
# -DLLAMA_AVX512_VBMI -- 2018 Intel Cannon Lake
|
|
|
|
# -DLLAMA_AVX512_VNNI -- 2021 Intel Alder Lake
|
2024-04-23 14:00:24 +02:00
|
|
|
|
2024-02-26 10:11:49 +01:00
|
|
|
- COMMON_CPU_DEFS="-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_NATIVE=off"
|
|
|
|
+ COMMON_CPU_DEFS="-DCMAKE_POSITION_INDEPENDENT_CODE=on -DLLAMA_LTO=on -DCMAKE_BUILD_TYPE=Release -DLLAMA_NATIVE=off"
|
|
|
|
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)
|