improve logic to check if a benchmakr as already been run

This commit is contained in:
Donato Capitella
2025-11-17 11:01:19 +00:00
parent de49d65b3c
commit 1bb4c1f0cc
+21
View File
@@ -132,6 +132,22 @@ ensure_models_exist() {
done done
} }
has_pending_runs() {
local env="$1"
local suffix="$2"
for model_path in "${RESOLVED_MODELS[@]}"; do
local model_name
model_name="$(basename "${model_path}" .gguf)"
local log_file="$RESULTDIR/${model_name}__${env}${suffix}__rpc.log"
if [[ ! -s "$log_file" ]]; then
return 0 # still work to do
fi
done
return 1 # all logs already exist
}
start_remote_rpc() { start_remote_rpc() {
local env="$1" local env="$1"
local image="$2" local image="$2"
@@ -271,6 +287,11 @@ run_all() {
echo echo
echo "==== ${env}${suffix} -> ${image} ====" echo "==== ${env}${suffix} -> ${image} ===="
if ! has_pending_runs "$env" "$suffix"; then
echo "[SKIP] ${env}${suffix} already has logs for all models - moving on."
continue
fi
CURRENT_REMOTE_ENV="${env}${suffix}" CURRENT_REMOTE_ENV="${env}${suffix}"
local remote_pid local remote_pid
remote_pid="$(start_remote_rpc "$env" "$image" "$mode" "$suffix" | tr -d '\r')" remote_pid="$(start_remote_rpc "$env" "$image" "$mode" "$suffix" | tr -d '\r')"