KAWK50M-Project / runpod /train_5090.sh
Infinity08's picture
Add files using upload-large-folder tool
91ac3cc verified
Raw History Blame Contribute Delete
934 Bytes
#!/usr/bin/env bash
set -euo pipefail
PROJECT_DIR="${PROJECT_DIR:-/workspace/KAWK50M}"
VENV_DIR="${VENV_DIR:-${PROJECT_DIR}/.venv}"
CONFIG="${CONFIG:-configs/pretrain_5b_5090.yaml}"
RESUME="${RESUME:-}"
STOP_AFTER_STEPS="${STOP_AFTER_STEPS:-}"
cd "${PROJECT_DIR}"
if [[ ! -x "${VENV_DIR}/bin/python" ]]; then
echo "Virtual environment not found: ${VENV_DIR}" >&2
echo "Run: bash runpod/bootstrap.sh" >&2
exit 1
fi
source "${VENV_DIR}/bin/activate"
python -m scripts.preflight --config "${CONFIG}"
if [[ "${SKIP_BENCHMARK:-0}" != "1" ]]; then
python -m scripts.benchmark \
--batch-size 32 \
--gradient-accumulation 4 \
--compile \
--warmup-steps 1 \
--steps 3
fi
command=(python -m scripts.pretrain --config "${CONFIG}")
if [[ -n "${RESUME}" ]]; then
command+=(--resume "${RESUME}")
fi
if [[ -n "${STOP_AFTER_STEPS}" ]]; then
command+=(--stop-after-steps "${STOP_AFTER_STEPS}")
fi
"${command[@]}"