File size: 1,510 Bytes
ae1ed83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Queue 2 (revert to sequential, Young's 23:47 escape rule):
# the parallel attempt showed CPU contention (load 26.5 on 18
# cores; train slowed 0.55 -> ~2.7 s/step instantaneous), so evals
# no longer run alongside training. This queue:
#   1. waits for the orphaned R1 eval to finish, then aggregates
#      so R1 numbers reach the dashboard early;
#   2. waits until ALL training is done (r4 ckpt + no trainer);
#   3. runs the remaining evals one at a time (r0, r2, r3, r4),
#      then the correspondence eval and the final aggregation.
cd ~/sera_v4_experiments/trace_validation/scripts || exit 1
PY=~/lerobot/.venv/bin/python
DF=~/sera_v4_experiments/data_factory
LOG=~/sera_v4_experiments/data_factory_eval_queue.log

stamp() { echo "[$(date '+%F %T')] $*" >> "$LOG"; }

run_eval() {
  arm=$1
  stamp "EVAL $arm START (queue2, sequential)"
  $PY df_eval_arms.py "$arm" >> "$LOG" 2>&1
  stamp "EVAL $arm END rc=$?"
  $PY df_eval_agg.py >> "$LOG" 2>&1
  stamp "AGG AFTER $arm DONE"
}

stamp "QUEUE2 START"
while pgrep -f "df_eval_arms.py" > /dev/null; do sleep 20; done
$PY df_eval_agg.py >> "$LOG" 2>&1
stamp "AGG AFTER r1 DONE (queue2)"
while [ ! -f "$DF/runs/r4/ckpt_05000.pt" ] \
      || pgrep -f "df_train_arms.py" > /dev/null; do
  sleep 60
done
stamp "ALL TRAINING DONE - sequential evals begin"
run_eval r0
run_eval r2
run_eval r3
run_eval r4
stamp "CORR EVAL START"
$PY df_corr_eval.py >> "$LOG" 2>&1
stamp "CORR EVAL END rc=$?"
$PY df_eval_agg.py >> "$LOG" 2>&1
stamp "QUEUE2 DONE"