Commit f604be6
committed
transformerless_lm: factor lazy data loading into shared lazy_data module
Per the user's call, lazy-loading is now the default for all new
experiments. Extracted from train_lazy_loading.py:
fib_positions_in_window(window) -> sorted Fibonacci positions ∈ [0, window)
get_fib_strided_batch(encoded, B, window, positions, gen) -> sparse batch
get_dense_batch(encoded, B, seq_len, gen) -> comparator only
Scaling at the IO axis:
window=128: 11 positions (11.6x reduction)
window=256: 13 positions (19.7x)
window=512: 14 positions (36.6x)
window=1024: 16 positions (64.0x)
Validated speedup (from results_lazy_loading.json): 1500 steps on
TinyShakespeare, dense 165.7s -> fib_strided 29.5s -> 5.62x wall-clock
speedup at +3.6% val loss vs dense.
The currently-running lazy_training bench (b: dense baseline + v1/v2/v3
lazy-training variants) is still using dense data because it is
testing lazy-TRAINING. After that finishes, all new benches default to
lazy_data.get_fib_strided_batch.1 parent 4770dc8 commit f604be6
1 file changed
Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
0 commit comments