forked from Cerebras/modelzoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_modelzoo.sh
More file actions
executable file
·56 lines (45 loc) · 1.65 KB
/
run_modelzoo.sh
File metadata and controls
executable file
·56 lines (45 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Executes the GNN ModelZoo training/evaluation.
set -euo pipefail
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=./common.sh
source "${PROJECT_ROOT}/common.sh"
SCRIPT_NAME="$(basename "$0")"
PYTHON_SCRIPT_NAME="cszoo"
# Arguments for PYTHON_SCRIPT_NAME
PYTHON_SCRIPT_ARGS=("fit" "configs/params_graphsage_ogbn_arxiv.yaml" "--target_device" "CSX")
main() {
log_info "Starting GNN ModelZoo batch run"
if ! command -v uv &> /dev/null; then
log_error "'uv' command not found. Please install uv: https://github.com/astral-sh/uv"
return 1
fi
local model_run_dir="${PROJECT_ROOT}/${SHARED_MODEL_SUBDIR}"
if [[ ! -d "${model_run_dir}" ]]; then
log_error "Model script directory '${model_run_dir}' not found."
return 1
fi
log_info "Executing model script in: ${model_run_dir}"
( # Subshell for model execution
cd "${model_run_dir}"
local full_command=("${PYTHON_SCRIPT_NAME}" "${PYTHON_SCRIPT_ARGS[@]}")
log_info "Executing: uv run ${full_command[*]}"
uv run -- "${full_command[@]}"
log_info "Model execution finished."
)
local execution_status=$?
if [ "${execution_status}" -ne 0 ]; then
log_error "Model execution process failed (status: ${execution_status})."
return "${execution_status}"
fi
log_info "Model execution process completed successfully."
return 0
}
main "$@"
exit_status=$?
if [ "${exit_status}" -ne 0 ]; then
log_error "${SCRIPT_NAME} finished with errors (status: ${exit_status})."
else
log_info "${SCRIPT_NAME} finished successfully."
fi
exit "${exit_status}"