v0.1.3 — Resumable tokenisation cache
Status: superseded by v0.1.4.
Version source: historical pyproject.toml state (version = "0.1.3").
What changed
Non-architectural data-pipeline durability. A prior training attempt died mid-tokenisation and lost all tokenisation work on restart; this release persists each tokenisation stage to data/cache/ every 30 minutes of wall time.
- Cache identity helpers.
_tokenizer_sha(tokenizer)invalidates downstream caches whenever tokenizer JSON changes._texts_fingerprint(texts)and_raw_ds_fingerprint(raw_ds)catch input-content changes. - Atomic cache IO.
_load_cache/_save_cacheuse tmp-rename writes aroundtorch.save/torch.load, withHeartbeatcoverage for multi-GB IO. - Tokenizer cache.
data/cache/tokenizer.jsonis reused when its vocab size matchesVOCAB_SIZE; retraining changestok_shaand invalidates downstream caches. - Pretrain cache.
pretrain_all_ids.ptstores the concatenated token stream incrementally, andpretrain_samples.ptstores the final chunked samples. - SFT cache.
sft_samples.ptstores resumable(ids, mask)samples keyed by tokenizer SHA,max_len,limit, and raw data fingerprint. - DPO cache.
dpo_pairs.ptstores resumable(ci, cm, ri, rm)preference tuples with the same keying scheme. - Graceful degradation. Disk-full or permission errors are logged; tokenisation continues in memory if caching is unavailable.
Notes
data/cache/ inherits the existing data/ gitignore entry, so cache files stay out of commits.