compare-commits.sh 882 B

123456789101112131415161718192021222324252627282930
  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. # verify at the start that the compare script has all the necessary dependencies installed
  9. ./scripts/compare-llama-bench.py --check
  10. bench_args="${@:3}"
  11. rm -f llama-bench.sqlite > /dev/null
  12. # to test a backend, call the script with the corresponding environment variable (e.g. GGML_CUDA=1 ./scripts/compare-commits.sh ...)
  13. git checkout $1 > /dev/null
  14. make clean > /dev/null
  15. make -j$(nproc) $make_opts llama-bench > /dev/null
  16. ./llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
  17. git checkout $2 > /dev/null
  18. make clean > /dev/null
  19. make -j$(nproc) $make_opts llama-bench > /dev/null
  20. ./llama-bench -o sql -oe md $bench_args | sqlite3 llama-bench.sqlite
  21. ./scripts/compare-llama-bench.py -b $1 -c $2