TorchTPU beats JAX by 25% in beam search after a painful port

From CUDA and Jax to TorchTPU: Lessons from a Cayley Graph Solver

TorchTPU beats JAX by 25% in beam search after a painful port

Google's new native PyTorch backend for TPUs was easy to install but hard to make fast. The first training port ran 1.65x slower than an A100, and the initial beam search was 5.7x slower than JAX. After enabling fused eager, rewriting attention with einsum to dodge SDPA layout conversions, eliminating dynamic shapes, and fixing a checkpoint deadlock, training matched the A100 and the optimized beam search ran 25% faster per level than JAX on the same eight-chip v6e machine.

The short version: getting TorchTPU to work was easy; getting it to work efficiently was considerably harder.

More from this day

2026-11-24