From e056de63a163c71f2fb0d185e867d69a1db3d5c8 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 26 May 2025 16:48:20 +0300 Subject: [PATCH 1/2] scripts : add option to compare commits in Debug --- scripts/compare-commits.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/compare-commits.sh b/scripts/compare-commits.sh index e40d1cc6d988f..0804c64a4c4c6 100755 --- a/scripts/compare-commits.sh +++ b/scripts/compare-commits.sh @@ -15,16 +15,22 @@ bench_args="${@:3}" rm -f llama-bench.sqlite > /dev/null +unset cmake_opts + # to test a backend, call the script with the corresponding environment variable (e.g. GGML_CUDA=1 ./scripts/compare-commits.sh ...) if [ -n "$GGML_CUDA" ]; then - cmake_opts="-DGGML_CUDA=ON" + cmake_opts="${cmake_opts} -DGGML_CUDA=ON" +fi + +if [ -n "$CMAKE_BUILD_TYPE" ]; then + cmake_opts="${cmake_opts} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" fi dir="build-bench" function run { rm -fr ${dir} > /dev/null - cmake -B ${dir} -S . $cmake_opts > /dev/null + cmake -B ${dir} -S . ${cmake_opts} > /dev/null cmake --build ${dir} -t llama-bench > /dev/null ${dir}/bin/llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite } From ed2e6d46ba17956efbf8afce284a03b53f0ef7ce Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 26 May 2025 22:18:42 +0300 Subject: [PATCH 2/2] cont : reuse existing CMAKE_OPTS --- scripts/compare-commits.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/compare-commits.sh b/scripts/compare-commits.sh index 0804c64a4c4c6..94a8eceb302b9 100755 --- a/scripts/compare-commits.sh +++ b/scripts/compare-commits.sh @@ -15,22 +15,16 @@ bench_args="${@:3}" rm -f llama-bench.sqlite > /dev/null -unset cmake_opts - # to test a backend, call the script with the corresponding environment variable (e.g. GGML_CUDA=1 ./scripts/compare-commits.sh ...) if [ -n "$GGML_CUDA" ]; then - cmake_opts="${cmake_opts} -DGGML_CUDA=ON" -fi - -if [ -n "$CMAKE_BUILD_TYPE" ]; then - cmake_opts="${cmake_opts} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" + CMAKE_OPTS="${CMAKE_OPTS} -DGGML_CUDA=ON" fi dir="build-bench" function run { rm -fr ${dir} > /dev/null - cmake -B ${dir} -S . ${cmake_opts} > /dev/null + cmake -B ${dir} -S . ${CMAKE_OPTS} > /dev/null cmake --build ${dir} -t llama-bench > /dev/null ${dir}/bin/llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite }