From e858f410da03081b2263ccd8b019222981adb5b4 Mon Sep 17 00:00:00 2001 From: Abitofevrything Date: Sun, 8 Jan 2023 11:10:25 +0100 Subject: [PATCH] Add process time to bench-all script --- extra/bench-all.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/extra/bench-all.sh b/extra/bench-all.sh index fbdc4c2..c68910f 100755 --- a/extra/bench-all.sh +++ b/extra/bench-all.sh @@ -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 "| | | $config | $model | $n_threads | $load_time | $encode_time | $commit |\n" + printf "| | | $config | $model | $n_threads | $total_load_time | $real_load_time | $total_encode_time | $real_encode_time | $commit |\n" done