diff options
| author | Dylan <boss@tehbox.org> | 2026-11-09 16:38:13 +1300 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-11-09 16:38:13 +1300 |
| commit | 478e7568f5eda9780d1409bb8dccc86221126281 (patch) | |
| tree | 2f4ec7a90d0c65505b757bdce0ddd2f9778ccaa5 /plans.org | |
| parent | 0fd43eb6d9a4bae8d4c29fd614f9cf2a362f7b7c (diff) | |
| download | tigers-and-sheep-478e7568f5eda9780d1409bb8dccc86221126281.tar.gz tigers-and-sheep-478e7568f5eda9780d1409bb8dccc86221126281.zip | |
feat: Multi-threaded training; play matches every 10 generations
Gradients and losses are computed on rayon's pool in fixed-size chunks
summed in order, so the weights are the same on any number of threads.
Self-play uses the same pool, and the output shows the training time.
The matches against the earlier network and ClaudePlayer now run only
every --match-every generations (default 10), against the generation
that last played them, read back from its saved file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'plans.org')
| -rw-r--r-- | plans.org | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -81,6 +81,20 @@ Before the fix, tigers won ~97% of self-play games and the net only reached ~15- *** Next candidates - Pick exploratory moves among near-best ones (softmax over root scores) rather than uniformly - Sheep are still the weaker side: report the match score for each side separately +** DONE Multi-threaded training steps +=gradient= and =loss= run on rayon's pool in fixed chunks (32 samples per gradient task), summed +in order, so 1 thread and 16 give byte-identical weights. Self-play's =parallel()= uses the same pool. +=train 4 500= from random weights, 16 cores, hpet clocksource, training part of each generation (s): +| Gen | Samples | Before | After | +|-----+---------+--------+-------| +| 1 | 15112 | 0.09 | 0.03 | +| 2 | 29658 | 0.17 | 0.06 | +| 3 | 43748 | 0.27 | 0.09 | +| 4 | 57978 | 0.35 | 0.13 | +- About 2.7x, not 16x: a 256-sample batch is only 8 chunks, and the chunks' gradients are added + up serially. Training was only ~15% of a ~2 s generation, so the whole generation is ~10% faster. +*** Next candidates +- Bigger batches (or smaller chunks) for more parallel tasks per step; reuse the per-chunk gradient buffers ** DONE Balance tiger-win and sheep-win positions The unbalanced net (gen 100) had 7x the error on positions from sheep-win games (0.045) as on tiger-win ones (0.0065), so it leaned towards tiger wins, though not a constant prediction (that |
