compare-commits.sh 676 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. if [ $# -lt 2 ]; then
  3. echo "usage: ./scripts/compare-commits.sh <commit1> <commit2> [additional llama-bench arguments]"
  4. exit 1
  5. fi
  6. set -e
  7. set -x
  8. bench_args="${@:3}"
  9. rm -f llama-bench.sqlite
  10. # to test a backend, call the script with the corresponding environment variable (e.g. LLAMA_CUDA=1 ./scripts/compare-commits.sh ...)
  11. git checkout $1
  12. make clean && make -j32 $make_opts llama-bench
  13. ./llama-bench -o sql $bench_args | tee /dev/tty | sqlite3 llama-bench.sqlite
  14. git checkout $2
  15. make clean && make -j32 $make_opts llama-bench
  16. ./llama-bench -o sql $bench_args | tee /dev/tty | sqlite3 llama-bench.sqlite
  17. ./scripts/compare-llama-bench.py -b $1 -c $2