File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,21 @@ bench_args="${@:3}"
1616rm -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
2030git 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
2533git 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
You can’t perform that action at this time.
0 commit comments