evaluation_all / code /smoke_e2e.sh
yqi19's picture
Upload folder using huggingface_hub
8aa2acf verified
Raw
History Blame Contribute Delete
2.34 kB
#!/usr/bin/env bash
set -uo pipefail
# End-to-end smoke: GR00T server + ManiSkill client, tiny color_object run.
ROOT=/workspace/groot_eval
CAT="${1:-color_object}"
GPU="${2:-0}"
PORT="${3:-5599}"
TOTAL_EP="${4:-2}" # -> 4 runs x 1 episode
MAXSTEPS="${5:-40}"
OUT="${ROOT}/results_smoke/${CAT}"
mkdir -p "${OUT}/experiments" "${ROOT}/logs"
SLOG="${ROOT}/logs/smoke_server_${CAT}.log"
CLOG="${ROOT}/logs/smoke_client_${CAT}.log"
echo "[smoke] start GR00T server cat=${CAT} gpu=${GPU} port=${PORT}"
( cd "${ROOT}/gr00t_repo/codebase" && CUDA_VISIBLE_DEVICES="${GPU}" \
HF_HOME="${ROOT}/.hf_cache" HF_TOKEN="$(cat ${ROOT}/.hf_token)" \
NO_ALBUMENTATIONS_UPDATE=1 TOKENIZERS_PARALLELISM=false \
"${ROOT}/.venv_groot/bin/python" -m gr00t.eval.run_gr00t_server \
--model-path "${ROOT}/checkpoints/${CAT}" \
--embodiment-tag new_embodiment --device cuda:0 \
--host 127.0.0.1 --port "${PORT}" ) > "${SLOG}" 2>&1 &
SPID=$!
ready=0
for _ in $(seq 1 150); do
kill -0 "${SPID}" 2>/dev/null || { echo "[smoke] SERVER DIED"; tail -n 30 "${SLOG}"; exit 1; }
grep -q "Server ready\|Server is ready and listening" "${SLOG}" 2>/dev/null && { ready=1; break; }
sleep 3
done
[ "${ready}" -eq 1 ] || { echo "[smoke] server not ready"; tail -n 30 "${SLOG}"; kill "${SPID}"; exit 1; }
echo "[smoke] server ready; running client sweep"
TORCH_LIB=$("${ROOT}/.venv_ms/bin/python" -c "import torch,os;print(os.path.join(os.path.dirname(torch.__file__),'lib'))")
CUDA_VISIBLE_DEVICES="${GPU}" LD_LIBRARY_PATH="${TORCH_LIB}:${LD_LIBRARY_PATH:-}" \
HOST=127.0.0.1 PORT="${PORT}" SIM_BACKEND=gpu MAX_EPISODE_STEPS="${MAXSTEPS}" \
EXPERIMENT_ROOT="${OUT}/experiments" GROOT_MAIN="${ROOT}/harness/groot_main.py" \
MS_PY="${ROOT}/.venv_ms/bin/python" MANISKILL_CONFLICT_ROOT="${ROOT}/genie_repo/maniskill_conflict" \
bash "${ROOT}/harness/run_ood_groot_inference.sh" "${CAT}" 42 "${TOTAL_EP}" "${OUT}/${CAT}_smoke.txt" \
> "${CLOG}" 2>&1
RC=$?
kill "${SPID}" 2>/dev/null || true; wait "${SPID}" 2>/dev/null || true
echo "[smoke] client rc=${RC}"
echo "------ results txt ------"; cat "${OUT}/${CAT}_smoke.txt" 2>/dev/null
echo "------ videos ------"; find "${OUT}/experiments" -name '*.mp4' | head; echo "count: $(find "${OUT}/experiments" -name '*.mp4' | wc -l)"
echo "------ client log tail ------"; tail -n 25 "${CLOG}"
exit ${RC}