"""Paths, pinned inputs, and durable records for auto-200m-2 (ModernBERT-base student) inside the temporary job.""" import hashlib import json import os from pathlib import Path import time JOB = Path(os.environ.get('JOB_ROOT', '/job')) ROOT = JOB/'work'/'src' DATA = JOB/'work'/'data' CKPT = JOB/'work'/'ckpt' LOG = JOB/'logs'/'auto200m2' EXPORT = JOB/'export' BASE = ('answerdotai/ModernBERT-base', 'model', '8949b909ec900327062f0ebf497f51aef5e6f0c8') REFERENCE = ('ProCreations/auto-0.4b-2', 'model', '5937dd0162a9dd564a07c812b65012681daae3fd') DATASET = ('ProCreations/auto-1b-data', 'dataset', 'd265bbf7bac76cd55daaf81a1d185dfe089a412b') BENCHMARK = ('ProCreations/approve-or-deny', 'dataset', 'a38b625913dd46ca9702063f1597c979e6ace34e') # Archived Auto 3B (private SmolLM3-3B classifier, 98.03% on the benchmark) logits; mounted read-only. TEACHER_SHA = '314b5711a812b67b8e01568e3605ca5eda94464ef8a5d72f5061c066b7b598e8' TEACHER_LOGITS = Path('/mnt/models-backup/Models/Auto/auto04-kd-mixed/original/data') AUG = Path('/mnt/models-backup/Models/Auto/auto04-iteration-1/data') AUG_LOGITS_SHA = 'aace8ec7b81715c7190c7a431968ba7c2bc8663167a52fbc3b7038d8bb148969' ATTENTION = 'kernels-community/flash-attn2@81fb77c12b2ad5d69380669b46739d5868614502' SEED = 20260925 MAX_LEN = 65536 RUN_NAME = os.environ.get('AUTO_RUN_NAME', 'main') def sha(path): h = hashlib.sha256() with Path(path).open('rb') as f: for chunk in iter(lambda: f.read(8*1024*1024), b''): h.update(chunk) return h.hexdigest() def atomic_json(path, value): path = Path(path); path.parent.mkdir(parents=True, exist_ok=True) tmp = path.with_name(path.name + '.tmp') tmp.write_text(json.dumps(value, indent=2, ensure_ascii=False, allow_nan=False) + '\n') tmp.replace(path) def event(kind, **kwargs): item = {'event': kind, 'time': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()), 'run': RUN_NAME, **kwargs} print(json.dumps(item, allow_nan=False), flush=True) LOG.mkdir(parents=True, exist_ok=True) with (LOG/'events.jsonl').open('a') as f: f.write(json.dumps(item, allow_nan=False) + '\n') atomic_json(LOG/f'status-{RUN_NAME}.json', item) def sources(): return json.loads((DATA/'sources.json').read_text()) def plan(): return json.loads((ROOT/'plan.json').read_text()) def init_path(): return DATA/'init'