|
|
|
@ -17,8 +17,8 @@ printf "Running benchmark for all models\n"
|
|
|
|
|
printf "This can take a while!\n"
|
|
|
|
|
printf "\n"
|
|
|
|
|
|
|
|
|
|
printf "| CPU | OS | Config | Model | Th | Load | Enc. | Commit |\n"
|
|
|
|
|
printf "| --- | -- | ------ | ----- | -- | ---- | ---- | ------ |\n"
|
|
|
|
|
printf "| CPU | OS | Config | Model | Threads | Total Load | Real Load | Total Encode | Real Encode | Commit |\n"
|
|
|
|
|
printf "| --- | -- | ------ | ----- | ------- | ---------- | --------- | ------------ | ----------- | ------ |\n"
|
|
|
|
|
|
|
|
|
|
for model in "${models[@]}"; do
|
|
|
|
|
# run once to heat-up the cache
|
|
|
|
@ -29,14 +29,18 @@ for model in "${models[@]}"; do
|
|
|
|
|
output=$(./bench -m ./models/ggml-$model.bin -t $n_threads 2>&1)
|
|
|
|
|
|
|
|
|
|
# parse the output:
|
|
|
|
|
load_time=$(echo "$output" | grep "load time" | awk '{print $5}')
|
|
|
|
|
encode_time=$(echo "$output" | grep "encode time" | awk '{print $5}')
|
|
|
|
|
total_load_time=$(echo "$output" | grep "load time" | awk '{print $5}')
|
|
|
|
|
real_load_time=$(echo "$output" | grep "load time" | awk '{print $8}')
|
|
|
|
|
total_encode_time=$(echo "$output" | grep "encode time" | awk '{print $5}')
|
|
|
|
|
real_encode_time=$(echo "$output" | grep "encode time" | awk '{print $8}')
|
|
|
|
|
system_info=$(echo "$output" | grep "system_info")
|
|
|
|
|
n_threads=$(echo "$output" | grep "system_info" | awk '{print $4}')
|
|
|
|
|
|
|
|
|
|
# floor to milliseconds
|
|
|
|
|
load_time=${load_time%.*}
|
|
|
|
|
encode_time=${encode_time%.*}
|
|
|
|
|
total_load_time=${total_load_time%.*}
|
|
|
|
|
real_load_time=${real_load_time%.*}
|
|
|
|
|
total_encode_time=${total_encode_time%.*}
|
|
|
|
|
real_encode_time=${real_encode_time%.*}
|
|
|
|
|
|
|
|
|
|
config=""
|
|
|
|
|
|
|
|
|
@ -54,6 +58,6 @@ for model in "${models[@]}"; do
|
|
|
|
|
|
|
|
|
|
commit=$(git rev-parse --short HEAD)
|
|
|
|
|
|
|
|
|
|
printf "| <todo> | <todo> | $config | $model | $n_threads | $load_time | $encode_time | $commit |\n"
|
|
|
|
|
printf "| <todo> | <todo> | $config | $model | $n_threads | $total_load_time | $real_load_time | $total_encode_time | $real_encode_time | $commit |\n"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|