mudassiruddin21 commited on
Commit
fe9a1b4
·
verified ·
1 Parent(s): a820f15

Measurements-only run for the r3 draft

Browse files
Files changed (3) hide show
  1. control/reset.txt +1 -0
  2. control/run.env +6 -20
  3. scripts/pipeline.sh +15 -0
control/reset.txt CHANGED
@@ -3,3 +3,4 @@
3
  # "kill" stops a running pipeline first. Example: r1-2 train eval_main
4
  r2 generate extract train eval_main report_main eval_alt report
5
  r3 generate extract ablate train eval_main report_main eval_alt eval_prev choose report bench_draft bench_baseline bench_target report_bench
 
 
3
  # "kill" stops a running pipeline first. Example: r1-2 train eval_main
4
  r2 generate extract train eval_main report_main eval_alt report
5
  r3 generate extract ablate train eval_main report_main eval_alt eval_prev choose report bench_draft bench_baseline bench_target report_bench
6
+ r3m fetch_final bench_draft bench_baseline bench_target report_bench
control/run.env CHANGED
@@ -1,21 +1,7 @@
1
  # KEY=VALUE settings passed to scripts/pipeline.sh by scripts/supervise.py
2
- # run r3: 50% more data (earlier answers and features kept), four training recipes compared in
3
- # short runs, the best one trained from the r2 head; the new draft replaces r2's only if it
4
- # scores higher on this machine; then the batch / long-context / draft-length measurements
5
- RUN_ID_FORCE=r3
6
- GEN_TOKENS=6000000
7
- GEN_MINUTES=75
8
- GEN_APPEND=1
9
- EXTRACT_MINUTES=50
10
- EXTRACT_APPEND=1
11
- ABLATE=1
12
- ABLATE_STEPS=300
13
- TRAIN_MINUTES=60
14
- RUN_NAME=main3
15
- TRAIN_INIT=runs/main/sub_bf16
16
- TRAIN_INIT_HF=mudassiruddin21/EMC:submissions/r2/main-bf16
17
- PREV_TAG=eval_draft_fp8
18
- PREV_SUB=runs/main/sub_fp8
19
- PREV_SUB_HF=mudassiruddin21/EMC:submissions/r2/main-fp8
20
- EVAL_ALT=0
21
- BENCH=1
 
1
  # KEY=VALUE settings passed to scripts/pipeline.sh by scripts/supervise.py
2
+ # measurements only (the machine of run r3 stopped during them): batch sizes, long contexts and
3
+ # draft lengths for the r3 draft (fetched from the dataset repo), the baseline and the target alone
4
+ RUN_ID_FORCE=r3m
5
+ BENCH_ONLY=1
6
+ FINAL_SUB=models/final-fp8
7
+ FINAL_SUB_HF=mudassiruddin21/EMC:submissions/r3/main3-fp8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
scripts/pipeline.sh CHANGED
@@ -187,6 +187,12 @@ s_choose() {
187
  }
188
  bench() { env EMC_TARGET="$TARGET" EMC_SUB="${SUB:-}" EMC2_WORK="$WORK" "$PY" "$REPO/scripts/bench.py" "$@"; }
189
  final_sub() { if [ -f "$STATE/final_sub" ]; then cat "$STATE/final_sub"; else primary; fi; }
 
 
 
 
 
 
190
  s_bench_draft() { SUB="$(final_sub)" bench --tag draft --what batch,long,k; }
191
  s_bench_baseline() { SUB="$BASELINE" bench --tag baseline --what batch,long; }
192
  s_bench_target() { SUB="" bench --tag target_only --target-only --what batch,long; }
@@ -221,6 +227,15 @@ check_done eval_baseline test -s "$RESULTS/eval_baseline.json"
221
  stage env 1 s_env
222
  stage download 1 s_download
223
  stage baseline 1 s_baseline
 
 
 
 
 
 
 
 
 
224
  prompts_pid=""
225
  if ! is_done prompts; then (stage prompts 1 s_prompts) & prompts_pid=$!; fi
226
  stage checkenv 0 s_checkenv || true
 
187
  }
188
  bench() { env EMC_TARGET="$TARGET" EMC_SUB="${SUB:-}" EMC2_WORK="$WORK" "$PY" "$REPO/scripts/bench.py" "$@"; }
189
  final_sub() { if [ -f "$STATE/final_sub" ]; then cat "$STATE/final_sub"; else primary; fi; }
190
+ s_fetch_final() { # FINAL_SUB / FINAL_SUB_HF: the draft to measure when nothing is trained here
191
+ local d="$FINAL_SUB"; case "$d" in /*) ;; *) d="$EMC_ROOT/$d" ;; esac
192
+ [ -s "$d/model.safetensors" ] || { rm -rf "$d"; fetch_hf "$FINAL_SUB_HF" "$d"; }
193
+ SUB="$d" kit validate
194
+ echo "$d" > "$STATE/final_sub"
195
+ }
196
  s_bench_draft() { SUB="$(final_sub)" bench --tag draft --what batch,long,k; }
197
  s_bench_baseline() { SUB="$BASELINE" bench --tag baseline --what batch,long; }
198
  s_bench_target() { SUB="" bench --tag target_only --target-only --what batch,long; }
 
227
  stage env 1 s_env
228
  stage download 1 s_download
229
  stage baseline 1 s_baseline
230
+ if [ "${BENCH_ONLY:-0}" = 1 ]; then # measurements of an already trained draft (fetched from the Hub)
231
+ stage fetch_final 1 s_fetch_final
232
+ stage bench_draft 0 s_bench_draft || true
233
+ stage bench_baseline 0 s_bench_baseline || true
234
+ stage bench_target 0 s_bench_target || true
235
+ stage report_bench 0 s_report || true
236
+ log "pipeline finished (measurements only)"
237
+ exit 0
238
+ fi
239
  prompts_pid=""
240
  if ! is_done prompts; then (stage prompts 1 s_prompts) & prompts_pid=$!; fi
241
  stage checkenv 0 s_checkenv || true