Spaces:
Running
Running
scripts : update to new build system
Browse files- Makefile +5 -0
- scripts/bench-all.sh +4 -4
- tests/run-tests.sh +1 -1
Makefile
CHANGED
|
@@ -2,6 +2,11 @@
|
|
| 2 |
# Audio samples
|
| 3 |
#
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# download a few audio samples into folder "./samples":
|
| 6 |
.PHONY: samples
|
| 7 |
samples:
|
|
|
|
| 2 |
# Audio samples
|
| 3 |
#
|
| 4 |
|
| 5 |
+
.PHONY: build
|
| 6 |
+
build:
|
| 7 |
+
cmake -B build
|
| 8 |
+
cmake --build build --config Release
|
| 9 |
+
|
| 10 |
# download a few audio samples into folder "./samples":
|
| 11 |
.PHONY: samples
|
| 12 |
samples:
|
scripts/bench-all.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
# Helper script to run the bench tool on all models and print the results in share-able format
|
| 4 |
|
| 5 |
-
printf "Usage: ./bench.sh [n_threads] [encoder-only] [flash-attn]\n"
|
| 6 |
|
| 7 |
if [ -z "$1" ]; then
|
| 8 |
n_threads=4
|
|
@@ -38,13 +38,13 @@ if [ "$encoder_only" -eq 0 ]; then
|
|
| 38 |
printf "Running memcpy benchmark\n"
|
| 39 |
printf "\n"
|
| 40 |
|
| 41 |
-
./bench -w 1 -t $n_threads 2>&1
|
| 42 |
|
| 43 |
printf "\n"
|
| 44 |
printf "Running ggml_mul_mat benchmark with $n_threads threads\n"
|
| 45 |
printf "\n"
|
| 46 |
|
| 47 |
-
./bench -w 2 -t $n_threads 2>&1
|
| 48 |
|
| 49 |
printf "\n"
|
| 50 |
printf "Running benchmark for all models\n"
|
|
@@ -64,7 +64,7 @@ printf "| %6s | %6s | %16s | %13s | %3s | %3s | %7s | %7s | %7s | %7s | %7s |\n"
|
|
| 64 |
for model in "${models[@]}"; do
|
| 65 |
# actual run
|
| 66 |
# store stderr output in a variable in order to parse it later
|
| 67 |
-
output=$(./bench -m ./models/ggml-$model.bin -t $n_threads $fattn 2>&1)
|
| 68 |
ret=$?
|
| 69 |
|
| 70 |
# parse the output:
|
|
|
|
| 2 |
|
| 3 |
# Helper script to run the bench tool on all models and print the results in share-able format
|
| 4 |
|
| 5 |
+
printf "Usage: ./scripts/bench-all.sh [n_threads] [encoder-only] [flash-attn]\n"
|
| 6 |
|
| 7 |
if [ -z "$1" ]; then
|
| 8 |
n_threads=4
|
|
|
|
| 38 |
printf "Running memcpy benchmark\n"
|
| 39 |
printf "\n"
|
| 40 |
|
| 41 |
+
./build/bin/bench -w 1 -t $n_threads 2>&1
|
| 42 |
|
| 43 |
printf "\n"
|
| 44 |
printf "Running ggml_mul_mat benchmark with $n_threads threads\n"
|
| 45 |
printf "\n"
|
| 46 |
|
| 47 |
+
./build/bin/bench -w 2 -t $n_threads 2>&1
|
| 48 |
|
| 49 |
printf "\n"
|
| 50 |
printf "Running benchmark for all models\n"
|
|
|
|
| 64 |
for model in "${models[@]}"; do
|
| 65 |
# actual run
|
| 66 |
# store stderr output in a variable in order to parse it later
|
| 67 |
+
output=$(./build/bin/bench -m ./models/ggml-$model.bin -t $n_threads $fattn 2>&1)
|
| 68 |
ret=$?
|
| 69 |
|
| 70 |
# parse the output:
|
tests/run-tests.sh
CHANGED
|
@@ -39,7 +39,7 @@ if [ $# -eq 0 ]; then
|
|
| 39 |
fi
|
| 40 |
|
| 41 |
model=$1
|
| 42 |
-
main="../main"
|
| 43 |
|
| 44 |
threads=""
|
| 45 |
if [ $# -eq 2 ]; then
|
|
|
|
| 39 |
fi
|
| 40 |
|
| 41 |
model=$1
|
| 42 |
+
main="../build/bin/main"
|
| 43 |
|
| 44 |
threads=""
|
| 45 |
if [ $# -eq 2 ]; then
|