From CUDA and Jax to TorchTPU: Lessons from a Cayley Graph Solver
Web page · https://andlukyane.com/blog/cayley-graphs-and-torchtpu
First seen by Oriel on .
AI summary
The post ports a Cayley graph puzzle solver to TorchTPU, showing that targeted training and beam-search optimizations can match A100 training and make beam search faster than JAX while exposing a deduplication bug and backend regression.
- Fused eager execution and an einsum attention rewrite reduced training time from 234.8 to 132.0 seconds per epoch on four v6e chips, compared with 142.7 seconds on an A100.
- On Kaggle’s eight-chip v5e-8, training ran at a median 142.4 seconds per epoch; its epoch-186 checkpoint matched the A100 epoch-200 checkpoint on exact-label accuracy.
- The fixed-shape PyTorch beam search distributes a 1M-wide beam by child hash, routes candidates with all_to_all_single, and stops at a depth-6 BFS table.
- A best-copy deduplication fix ensures duplicate states retain their lowest score; it added 0.5% overhead and reduced total moves on ten further puzzles from 319 to 302.
- The optimized TorchTPU beam search was 25% faster per level than JAX on eight v6e chips and produced the same total solution length across six test puzzles.
#torchtpu #pytorch #beam search #tpu
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Hacker News: 88, latest observation ; +82 over observed period since
Comments
Comment count reported by the source.
- Hacker News: 2, latest observation ; +2 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Hacker News | 50633424 | https://andlukyane.com/blog/cayley-graphs-and-torchtpu Read discussion |