feat: force recompute AUC batch evaluations

This commit is contained in:
2026-08-03 14:02:09 +08:00
parent e040707d07
commit f1ca401783

View File

@@ -12,12 +12,14 @@
# - evaluate_auc_v2.py # - evaluate_auc_v2.py
# -> df_auc_landmark_delphi2m_report.csv # -> df_auc_landmark_delphi2m_report.csv
# #
# Existing non-empty reports are skipped. Each evaluation task uses one GPU. # Existing non-empty reports are skipped unless --force is supplied. Each
# evaluation task uses one GPU.
# Tasks on the same GPU run sequentially; different GPUs run in parallel. # Tasks on the same GPU run sequentially; different GPUs run in parallel.
# #
# Examples: # Examples:
# bash evaluate_all_runs_linux.sh --gpus 0 # bash evaluate_all_runs_linux.sh --gpus 0
# bash evaluate_all_runs_linux.sh --gpus 0,1,2,3 # bash evaluate_all_runs_linux.sh --gpus 0,1,2,3
# bash evaluate_all_runs_linux.sh --gpus 0,1 --force
# bash evaluate_all_runs_linux.sh --gpus 0,1 --dry-run # bash evaluate_all_runs_linux.sh --gpus 0,1 --dry-run
# #
@@ -32,6 +34,7 @@ GPU_CSV="0"
PYTHON_BIN="${PYTHON_BIN:-python}" PYTHON_BIN="${PYTHON_BIN:-python}"
NUM_WORKERS=4 NUM_WORKERS=4
NUM_WORKERS_AUC=4 NUM_WORKERS_AUC=4
FORCE=0
DRY_RUN=0 DRY_RUN=0
TOKEN_REPORT="df_auc_delphi2m_report.csv" TOKEN_REPORT="df_auc_delphi2m_report.csv"
@@ -49,14 +52,16 @@ Options:
--python PATH Python executable (default: $PYTHON_BIN or python). --python PATH Python executable (default: $PYTHON_BIN or python).
--num-workers N DataLoader workers per evaluation (default: 4). --num-workers N DataLoader workers per evaluation (default: 4).
--num-workers-auc N CPU AUC workers per evaluation (default: 4). --num-workers-auc N CPU AUC workers per evaluation (default: 4).
--dry-run Discover runs and print missing evaluations only. --force Recompute both AUC reports even when they exist.
--dry-run Discover runs and print scheduled evaluations only.
-h, --help Show this help message. -h, --help Show this help message.
Completion files: Completion files:
evaluate_auc.py df_auc_delphi2m_report.csv evaluate_auc.py df_auc_delphi2m_report.csv
evaluate_auc_v2.py df_auc_landmark_delphi2m_report.csv evaluate_auc_v2.py df_auc_landmark_delphi2m_report.csv
Existing non-empty completion files are skipped independently. Existing non-empty completion files are skipped independently unless --force
is supplied.
EOF EOF
} }
@@ -110,6 +115,10 @@ while (($# > 0)); do
NUM_WORKERS_AUC="$2" NUM_WORKERS_AUC="$2"
shift 2 shift 2
;; ;;
--force)
FORCE=1
shift
;;
--dry-run) --dry-run)
DRY_RUN=1 DRY_RUN=1
shift shift
@@ -207,13 +216,13 @@ while IFS= read -r -d '' config_path; do
continue continue
fi fi
if [[ -s "$run_dir/$TOKEN_REPORT" ]]; then if ((!FORCE)) && [[ -s "$run_dir/$TOKEN_REPORT" ]]; then
((skipped_token_count += 1)) ((skipped_token_count += 1))
else else
add_job "$run_dir" "evaluate_auc.py" "$TOKEN_REPORT" add_job "$run_dir" "evaluate_auc.py" "$TOKEN_REPORT"
fi fi
if [[ -s "$run_dir/$LANDMARK_REPORT" ]]; then if ((!FORCE)) && [[ -s "$run_dir/$LANDMARK_REPORT" ]]; then
((skipped_landmark_count += 1)) ((skipped_landmark_count += 1))
else else
add_job "$run_dir" "evaluate_auc_v2.py" "$LANDMARK_REPORT" add_job "$run_dir" "evaluate_auc_v2.py" "$LANDMARK_REPORT"
@@ -289,18 +298,24 @@ worker() {
return "$failed" return "$failed"
} }
force_label="no"
if ((FORCE)); then
force_label="yes"
fi
echo "Runs root: $RUNS_ROOT" echo "Runs root: $RUNS_ROOT"
echo "GPUs: ${GPU_IDS[*]}" echo "GPUs: ${GPU_IDS[*]}"
echo "Force recompute: $force_label"
echo "Runs discovered: $run_count" echo "Runs discovered: $run_count"
echo "Incomplete runs skipped: $incomplete_run_count" echo "Incomplete runs skipped: $incomplete_run_count"
echo "Existing token reports skipped: $skipped_token_count" echo "Existing token reports skipped: $skipped_token_count"
echo "Existing landmark reports skipped: $skipped_landmark_count" echo "Existing landmark reports skipped: $skipped_landmark_count"
echo "Missing evaluation tasks: ${#JOB_RUN_DIRS[@]}" echo "Scheduled evaluation tasks: ${#JOB_RUN_DIRS[@]}"
echo "Log root: $LOG_ROOT" echo "Log root: $LOG_ROOT"
echo echo
if ((${#JOB_RUN_DIRS[@]} == 0)); then if ((${#JOB_RUN_DIRS[@]} == 0)); then
echo "All discovered runs already have both AUC reports." echo "No AUC evaluation tasks are scheduled."
exit 0 exit 0
fi fi
@@ -323,5 +338,5 @@ fi
if ((DRY_RUN)); then if ((DRY_RUN)); then
echo "Dry run completed successfully." echo "Dry run completed successfully."
else else
echo "All missing AUC evaluations completed successfully." echo "All scheduled AUC evaluations completed successfully."
fi fi