#!/bin/bash # after v6: (1) real-task suite with v6, (2) training-speed benchmark of the three cheap wins, (3) v7 = v6 data with # truncated page text + no checkpointing + torch.compile, 3 epochs, calibrate, eval, suite. S=/tmp/claude-1000/-home-ckl-projects-S/8a7ce50a-5640-4606-837a-93df5ff48c83/scratchpad cd /home/ckl/projects/S/laya && source env.sh export LAYA_BASE=$(ls -d ~/.cache/huggingface/hub/models--convaiinnovations--laya/snapshots/*/typed-decisions | head -1) export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True P=.venv/bin/python until grep -qE "V6_DONE|Traceback" finetune/out/v6.log; do sleep 30; done echo "== suite v6" bash $S/start_infra.sh >/dev/null 2>&1 bash $S/restart_s1.sh $PWD/finetune/out/laya-browser-v6 999 >/dev/null (cd ../jev-ultrafast && SUITE_OUT=$PWD/../laya/finetune/out/suite_v6.json timeout 1500 .venv/bin/python ../laya/apps/browser_suite.py 2>&1 | grep -vE "Warn|TileLang") bash $S/stop_all.sh >/dev/null 2>&1; sleep 3 echo "== speed benchmark (256 items, 1 epoch)" echo "-- old items (1016 tok), CKPT=1 COMPILE=0"; CKPT=1 COMPILE=0 LIMIT=256 $P finetune/train.py finetune/out/train_items.pt /tmp/bench_ck 1 2>&1 | grep "=== epoch" echo "-- old items, CKPT=0 COMPILE=0"; CKPT=0 COMPILE=0 LIMIT=256 $P finetune/train.py finetune/out/train_items.pt /tmp/bench_ck 1 2>&1 | grep -E "=== epoch|OutOfMemory" echo "-- old items, CKPT=0 COMPILE=1"; CKPT=0 COMPILE=1 LIMIT=256 $P finetune/train.py finetune/out/train_items.pt /tmp/bench_ck 1 2>&1 | grep -E "=== epoch|OutOfMemory|Error" echo "== rebuild items with 3000-char page text" $P finetune/build_items.py finetune/out/pages.jsonl finetune/out/cases.jsonl finetune/out/ finetune/out/done_cases.jsonl finetune/out/step2_cases.jsonl finetune/out/m2w_cases.jsonl echo "-- new items, CKPT=0 COMPILE=1"; CKPT=0 COMPILE=1 LIMIT=256 $P finetune/train.py finetune/out/train_items.pt /tmp/bench_ck 1 2>&1 | grep -E "=== epoch|OutOfMemory|Error" echo "== train v7 (3 epochs, fast settings)"; CKPT=0 COMPILE=1 $P finetune/train.py finetune/out/train_items.pt finetune/out/laya-browser-v7 3 2>&1 | grep -E "=== epoch|saved|Error|Traceback" echo "== calibrate v7"; $P finetune/calibrate.py finetune/out/pages.jsonl finetune/out/eval_cases.jsonl $PWD/finetune/out/laya-browser-v7 2>&1 | grep -vE "TileLang|Warn|warn|Fetch" echo "== eval v7"; $P finetune/eval.py finetune/out/pages.jsonl finetune/out/eval_cases.jsonl $PWD/finetune/out/laya-browser-v7 2>&1 | grep -vE "TileLang|Warn|warn|Fetch" echo "== suite v7" bash $S/start_infra.sh >/dev/null 2>&1 bash $S/restart_s1.sh $PWD/finetune/out/laya-browser-v7 999 >/dev/null (cd ../jev-ultrafast && SUITE_OUT=$PWD/../laya/finetune/out/suite_v7.json timeout 1500 .venv/bin/python ../laya/apps/browser_suite.py 2>&1 | grep -vE "Warn|TileLang") bash $S/stop_all.sh >/dev/null 2>&1 echo AFTER_V6_DONE