scripts : add helpers script for bench comparing commits

This commit is contained in:
Georgi Gerganov 2024-02-16 10:19:08 +02:00
parent 594845aab1
commit 57abd79f3c
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

23
scripts/compare-commits.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
set -e
set -x
if [ $# -lt 2 ]; then
echo "usage: ./scripts/compare-commits.sh <commit1> <commit2> [additional llama-bench arguments]"
exit 1
fi
bench_args="${@:3}"
rm -f llama-bench.sqlite
git checkout $1
make clean && LLAMA_CUBLAS=1 make -j32 llama-bench
./llama-bench -o sql $bench_args | tee /dev/tty | sqlite3 llama-bench.sqlite
git checkout $2
make clean && LLAMA_CUBLAS=1 make -j32 llama-bench
./llama-bench -o sql $bench_args | tee /dev/tty | sqlite3 llama-bench.sqlite
./scripts/compare-llama-bench.py -b $1 -c $2