Add process time to bench-all script

pull/387/head
Abitofevrything 3 years ago committed by Georgi Gerganov
parent 3abcfc6fc3
commit e858f410da
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

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

Loading…
Cancel
Save