File size: 2,502 Bytes
b4396f0 | 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 57 58 59 60 61 62 | #!/bin/bash
# Arm Q2 chain (coordinator 8, 2026-11-18): wait for the s0 probe
# to finish AND the Q2 smoke-pass marker, launch Q2 training the
# moment both hold (Young 21:09: machine must not idle), then —
# after training — measurements 2k/5k/10k (routing/tokens/RSA,
# Q's exact protocol), the 70-ep probe, and composition Z.
set -u
EXP=$HOME/sera_v4_experiments
LOG=$EXP/chain_q2.log
exec >> "$LOG" 2>&1
echo "CHAIN_Q2_START $(date -Is)"
S0=$EXP/quest_probe/results/q-quest-probe-s0.jsonl
while true; do
rows=0
[ -f "$S0" ] && rows=$(grep -c '^{' "$S0" 2>/dev/null || echo 0)
if [ "${rows:-0}" -ge 70 ] && ! pgrep -f "eval_v4_s0.py" > /dev/null \
&& [ -f "$EXP/quest_probe/Q2_SMOKE_PASS" ]; then
break
fi
sleep 10
done
echo "S0 DONE + SMOKE PASS; launching Q2 training $(date -Is)"
bash "$EXP/tools/run_arm_q2.sh"
# wait for training to finish: checkpoint 010000 + no train process
while true; do
if [ -d "$EXP/sera-v4-q2-questfix/checkpoints/010000" ] \
&& ! pgrep -f "train_q.py.*sera-v4-q2-questfix" > /dev/null; then
break
fi
sleep 30
done
echo "Q2 TRAINING DONE $(date -Is)"
cd "$HOME/lerobot" || exit 1
export MUJOCO_GL=egl PYTHONUNBUFFERED=1
for s in 002000 005000 010000; do
n=$((10#$s))
.venv/bin/python "$EXP/tools/measure_routing.py" \
--ckpt "$EXP/sera-v4-q2-questfix/checkpoints/$s/pretrained_model" \
--out "$EXP/measurement/results/q2-questfix-$n.json" --batch 32
echo "ROUTING_$n DONE $(date -Is)"
.venv/bin/python "$EXP/tools/measure_tokens.py" \
--ckpt "$EXP/sera-v4-q2-questfix/checkpoints/$s/pretrained_model" \
--out "$EXP/measurement/results/q2-questfix-tokens-$n.json" --batch 32
echo "TOKENS_$n DONE $(date -Is)"
done
for n in 2000 5000 10000; do
.venv/bin/python "$EXP/tools/measure_rsa.py" \
--tokens "$EXP/measurement/results/q2-questfix-tokens-$n.json" \
--out "$EXP/measurement/results/q2-questfix-rsa-$n.json"
echo "RSA_$n DONE $(date -Is)"
done
.venv/bin/python "$EXP/tools/eval_v4.py" \
--ckpt "$EXP/sera-v4-q2-questfix/checkpoints/010000/pretrained_model" \
--arm q2-questfix --out "$EXP/quest_probe/results/q2-questfix.jsonl" --seed 0
echo "PROBE DONE $(date -Is)"
.venv/bin/python "$EXP/tools/rollout_skill_v4.py" \
--ckpt "$EXP/sera-v4-q2-questfix/checkpoints/010000/pretrained_model" \
--model v3 --tasks 1,3,4,6,7,8 --eps 0,1,2,3,4,5,6,7,8,9 \
--out "$EXP/quest_probe/results/q2-questfix-comp-z.jsonl" --seed 0
echo "COMP_Z DONE $(date -Is)"
echo "CHAIN_Q2_END $(date -Is)"
|