Porting a transformer solver from A100/JAX to TorchTPU: beam search ends up 25% faster than JAX
AndLukyane · x · 2026-11-25
Andrey Lukyanenko ported his Cayley-graph puzzle solver to Google's new TorchTPU (native PyTorch backend for TPUs). First port: training 1.65x slower than A100, beam search 5.7x slower than JAX. After optimizing eager execution, rewriting attention, eliminating dynamic shapes, fixing a dedup bug and an attention-routing regression, training matched A100 (142.7s → 132.0s per epoch, via fused eager + einsum attention) and TorchTPU beam search became 25% faster per level than JAX on the same v6e-8 machine, with equal solution quality. Findings led to upstream TorchTPU attention-routing fixes. All code was written by Claude Code and Codex; notebooks run free on Kaggle TPU v5e-8.
More from Infra
- local-ai-harness Runs 768B DeepSeek-V4.1-Flash at 1M Context on a Single Strix Halo — stereohype · 2026-11-25
- First SGLang Summit draws 2,000+, launches v1.0 and consortium with Nvidia, Google, Meta — ying11231 · 2026-11-25
- Starcloud explains how space data centers shed chip heat: infrared radiators emitting 800W per square meter — ycombinator · 2026-11-25
- Microsoft AI open-sources details of Rocket, its in-house RL infrastructure now post-training MAI Base 2 — mustafasuleyman · 2026-11-25
- DreamcatcherAI serves Kimi K3.1 Pro on Tenstorrent cards, adds 256 more units — DavidBennett__ · 2026-11-25
- Redwood Materials builds off-grid data center power from old EV batteries and solar panels — Sethwinterroth · 2026-11-25