1 hour ago · 19 min read3741 words · Tech · hide

From CUDA and JAX to TorchTPU: Lessons from a Cayley Graph Solver Some time ago I shared a blog post about working with Cayley graphs, where I solved combinatorial puzzles using AI coding agents, PyTorch on GPUs, and JAX on TPUs. Recently, Google released TorchTPU, a native PyTorch backend for TPUs, and I wanted to see how well it works on the same task: whether a PyTorch-native TPU stack could match my A100 training pipeline and my JAX beam search in speed and solution quality, or maybe even beat them. The short version: getting TorchTPU to work was easy; getting it to work efficiently was considerably harder. My initial training port was 1.65x slower than the A100 implementation, while the first TPU beam search was 5.7x slower than its JAX counterpart. After optimizing eager execution, rewriting attention, eliminating dynamic tensor shapes, fixing a subtle deduplication bug, and investigating an attention-routing regression, the results changed substantially. Training reached…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town