From ed733e85a1b399e215ab84cff91abe25f5f79d76 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Mon, 9 Dec 2024 11:30:16 +0200 Subject: [PATCH] scripts : update to new build system --- Makefile | 5 +++++ scripts/bench-all.sh | 8 ++++---- tests/run-tests.sh | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 2743eecd..81fd3920 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,11 @@ # Audio samples # +.PHONY: build +build: + cmake -B build + cmake --build build --config Release + # download a few audio samples into folder "./samples": .PHONY: samples samples: diff --git a/scripts/bench-all.sh b/scripts/bench-all.sh index 469ec04d..c7dc52b1 100755 --- a/scripts/bench-all.sh +++ b/scripts/bench-all.sh @@ -2,7 +2,7 @@ # Helper script to run the bench tool on all models and print the results in share-able format -printf "Usage: ./bench.sh [n_threads] [encoder-only] [flash-attn]\n" +printf "Usage: ./scripts/bench-all.sh [n_threads] [encoder-only] [flash-attn]\n" if [ -z "$1" ]; then n_threads=4 @@ -38,13 +38,13 @@ if [ "$encoder_only" -eq 0 ]; then printf "Running memcpy benchmark\n" printf "\n" - ./bench -w 1 -t $n_threads 2>&1 + ./build/bin/bench -w 1 -t $n_threads 2>&1 printf "\n" printf "Running ggml_mul_mat benchmark with $n_threads threads\n" printf "\n" - ./bench -w 2 -t $n_threads 2>&1 + ./build/bin/bench -w 2 -t $n_threads 2>&1 printf "\n" printf "Running benchmark for all models\n" @@ -64,7 +64,7 @@ printf "| %6s | %6s | %16s | %13s | %3s | %3s | %7s | %7s | %7s | %7s | %7s |\n" for model in "${models[@]}"; do # actual run # store stderr output in a variable in order to parse it later - output=$(./bench -m ./models/ggml-$model.bin -t $n_threads $fattn 2>&1) + output=$(./build/bin/bench -m ./models/ggml-$model.bin -t $n_threads $fattn 2>&1) ret=$? # parse the output: diff --git a/tests/run-tests.sh b/tests/run-tests.sh index ae76b4b7..bb8aa5e2 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -39,7 +39,7 @@ if [ $# -eq 0 ]; then fi model=$1 -main="../main" +main="../build/bin/main" threads="" if [ $# -eq 2 ]; then