54 lines
1.8 KiB
Bash
54 lines
1.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
set -uo pipefail
|
|
|
|
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "${repo_root}"
|
|
|
|
gpu_devices="${CUDA_VISIBLE_DEVICES:-1}"
|
|
python_bin="${PYTHON_BIN:-}"
|
|
|
|
if [[ -z "${python_bin}" ]]; then
|
|
if [[ -n "${CONDA_PREFIX:-}" ]] && [[ -x "${CONDA_PREFIX}/bin/python" ]]; then
|
|
python_bin="${CONDA_PREFIX}/bin/python"
|
|
elif [[ -n "${VIRTUAL_ENV:-}" ]] && [[ -x "${VIRTUAL_ENV}/bin/python" ]]; then
|
|
python_bin="${VIRTUAL_ENV}/bin/python"
|
|
else
|
|
python_bin="$(command -v python || true)"
|
|
fi
|
|
fi
|
|
|
|
if [[ -z "${python_bin}" ]] || [[ ! -x "${python_bin}" ]]; then
|
|
echo "Unable to resolve a usable Python interpreter. Set PYTHON_BIN explicitly." >&2
|
|
exit 1
|
|
fi
|
|
|
|
case_scripts=(
|
|
"unitree_z1_dual_arm_stackbox/case3/run_world_model_backbone_profile.sh"
|
|
"unitree_z1_dual_arm_stackbox_v2/case3/run_world_model_backbone_profile.sh"
|
|
"unitree_z1_dual_arm_cleanup_pencils/case3/run_world_model_backbone_profile.sh"
|
|
"unitree_g1_pack_camera/case3/run_world_model_backbone_profile.sh"
|
|
)
|
|
|
|
failed_cases=()
|
|
|
|
for case_script in "${case_scripts[@]}"; do
|
|
echo "============================================================"
|
|
echo "Running ${case_script} on GPU ${gpu_devices}"
|
|
echo "============================================================"
|
|
echo "Using Python: ${python_bin}"
|
|
if ! CUDA_VISIBLE_DEVICES="${gpu_devices}" PYTHON_BIN="${python_bin}" bash "${repo_root}/${case_script}"; then
|
|
echo "FAILED: ${case_script}" >&2
|
|
failed_cases+=("${case_script}")
|
|
fi
|
|
done
|
|
|
|
if [[ ${#failed_cases[@]} -gt 0 ]]; then
|
|
echo "============================================================" >&2
|
|
echo "Backbone profiling finished with failures:" >&2
|
|
for case_script in "${failed_cases[@]}"; do
|
|
echo " - ${case_script}" >&2
|
|
done
|
|
exit 1
|
|
fi
|