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

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

> Hacker News story 50633424 · language: en · submitted 2026-11-24
> Web version: https://zeli.app/story/50633424
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 77 · by [Artgor](<https://news.ycombinator.com/user?id=Artgor>) · 💬 1
[original](<https://andlukyane.com/blog/cayley-graphs-and-torchtpu>) · [HN discussion](<https://news.ycombinator.com/item?id=50633424>)

## Summary

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.

## Key quote

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

---

## Cite

- Page: https://zeli.app/story/50633424
- Date: 2026-11-24
- Source: andlukyane.com (https://andlukyane.com/blog/cayley-graphs-and-torchtpu)
- Hacker News: https://news.ycombinator.com/item?id=50633424

## Other languages

- zh: https://zeli.app/zh/story/50633424 · markdown: https://zeli.app/zh/story/50633424.md
- ja: https://zeli.app/ja/story/50633424 · markdown: https://zeli.app/ja/story/50633424.md
- ko: https://zeli.app/ko/story/50633424 · markdown: https://zeli.app/ko/story/50633424.md
- de: https://zeli.app/de/story/50633424 · markdown: https://zeli.app/de/story/50633424.md
- es: https://zeli.app/es/story/50633424 · markdown: https://zeli.app/es/story/50633424.md
- ru: https://zeli.app/ru/story/50633424 · markdown: https://zeli.app/ru/story/50633424.md
