Porting nanochat to a TPU: what carries over from PyTorch, and what breaks

He got the chatbot running on Google’s chips, but the comments went straight for the writing

TLDR: A developer successfully moved a popular DIY chatbot project from Nvidia machines to Google TPUs, matching the chatbot’s quality but not its speed. Commenters mostly ignored the benchmark drama and fixated on a spicier question: whether the whole post itself was written by AI.

A developer pulled off a genuinely impressive stunt: taking Andrej Karpathy’s budget-friendly chatbot project — the one famous for making your own AI helper in just a few hours for around $100 on Nvidia hardware — and getting it to run on Google’s TPU chips instead. The big win? The chatbot’s quality held up, even slightly beating the usual score range. The less glamorous part: it was slower than hoped, so the victory lap came with a limp. In plain English, the experiment proved the model could survive the move, but not without some performance pain.

But in true internet fashion, the crowd didn’t just debate the engineering — they started side-eyeing the writing itself. One commenter called a tricky bug “sneaky,” relating to their own battle with Apple’s MLX tools, which gave the post some solidarity-from-the-trenches energy. Then the mood swerved hard: multiple readers accused the article of sounding AI-generated, with one saying they felt “weird” reading it and another bluntly calling it “embarrassing.” Ouch. That instantly became the real popcorn moment: not “Can TPUs run this chatbot?” but “Did AI write the explanation of the AI?”

So yes, there’s a real story here about cheaper, alternative AI hardware and whether it can challenge Nvidia’s dominance. But the comments turned it into a mini-drama about authenticity, style, and whether engineers can sniff out machine-written prose on sight. One person said “nice,” which honestly may be the calmest take on the entire internet.

Key Points

  • The article documents a JAX port of nanochat to a TPU v6e-8 system while trying to keep configuration and architecture close to the original PyTorch implementation.
  • The reproduced d24/R4 run achieved a CORE score of 0.2695, slightly above the 0.2512–0.2677 score band reported from seven official nanochat runs of the same recipe.
  • Training performance on the TPU remains below the original H100 setup, with reported MFU of about 24% for d24 versus 47–48% reported on H100 for d20.
  • The nanochat-jax reproduction covered base model training and supervised fine-tuning, but not the reinforcement learning stage included in upstream nanochat.
  • The article attributes part of TPU efficiency behavior to v6e hardware characteristics, including 256×256 matrix units that cause XLA padding when tensor dimensions are not multiples of 256.

Hottest takes

"This entire text is AI generated" — adityashankar
"entirely generated with very little tweaks" — konradha
"that's a sneaky one" — sciences44
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.