Urdatorn commited on
Commit
3a13cfd
·
verified ·
1 Parent(s): e08ea84

Makron seed 1 over oga-no-norma 5d737f8: per-vowel comparison with silver

Browse files
analysis/makron_oga.py ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ '''
2
+ Run a Makron checkpoint over the whole silver corpus (Urdatorn/oga-macronized-no-norma) and
3
+ record, vowel by vowel, where the model's length differs from the rule-based silver label.
4
+
5
+ For every dichronon the model can mark (tokenizer.real_dichrona_mask), the pair
6
+ (silver, makron) is one of:
7
+
8
+ agree_short / agree_long same mark
9
+ flip_long_to_short silver _ , model ^
10
+ flip_short_to_long silver ^ , model _
11
+ fill_short / fill_long silver unmarked (the macronizer abstained), model marks it
12
+ unmarked both unmarked (the model predicted NONE)
13
+ drop_short / drop_long silver marked, model NONE
14
+
15
+ Outputs (in --out):
16
+ sentences/part-XXXXX.parquet one row per corpus sentence: idx (row in the HF data, file
17
+ order), plain, silver, makron, and the per-category counts
18
+ changed_words/part-XXXXX.tsv one row per word whose marks differ (flips and drops only;
19
+ fills are counted in the sentence table): idx, word index,
20
+ silver word, makron word, categories
21
+ summary.json corpus totals per category
22
+ changed_forms.tsv the changed words aggregated by (silver word, makron word)
23
+
24
+ Shards are written as they complete, so a restarted job skips the finished ones.
25
+ '''
26
+
27
+ import argparse
28
+ import collections
29
+ import glob
30
+ import json
31
+ import os
32
+ import sys
33
+ import time
34
+ import unicodedata
35
+
36
+ import pyarrow as pa
37
+ import pyarrow.compute as pc
38
+ import pyarrow.parquet as pq
39
+
40
+ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
41
+ from predict import MacronPredictor # noqa: E402
42
+
43
+ CATS = ["agree_short", "agree_long", "flip_long_to_short", "flip_short_to_long",
44
+ "fill_short", "fill_long", "drop_short", "drop_long", "unmarked"]
45
+ CHANGE = {"flip_long_to_short", "flip_short_to_long", "drop_short", "drop_long"}
46
+ NAME = {"^": "short", "_": "long"}
47
+
48
+
49
+ def letters_and_marks(s):
50
+ s = unicodedata.normalize("NFC", s)
51
+ letters, marks = [], []
52
+ for c in s:
53
+ if c in "^_":
54
+ if marks:
55
+ marks[-1] = c
56
+ else:
57
+ letters.append(c)
58
+ marks.append("")
59
+ return letters, marks
60
+
61
+
62
+ def category(sv, mk):
63
+ if sv == mk:
64
+ return "unmarked" if not sv else "agree_" + NAME[sv]
65
+ if not sv:
66
+ return "fill_" + NAME[mk]
67
+ if not mk:
68
+ return "drop_" + NAME[sv]
69
+ return "flip_long_to_short" if sv == "_" else "flip_short_to_long"
70
+
71
+
72
+ def compare(silver, makron):
73
+ '''Per-category counts and the changed words, or None if the letters do not align.'''
74
+ ls, ms = letters_and_marks(silver)
75
+ lm, mm = letters_and_marks(makron)
76
+ if ls != lm:
77
+ return None
78
+ counts = collections.Counter()
79
+ changed = []
80
+ sw, mw, cats, wi = [], [], set(), 0
81
+
82
+ def flush():
83
+ nonlocal sw, mw, cats, wi
84
+ if cats & CHANGE:
85
+ changed.append((wi, "".join(sw), "".join(mw), ",".join(sorted(cats))))
86
+ if sw:
87
+ wi += 1
88
+ sw, mw, cats = [], [], set()
89
+
90
+ for ch, sv, mk in zip(ls, ms, mm):
91
+ if ch.isspace():
92
+ flush()
93
+ continue
94
+ sw.append(ch + sv)
95
+ mw.append(ch + mk)
96
+ if sv or mk:
97
+ c = category(sv, mk)
98
+ counts[c] += 1
99
+ cats.add(c)
100
+ flush()
101
+ return counts, changed
102
+
103
+
104
+ def main():
105
+ ap = argparse.ArgumentParser()
106
+ ap.add_argument("--model_dir", required=True)
107
+ ap.add_argument("--data", required=True, help="directory with the HF parquet shards")
108
+ ap.add_argument("--out", required=True)
109
+ ap.add_argument("--shard_rows", type=int, default=100_000)
110
+ ap.add_argument("--batch_size", type=int, default=1024)
111
+ ap.add_argument("--limit", type=int, help="first N sentences only (smoke test)")
112
+ a = ap.parse_args()
113
+
114
+ os.makedirs(f"{a.out}/sentences", exist_ok=True)
115
+ os.makedirs(f"{a.out}/changed_words", exist_ok=True)
116
+ files = sorted(glob.glob(f"{a.data}/*.parquet"))
117
+ table = pa.concat_tables([pq.read_table(f, columns=["macronized"]) for f in files])
118
+ silver_all = table.column("macronized").to_pylist()
119
+ # model input = the silver sentence with its ^/_ stripped
120
+ plain_all = [s.replace("^", "").replace("_", "") for s in silver_all]
121
+ if a.limit:
122
+ silver_all, plain_all = silver_all[:a.limit], plain_all[:a.limit]
123
+ n = len(plain_all)
124
+ print(f"[data] {n:,} sentences from {len(files)} files", flush=True)
125
+
126
+ pred = MacronPredictor(a.model_dir)
127
+ print(f"[model] {a.model_dir} on {pred.device}", flush=True)
128
+
129
+ t0 = time.time()
130
+ nshards = (n + a.shard_rows - 1) // a.shard_rows
131
+ for k in range(nshards):
132
+ spath = f"{a.out}/sentences/part-{k:05d}.parquet"
133
+ if os.path.exists(spath):
134
+ print(f"[shard {k + 1}/{nshards}] exists, skipped", flush=True)
135
+ continue
136
+ lo, hi = k * a.shard_rows, min(n, (k + 1) * a.shard_rows)
137
+ plain = plain_all[lo:hi]
138
+ order = sorted(range(len(plain)), key=lambda i: len(plain[i])) # less padding
139
+ out_sorted = pred.macronize_lines([plain[i] for i in order], batch_size=a.batch_size)
140
+ makron = [None] * len(plain)
141
+ for i, o in zip(order, out_sorted):
142
+ makron[i] = o
143
+
144
+ rows = collections.defaultdict(list)
145
+ tot = collections.Counter()
146
+ misaligned = 0
147
+ wpath = f"{a.out}/changed_words/part-{k:05d}.tsv"
148
+ with open(wpath + ".tmp", "w", encoding="utf-8") as wf:
149
+ wf.write("idx\tword_index\tsilver\tmakron\tcategories\n")
150
+ for j, (p, s, m) in enumerate(zip(plain, silver_all[lo:hi], makron)):
151
+ r = compare(s, m)
152
+ if r is None:
153
+ misaligned += 1
154
+ counts, changed = collections.Counter(), []
155
+ else:
156
+ counts, changed = r
157
+ rows["idx"].append(lo + j)
158
+ rows["plain"].append(p)
159
+ rows["silver"].append(s)
160
+ rows["makron"].append(m)
161
+ rows["aligned"].append(r is not None)
162
+ for c in CATS:
163
+ rows[c].append(counts[c])
164
+ tot.update(counts)
165
+ for wi, sw, mw, cs in changed:
166
+ wf.write(f"{lo + j}\t{wi}\t{sw}\t{mw}\t{cs}\n")
167
+ os.replace(wpath + ".tmp", wpath)
168
+ pq.write_table(pa.table(dict(rows)), spath + ".tmp")
169
+ os.replace(spath + ".tmp", spath)
170
+ rate = (hi) / max(1e-9, time.time() - t0)
171
+ changes = sum(tot[c] for c in CHANGE)
172
+ marked = sum(tot[c] for c in CATS if c != "unmarked" and not c.startswith("fill"))
173
+ print(f"[shard {k + 1}/{nshards}] rows {lo:,}-{hi:,} misaligned {misaligned} "
174
+ f"silver-marked {marked:,} changed {changes:,} ({100 * changes / max(1, marked):.2f}%) "
175
+ f"fills {tot['fill_short'] + tot['fill_long']:,} "
176
+ f"elapsed {time.time() - t0:.0f}s", flush=True)
177
+
178
+ # corpus totals and aggregated changed forms, from the shards on disk
179
+ tot = collections.Counter()
180
+ misaligned = 0
181
+ for f in sorted(glob.glob(f"{a.out}/sentences/part-*.parquet")):
182
+ t = pq.read_table(f, columns=CATS + ["aligned"])
183
+ for c in CATS:
184
+ tot[c] += pc.sum(t.column(c)).as_py() or 0
185
+ misaligned += t.num_rows - (pc.sum(t.column("aligned")).as_py() or 0)
186
+ forms = collections.Counter()
187
+ for f in sorted(glob.glob(f"{a.out}/changed_words/part-*.tsv")):
188
+ with open(f, encoding="utf-8") as fh:
189
+ next(fh)
190
+ for line in fh:
191
+ _, _, sw, mw, cs = line.rstrip("\n").split("\t")
192
+ forms[(sw, mw, cs)] += 1
193
+ with open(f"{a.out}/changed_forms.tsv", "w", encoding="utf-8") as fh:
194
+ fh.write("count\tsilver\tmakron\tcategories\n")
195
+ for (sw, mw, cs), c in forms.most_common():
196
+ fh.write(f"{c}\t{sw}\t{mw}\t{cs}\n")
197
+ marked = sum(tot[c] for c in ("agree_short", "agree_long", "flip_long_to_short",
198
+ "flip_short_to_long", "drop_short", "drop_long"))
199
+ summary = {"model": a.model_dir, "data": a.data, "sentences": n,
200
+ "misaligned_sentences": misaligned, "counts": dict(tot),
201
+ "silver_marked": marked,
202
+ "changed_of_silver_marked_pct": 100 * sum(tot[c] for c in CHANGE) / max(1, marked),
203
+ "silver_unmarked_filled": tot["fill_short"] + tot["fill_long"],
204
+ "distinct_changed_forms": len(forms)}
205
+ with open(f"{a.out}/summary.json", "w") as fh:
206
+ json.dump(summary, fh, indent=2, ensure_ascii=False)
207
+ print(json.dumps(summary, indent=2, ensure_ascii=False), flush=True)
208
+
209
+
210
+ if __name__ == "__main__":
211
+ main()
logs/makron-oga-5722762.out ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [2026-11-25T01:07:28+01:00] job_start id=5722762 host=n53 model=/nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code/runs/final-v2/seed1/best out=/nobackup/proj/flash/dionysus/personal/cleland/oga-macronized-2026-11/makron-seed1-5d737f8
2
+ The following modules were not unloaded:
3
+ (Use "module --force purge" to unload all):
4
+
5
+ 1) hpc_sysenv/.1 2) hpc/.2.2.0
6
+ NVIDIA GH200 120GB, 97871 MiB
7
+ [2026-11-25T01:07:28+01:00] smoke run (5000 sentences) -> /scratch/local/makron-smoke.S7Kf
8
+ [data] 5,000 sentences from 2 files
9
+ /nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code/model.py:74: UserWarning: enable_nested_tensor is True, but self.use_nested_tensor is False because encoder_layer.norm_first was True
10
+ self.encoder = nn.TransformerEncoder(encoder_layer, num_layers=config.num_hidden_layers)
11
+ [model] /nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code/runs/final-v2/seed1/best on cuda
12
+ [shard 1/2] rows 0-2,500 misaligned 0 silver-marked 12,667 changed 58 (0.46%) fills 5,554 elapsed 0s
13
+ [shard 2/2] rows 2,500-5,000 misaligned 0 silver-marked 13,473 changed 55 (0.41%) fills 5,739 elapsed 1s
14
+ {
15
+ "model": "/nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code/runs/final-v2/seed1/best",
16
+ "data": "/nobackup/proj/flash/dionysus/personal/cleland/oga-macronized-2026-11/final/data",
17
+ "sentences": 5000,
18
+ "misaligned_sentences": 0,
19
+ "counts": {
20
+ "agree_short": 22619,
21
+ "agree_long": 3408,
22
+ "flip_long_to_short": 4,
23
+ "flip_short_to_long": 11,
24
+ "fill_short": 10096,
25
+ "fill_long": 1197,
26
+ "drop_short": 66,
27
+ "drop_long": 32,
28
+ "unmarked": 0
29
+ },
30
+ "silver_marked": 26140,
31
+ "changed_of_silver_marked_pct": 0.4322876817138485,
32
+ "silver_unmarked_filled": 11293,
33
+ "distinct_changed_forms": 39
34
+ }
35
+ count silver makron categories
36
+ 21 σῶ^μα^ σῶμα^ agree_short,drop_short
37
+ 9 δέ^κα^ δέκα^ agree_short,drop_short
38
+ 7 Δα^υὶ_δ Δαυὶδ drop_long,drop_short
39
+ 6 Δα^υί_δ, Δαυίδ, drop_long,drop_short
40
+ [2026-11-25T01:07:42+01:00] full run
41
+ [data] 2,096,720 sentences from 2 files
42
+ /nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code/model.py:74: UserWarning: enable_nested_tensor is True, but self.use_nested_tensor is False because encoder_layer.norm_first was True
43
+ self.encoder = nn.TransformerEncoder(encoder_layer, num_layers=config.num_hidden_layers)
44
+ [model] /nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code/runs/final-v2/seed1/best on cuda
45
+ [shard 1/21] rows 0-100,000 misaligned 0 silver-marked 703,631 changed 7,244 (1.03%) fills 340,723 elapsed 19s
46
+ [shard 2/21] rows 100,000-200,000 misaligned 0 silver-marked 833,344 changed 5,762 (0.69%) fills 404,399 elapsed 42s
47
+ [shard 3/21] rows 200,000-300,000 misaligned 0 silver-marked 789,071 changed 4,184 (0.53%) fills 361,037 elapsed 63s
48
+ [shard 4/21] rows 300,000-400,000 misaligned 0 silver-marked 903,375 changed 5,643 (0.62%) fills 390,048 elapsed 87s
49
+ [shard 5/21] rows 400,000-500,000 misaligned 0 silver-marked 632,313 changed 2,951 (0.47%) fills 311,924 elapsed 104s
50
+ [shard 6/21] rows 500,000-600,000 misaligned 0 silver-marked 789,929 changed 4,656 (0.59%) fills 377,203 elapsed 125s
51
+ [shard 7/21] rows 600,000-700,000 misaligned 0 silver-marked 583,770 changed 5,864 (1.00%) fills 333,789 elapsed 142s
52
+ [shard 8/21] rows 700,000-800,000 misaligned 0 silver-marked 910,759 changed 5,271 (0.58%) fills 449,938 elapsed 166s
53
+ [shard 9/21] rows 800,000-900,000 misaligned 0 silver-marked 791,423 changed 4,479 (0.57%) fills 400,299 elapsed 188s
54
+ [shard 10/21] rows 900,000-1,000,000 misaligned 0 silver-marked 701,745 changed 4,361 (0.62%) fills 335,046 elapsed 207s
55
+ [shard 11/21] rows 1,000,000-1,100,000 misaligned 0 silver-marked 815,534 changed 4,853 (0.60%) fills 351,460 elapsed 229s
56
+ [shard 12/21] rows 1,100,000-1,200,000 misaligned 0 silver-marked 664,038 changed 3,660 (0.55%) fills 288,925 elapsed 248s
57
+ [shard 13/21] rows 1,200,000-1,300,000 misaligned 0 silver-marked 857,094 changed 7,226 (0.84%) fills 428,279 elapsed 272s
58
+ [shard 14/21] rows 1,300,000-1,400,000 misaligned 0 silver-marked 707,684 changed 3,013 (0.43%) fills 358,354 elapsed 292s
59
+ [shard 15/21] rows 1,400,000-1,500,000 misaligned 0 silver-marked 801,779 changed 5,842 (0.73%) fills 422,422 elapsed 314s
60
+ [shard 16/21] rows 1,500,000-1,600,000 misaligned 0 silver-marked 880,022 changed 6,886 (0.78%) fills 319,138 elapsed 336s
61
+ [shard 17/21] rows 1,600,000-1,700,000 misaligned 0 silver-marked 864,522 changed 4,579 (0.53%) fills 345,692 elapsed 358s
62
+ [shard 18/21] rows 1,700,000-1,800,000 misaligned 0 silver-marked 572,336 changed 2,289 (0.40%) fills 291,230 elapsed 374s
63
+ [shard 19/21] rows 1,800,000-1,900,000 misaligned 0 silver-marked 437,431 changed 1,713 (0.39%) fills 218,217 elapsed 387s
64
+ [shard 20/21] rows 1,900,000-2,000,000 misaligned 0 silver-marked 435,379 changed 1,938 (0.45%) fills 217,466 elapsed 400s
65
+ [shard 21/21] rows 2,000,000-2,096,720 misaligned 0 silver-marked 212,864 changed 8,522 (4.00%) fills 238,987 elapsed 409s
66
+ {
67
+ "model": "/nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code/runs/final-v2/seed1/best",
68
+ "data": "/nobackup/proj/flash/dionysus/personal/cleland/oga-macronized-2026-11/final/data",
69
+ "sentences": 2096720,
70
+ "misaligned_sentences": 0,
71
+ "counts": {
72
+ "agree_short": 12991073,
73
+ "agree_long": 1796034,
74
+ "flip_long_to_short": 28334,
75
+ "flip_short_to_long": 9605,
76
+ "fill_short": 6490643,
77
+ "fill_long": 693933,
78
+ "drop_short": 50010,
79
+ "drop_long": 12987,
80
+ "unmarked": 0
81
+ },
82
+ "silver_marked": 14888043,
83
+ "changed_of_silver_marked_pct": 0.6779668758345203,
84
+ "silver_unmarked_filled": 7184576,
85
+ "distinct_changed_forms": 23131
86
+ }
87
+ [2026-11-25T01:14:41+01:00] top changed forms:
88
+ count silver makron categories
89
+ 11877 σῶ^μα^ σῶμα^ agree_short,drop_short
90
+ 7576 δι^ό^τι^ δι^ότι^ agree_short,drop_short
91
+ 4054 δέ^κα^ δέκα^ agree_short,drop_short
92
+ 3188 μι^ᾶ_ς μι^ᾶς agree_short,drop_long
93
+ 2703 σῶ^μα^, σῶμα^, agree_short,drop_short
94
+ 2056 ἂ_ν ἂ^ν flip_long_to_short
95
+ 1632 Ι^σρα_ηλ Ισρα_ηλ agree_long,drop_short
96
+ 1475 ἂ^ν ἂ_ν flip_short_to_long
97
+ 1320 τὰ_ς τὰ^ς flip_long_to_short
98
+ 1150 σῶ^μα^. σῶμα^. agree_short,drop_short
99
+ 1015 δι^α^φορᾶ_ς δι^α^φορᾶς agree_short,drop_long
100
+ 866 Δαυι_δ Δαυιδ drop_long
101
+ 699 Ἀθηνᾶ_ς Ἀ^θηνᾶς drop_long,fill_short
102
+ 675 οὐδεμιᾶ_ς οὐδεμι^ᾶς drop_long,fill_short
103
+ 646 ἐπι_ ἐπι^ flip_long_to_short
104
+ 592 ἄ_ν ἄ^ν flip_long_to_short
105
+ 531 Ι^σρα_ηλ, Ισρα_ηλ, agree_long,drop_short
106
+ 530 ἀ^γορᾶ_ς ἀ^γορᾶς agree_short,drop_long
107
+ 486 σῶ^μα^· σῶμα^· agree_short,drop_short
108
+ 480 Δα^υὶ_δ Δαυὶδ drop_long,drop_short
109
+ 463 χα^ρᾶ_ς χα^ρᾶς agree_short,drop_long
110
+ 393 δέ^κα^, δέκα^, agree_short,drop_short
111
+ 366 Ι^σρα_ηλ. Ισρα_ηλ. agree_long,drop_short
112
+ 302 ἄ^ν ἄ_ν flip_short_to_long
113
+ 292 μετα^φορᾶ_ς μετα^φορᾶς agree_short,drop_long
114
+ 289 α_ α^ flip_long_to_short
115
+ 281 σκι^ᾶ_ς σκι^ᾶς agree_short,drop_long
116
+ 273 τὰ^ τὰ_ flip_short_to_long
117
+ 261 ἱ^ερᾶ_ς ἱ^ερᾶς agree_short,drop_long
118
+ 581M /nobackup/proj/flash/dionysus/personal/cleland/oga-macronized-2026-11/makron-seed1-5d737f8
119
+ [2026-11-25T01:14:41+01:00] job_complete
slurm/makron_oga.slurm ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ #SBATCH --job-name=makron-oga
3
+ #SBATCH --account=naiss2026-3-353-gpu
4
+ #SBATCH --partition=gpu
5
+ #SBATCH --nodes=1
6
+ #SBATCH --ntasks=1
7
+ #SBATCH --cpus-per-task=8
8
+ #SBATCH --gpus=1
9
+ #SBATCH --mem=64G
10
+ #SBATCH --time=06:00:00
11
+ #SBATCH --output=logs/%x-%j.out
12
+ #SBATCH --error=logs/%x-%j.out
13
+
14
+ # Makron seed 1 (best on Norma validation; = Urdatorn/Makron-seed1) over the whole silver
15
+ # corpus Urdatorn/oga-macronized-no-norma @ 5d737f8, comparing every dichronon with the
16
+ # silver label (analysis/makron_oga.py). A 5,000-sentence smoke run goes first.
17
+
18
+ set -Eeuo pipefail
19
+ trap 'status=$?; printf "[%s] ERROR line=%s command=%q status=%s\n" "$(date --iso-8601=seconds)" "$LINENO" "$BASH_COMMAND" "$status"; exit "$status"' ERR
20
+ repo=/nobackup/proj/flash/dionysus/personal/cleland/oga-macronizer-char-code
21
+ data=/nobackup/proj/flash/dionysus/personal/cleland/oga-macronized-2026-11/final/data
22
+ out=/nobackup/proj/flash/dionysus/personal/cleland/oga-macronized-2026-11/makron-seed1-5d737f8
23
+ model=$repo/runs/final-v2/seed1/best
24
+ cd "$repo"; mkdir -p logs
25
+ stamp() { printf '[%s] %s\n' "$(date --iso-8601=seconds)" "$*"; }
26
+ stamp "job_start id=$SLURM_JOB_ID host=$(hostname) model=$model out=$out"
27
+ module purge; module load GPU/Python/3.13.5-bare-gcc-2025b-eb
28
+ nvidia-smi --query-gpu=name,memory.total --format=csv,noheader
29
+ export PYTHONUNBUFFERED=1 HF_HUB_CACHE="$repo/.cache/hf" HF_HUB_DISABLE_PROGRESS_BARS=1
30
+ py="$repo/.venv/bin/python"
31
+
32
+ smoke=$(mktemp -d "${SNIC_TMP:-/tmp}/makron-smoke.XXXX")
33
+ stamp "smoke run (5000 sentences) -> $smoke"
34
+ "$py" analysis/makron_oga.py --model_dir "$model" --data "$data" --out "$smoke" \
35
+ --limit 5000 --shard_rows 2500
36
+ head -5 "$smoke/changed_forms.tsv"
37
+
38
+ stamp "full run"
39
+ "$py" analysis/makron_oga.py --model_dir "$model" --data "$data" --out "$out"
40
+ stamp "top changed forms:"; head -30 "$out/changed_forms.tsv"
41
+ du -sh "$out"
42
+ stamp "job_complete"