jvonrad commited on
Commit
0b65f8f
·
verified ·
1 Parent(s): 5e95049

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +60 -0
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # External benchmark evaluation
2
+
3
+ Isambard-AI is blocked by a CPU-minutes quota, so we evaluate the trained
4
+ checkpoints on a GPU elsewhere. The models are a custom LLaMA-style Transformer
5
+ (`src/xscript/model.py`) + SentencePiece tokenizer — pure PyTorch, using
6
+ `F.scaled_dot_product_attention`, no flash-attn / triton / custom kernels — so
7
+ they run on any stock GPU (or CPU, slowly). Each model is ~1B params (fits any
8
+ 16GB GPU).
9
+
10
+ The benchmark harness (`src/xscript/eval/bench.py`) wraps our model into
11
+ lm-evaluation-harness and scores Global-MMLU, Belebele, and XNLI on each run's
12
+ training languages. It is the *same* harness we would have run on-cluster, so
13
+ numbers are directly comparable.
14
+
15
+ ## 1. Export from Isambard (already done by `upload_to_hf.py`)
16
+
17
+ The private HF repo mirrors the on-cluster layout:
18
+
19
+ ```
20
+ src/xscript/** # bundled model + harness code
21
+ tokenizers/unigram_{starved,destarved}/{sp.model,meta.json}
22
+ runs/<name>/checkpoints/final.pt # 15 checkpoints, fp32, ~4GB each
23
+ models.json # friendly name -> tokenizer + langs + orig run
24
+ run_benchmarks.py requirements.txt README.md
25
+ ```
26
+
27
+ Models use friendly names `<mixture>-<starved|fair>` (e.g. `en-fair`,
28
+ `en-ar-starved`). `models.json` maps each to its real tokenizer.
29
+
30
+ ## 2. Run on your GPU
31
+
32
+ ```bash
33
+ # clone just the runner (or download run_benchmarks.py + requirements.txt from the repo)
34
+ pip install torch --index-url https://download.pytorch.org/whl/cu121 # match your CUDA
35
+ pip install -r requirements.txt
36
+ export HF_TOKEN=hf_... # while the repo is private
37
+
38
+ # quick validation pass over all 15 runs (~200 examples/task) -- do this FIRST
39
+ python run_benchmarks.py --repo jvonrad/xscript-eval --limit 200
40
+
41
+ # full suite once the quick pass looks sane
42
+ python run_benchmarks.py --repo jvonrad/xscript-eval
43
+ ```
44
+
45
+ The runner downloads one checkpoint at a time and deletes it after eval
46
+ (`--keep-checkpoints` to retain), so peak disk is ~5GB. Results:
47
+
48
+ ```
49
+ xscript_bench/results/bench/<run>_final.json # per-run task accuracies
50
+ xscript_bench/results/summary.json # everything combined
51
+ ```
52
+
53
+ Send those JSONs back for analysis.
54
+
55
+ ## Notes
56
+ - `--runs en-starved en-fair` limits to a subset (friendly names).
57
+ - `--tasks xnli_en xnli_de` overrides the task list (default = the run's langs).
58
+ - Mono runs get 3 tasks (their one language), bilingual runs get 6 (both langs).
59
+ - Scores are ordinary accuracy (`acc,none`); raw harness output is preserved in
60
+ each per-run JSON for length-normalized variants.