A Cayley graph solver tackles the Professor Tetraminx competition: find the shortest solution for 1,000 scrambled puzzles, represented as 88-sticker states connected by 24 possible moves. The system combines beam search with a 3.4-million-parameter transformer that groups stickers into physical pieces and predicts the distance after each possible move. Training draws on random walks, exact labels from breadth-first search, and puzzle symmetries. The experiment tests whether Google’s native PyTorch backend for TPUs, TorchTPU, can match an A100 GPU training pipeline and a JAX TPU search implementation.
The central finding is that a working port is not necessarily an efficient one. The initial TPU training run was 1.65 times slower than the A100, and the first beam search was 5.7 times slower than JAX. Performance depended on fixed tensor shapes, avoiding data-dependent operations and host-device synchronization, enabling fused eager execution, and rewriting attention with einsum to reduce costly layout conversions. These changes brought training to roughly A100 speed, with comparable model quality. The optimized beam search ran 25% faster per level than JAX on the same eight-chip TPU and achieved the same total solution length across six puzzles. The work also exposed a deduplication bug and an attention-routing regression, prompting fixes through an upstream TorchTPU issue; a deferred-execution interaction with distributed checkpointing caused a separate deadlock.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.