RSIChallenge / auto-impl /scripts /ptb_run.sbatch
Jerry999's picture
Add files using upload-large-folder tool
158258b verified
Raw History Blame Contribute Delete
2.13 kB
#!/bin/bash
# One PostTrainBench run (agent phase + evaluation) on one H100.
#
# sbatch scripts/ptb_run.sbatch # 1 h smoke test, gsm8k, claude_non_api + opus-5
# HOURS=10 sbatch --time=14:00:00 scripts/ptb_run.sbatch # the official setting
#
# Auth: no API key. WITH_X2P=1 makes the Slurm task prolog start a per-job x2pagentd sidecar; its
# unix socket is bound into the sandbox, where a shim on the sandbox's own loopback relays the
# Anthropic traffic. The sandbox itself has an empty network namespace -- everything the agent
# needs is preinstalled in the image and prefilled in the HF cache.
#SBATCH --job-name=ptb-run
#SBATCH --partition=h100
#SBATCH --account=midpri
#SBATCH --qos=midpri
#SBATCH --gres=gpu:1
#SBATCH --cpus-per-task=16
#SBATCH --mem=256G
#SBATCH --time=03:00:00
#SBATCH --export=ALL,WITH_X2P=1
#SBATCH --output=logs/ptb-run-%j.out
set -euo pipefail
# The login pod's x2p proxy is not routable from a compute node, and apptainer forwards these into
# the container even with --cleanenv.
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY no_proxy NO_PROXY X2P_PROXY_URL
TASK="${TASK:-gsm8k}"
MODEL="${MODEL:-Qwen/Qwen3-1.7B-Base}"
AGENT="${AGENT:-claude_non_api}"
AGENT_MODEL="${AGENT_MODEL:-claude-opus-5}"
CONTAINER="${CONTAINER:-opus_5_local}"
HOURS="${HOURS:-1}"
EXPERIMENT_NAME="${EXPERIMENT_NAME:-}"
cd /home/jiaruiliu/local/git-repos/auto-impl
export PYTHONPATH=src
if [[ -z "${X2P_SOCKET_DIR:-}" ]]; then
echo "X2P_SOCKET_DIR is unset: submit with --export=ALL,WITH_X2P=1 so the prolog starts x2pagentd." >&2
exit 1
fi
echo "node=$(hostname) x2p_socket=$X2P_SOCKET_DIR"
nvidia-smi -L
# The passthrough rejects Claude Code's experimental beta headers.
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
export PTB_SANDBOX_ENV="CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"
python3 -m posttrainbench run --task "$TASK" --model "$MODEL" --agent "$AGENT" \
--agent-model "$AGENT_MODEL" --container "$CONTAINER" --hours "$HOURS" \
--experiment-name "$EXPERIMENT_NAME"