Skip to content

Commit

Permalink
basic fix for compare-commits.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren committed Dec 2, 2024
1 parent 328ded3 commit 886c153
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts/compare-commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ bench_args="${@:3}"
rm -f llama-bench.sqlite > /dev/null

# 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"
fi

function run {
rm -fr build > /dev/null
cmake -B build -S . $cmake_opts > /dev/null
cmake --build build -t llama-bench > /dev/null
build/bin/llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
}

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

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

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

0 comments on commit 886c153

Please sign in to comment.