← 返回技术雷达
Hacker News tech

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

Hacker News 热议:From CUDA and Jax to TorchTPU: Lessons from a Cayley Graph Solver(31 赞 / 0 评论,来源 andlukyane.com)

一句话概要

Moving a puzzle-solving transformer and its beam search from an A100 and JAX to TPUs with TorchTPU: what had to change, what broke, and how the final speed and quality compare.

原文开头节选

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.

Along the way, the investigation improved the solver itself and resulted in an upstream TorchTPU GitHub issue that led to attention-routing fixes.

(以上为原文节选,完整内容见下方”原文来源”)

这条动态今日登上 Hacker News 首页(31 赞 / 0 评论,来源 andlukyane.com)。技术雷达每日自动聚合 AI 工程、后端架构、DevOps 方向的前沿动态;相关工程落地可浏览下方的相关服务与延伸阅读,或直接与我们团队交流。

原文来源: Hacker News

相关服务