Skip to content

Commit 886c153

Browse files
committed
basic fix for compare-commits.sh
1 parent 328ded3 commit 886c153

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

scripts/compare-commits.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ bench_args="${@:3}"
1616
rm -f llama-bench.sqlite > /dev/null
1717

1818
# to test a backend, call the script with the corresponding environment variable (e.g. GGML_CUDA=1 ./scripts/compare-commits.sh ...)
19+
if [ -n "$GGML_CUDA" ]; then
20+
cmake_opts="-DGGML_CUDA=ON"
21+
fi
22+
23+
function run {
24+
rm -fr build > /dev/null
25+
cmake -B build -S . $cmake_opts > /dev/null
26+
cmake --build build -t llama-bench > /dev/null
27+
build/bin/llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
28+
}
1929

2030
git checkout $1 > /dev/null
21-
make clean > /dev/null
22-
make -j$(nproc) $make_opts llama-bench > /dev/null
23-
./llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
31+
run
2432

2533
git checkout $2 > /dev/null
26-
make clean > /dev/null
27-
make -j$(nproc) $make_opts llama-bench > /dev/null
28-
./llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
34+
run
2935

3036
./scripts/compare-llama-bench.py -b $1 -c $2

0 commit comments

Comments
 (0)