| #!/bin/bash |
| |
| |
| |
| set -uo pipefail |
| pip install -q "transformers==4.46.2" "huggingface_hub<1.0" "datasets<4" "accelerate" 2>&1 | tail -1 |
|
|
| python -c " |
| from huggingface_hub import snapshot_download |
| snapshot_download('ashishk1331/ccd-repro-code', repo_type='dataset', local_dir='/work') |
| " |
| cd /work |
| mkdir -p outputs |
| nvidia-smi --query-gpu=name,memory.total --format=csv |
|
|
| : "${N_TRIP:=60}" |
| : "${N_HE:=40}" |
| : "${N_ABL:=40}" |
| : "${N_TEMP:=25}" |
|
|
| push () { |
| python - <<'EOF' 2>&1 | tail -1 || true |
| from huggingface_hub import HfApi |
| HfApi().upload_folder(folder_path="outputs", path_in_repo="outputs", |
| repo_id="ashishk1331/ccd-repro-results", repo_type="dataset") |
| print("pushed") |
| EOF |
| } |
|
|
| run () { |
| out="outputs/$1"; shift |
| if [ -f "$out" ]; then echo "SKIP $out (exists)"; return; fi |
| echo "=========== RUN $out : $* ===========" |
| python scripts/run_eval.py "$@" --out "$out" || echo "!!!!! FAILED: $out" |
| push |
| } |
|
|
| python - <<'EOF' |
| |
| |
| from huggingface_hub import HfApi, snapshot_download |
| api = HfApi() |
| api.create_repo('ashishk1331/ccd-repro-results', repo_type='dataset', exist_ok=True) |
| try: |
| snapshot_download('ashishk1331/ccd-repro-results', repo_type='dataset', |
| local_dir='/work/_prev') |
| import glob, shutil, os |
| n = 0 |
| for f in glob.glob('/work/_prev/outputs/*.json'): |
| shutil.copy(f, '/work/outputs/'); n += 1 |
| print(f'resumed {n} finished configs') |
| except Exception as e: |
| print('no previous results:', e) |
| EOF |
|
|
| |
| for m in baseline ccd ccd_ds; do |
| run "c3_trip_${m}.json" --task trip --method $m --limit $N_TRIP |
| done |
|
|
| |
| for m in baseline ccd ccd_ds; do |
| run "c4_he_${m}.json" --task humaneval --method $m --limit $N_HE |
| done |
|
|
| |
| |
| |
| |
| run "c5_abl_baseline.json" --task trip --method baseline --limit $N_ABL --num-cities 3 |
| for d in 1 2 3 4 5 6; do |
| run "c5_abl_d${d}.json" --task trip --method ccd_ds --limit $N_ABL --num-cities 3 --history-d $d --buffer-V 4 |
| done |
| for V in 1 2 3 5 6; do |
| run "c5_abl_V${V}.json" --task trip --method ccd_ds --limit $N_ABL --num-cities 3 --history-d 3 --buffer-V $V |
| done |
|
|
| |
| for t in 0.0 0.4 0.7 1.0; do |
| run "c6_he_baseline_t${t}.json" --task humaneval --method baseline --limit $N_TEMP --temperature $t |
| run "c6_he_ccd_ds_t${t}.json" --task humaneval --method ccd_ds --limit $N_TEMP --temperature $t |
| done |
|
|
| echo "=================== ALL DONE ===================" |
| python - <<'EOF' |
| import json, glob |
| for f in sorted(glob.glob("outputs/*.json")): |
| r = json.load(open(f)) |
| print(f"{f.split('/')[-1]:28s} score={r['score']:6.2f} steps={r['mean_steps']:7.2f} " |
| f"speedup={r['speedup_vs_uniform']:5.2f}x n={r['n_examples']}") |
| EOF |
| push |
|
|