Remix.run Logo
▲ Google open-sources TorchTPU, a native PyTorch back end for TPUs(github.com)
149 points by ilreb 3 hours ago | 41 comments
▲pcmoritz an hour ago | parent | next [-]

For people interested in this: I've been working on an open-source libtpu implementation for https://tenstorrent.com/ accelerators as a side project, it can already run most of torchtpu, see https://github.com/pcmoritz/libtt (based on the tenstorrent software stack). It shows all the things involved in lowering torch to tile based accelerators.

▲asparagui 39 minutes ago | parent | next [-]

Very cool! I have been using Lean to drive PJRT like so: https://github.com/brettkoonce/lean4-mlir and in theory your code could unlock another platform!

▲pcmoritz 35 minutes ago | parent [-]

Thanks for sharing, this is super cool! Right now my approach to correctness it to just run as many tests as possible and fix them (torchtpu greatly expands the amount of available tests), but formal verification is also super cool. Having a look at your book https://lean.brettkoonce.com/blueprint.pdf

The Tenstorrent ISA is documented btw https://github.com/tenstorrent/tt-isa-documentation, I wonder if one could do the verification end-to-end with the hardware.

▲yhjc2692 42 minutes ago | parent | prev [-]

This is super cool!

▲pcmoritz 39 minutes ago | parent [-]

Thanks for the encouragement, if you have the hardware and end up trying it out I'd love to get your feedback (feel free to drop an issue in the repo) :)

▲yhjc2692 35 minutes ago | parent [-]

I would love to do that, but unfortunately don’t have one on hand (yet?). In fact, I’m curious - did you buy a TT device to work on this, or are you using a cloud provider like Koyeb?

▲pcmoritz 31 minutes ago | parent [-]

I first built my own to try it out (the exact hardware is described in https://relativity.cc/hardware/ under "one Blackhole card") and when I liked the hardware I got a quietbox 2. It is very high quality but a little expensive (but inexpensive compared to other LLM hardware and it has excellent interconnects which nobody else in the consumer/dev space has).

▲npalli 3 hours ago | parent | prev | next [-]

Interesting, Amazon doing the same for AWS Trainium.

https://github.com/aws-neuron/torch-neuronx

▲AnotherGoodName an hour ago | parent [-]

Pytorch conference is happening today for explaining the coincidental timing

▲sroussey an hour ago | parent [-]

That explains the 5x speed increases huggingface mentioned for Mac using metal.

▲nico 9 minutes ago | parent | prev | next [-]

Pardon my ignorance, but who else besides Google has TPUs? Are they commercially available somewhere? What’s their main application right now outside of Google?

▲ismailmaj 24 minutes ago | parent | prev | next [-]

Amazing news, I remember the days when you had to fight XLA to make PyTorch run on TPUs, it seems we finally got first-party support!

Since HW specifics live mostly in the kernel layer (Pallas or CUDA), I imagine the Jax vs PyTorch question is more of a style preference now?

▲fancyfredbot an hour ago | parent | prev | next [-]

Cool! XLA is pretty good + potentially a better compiler infrastructure than inductor which will lead to improved performance on all hardware.

Also I guess this is the final nail in the coffin of Tensorflow.

▲tuna74 14 minutes ago | parent | prev | next [-]

Is the Linux driver available?

▲Lucasoato 3 hours ago | parent | prev | next [-]

Are there TPUs outside Google Cloud?

▲boulos 3 hours ago | parent | next [-]

Yes. Google is famously selling TPUs on prem to big customers (e.g., Anthropic) and Crux AI is now a venture to do just that.

▲goda90 2 hours ago | parent | prev | next [-]

Maybe just marketing, but they call the NPUs in their Pixel phones "TPUs"

▲sschueller 3 hours ago | parent | prev | next [-]

Google coral USB and m.2 devices are TPUs.

▲Archit3ch an hour ago | parent | next [-]

"Have you seen any software run on Coral TPUs?"

"No, but I have seen the house that the project built, and it is terrific." ~ some Google director

▲boulos 3 hours ago | parent | prev [-]

Only in marketing name. They're not related otherwise.

▲westurner 3 hours ago | parent | prev [-]

TPU / neural compute accelerator / Math coprocessor;

"OpenTPU: Open-Source Reimplementation of Google Tensor Processing Unit (TPU)" https://news.ycombinator.com/item?id=44111452

From https://news.ycombinator.com/item?id=45848676 :

> How does Cerebras WSE-3 with 44GB of 'L2' on-chip SRAM compare to Google's TPUs, Tesla's TPUs, NorthPole, Groq LPU, Tenstorrent's, and AMD's NPU designs?

There are TPUs made out of silicon carbide with standard fab.

There is in-flight tensor processing with photons, but that's not quite a TPU.

▲hackernudes 2 hours ago | parent [-]

I think the commenter was asking if Google sells TPU chip hardware to use outside of Google's own infrastructure and cloud.

▲nelaggy 2 hours ago | parent | prev | next [-]

so if the moat isn't the model and the moat isn't the inference layer, i guess the moat is the hardware now? what does this mean for frontier labs?

▲badrequest 2 hours ago | parent | next [-]

hardware has always been the moat in the AI space

▲AnotherGoodName 28 minutes ago | parent | next [-]

Yeah a lot of people bought into the idea of CUDA being a moat but we’re well past the point where it’s pretty trivial to jump to another equivalent stack on the software side.

▲jacquesm 13 minutes ago | parent [-]

Those are the two main interfaces: the inference hardware and the endpoints. Endpoints are pretty much standardized to the point that you can switch them out in seconds. CUDA still has an edge but every release like this chips away at that. Even so, TPUs are unobtanium so while I appreciate Google's effort here I also recognize that it is not something that will be useful to me.

In that sense AMD is still better positioned to give NVidia a run for their money but given the family connection and AMD's underdog status I am not very hopeful that we'll see meaningful competition in inference hardware any time soon.

NVidia is a much harder nut to crack than OpenAI or Anthropic. They are easily a decade ahead of viable competition. Check out the GB300 if you don't believe that.

▲AndrewKemendo 40 minutes ago | parent | prev [-]

Will always be true

▲JacobAsmuth 2 hours ago | parent | prev [-]

Products can also be a moat.

▲23agt 2 hours ago | parent | prev | next [-]

Google is selling TPU shovels via Cloud services and also physically to select partners. So this makes sense.

There will be an abundance of shovels. Nebius already crashed by almost half from its hype peak.

▲airza 2 hours ago | parent [-]

it doesn't seem like there's an abundance of shovels coming anytime soon

▲yipinwong 3 hours ago | parent | prev [-]

Dumb question from non-AI engineer.

Is this somehow Google's answer to today's best DeepSeek open-sourcing inferencing engine?

▲bitpush 2 hours ago | parent | next [-]

I dont think big companies like Google react to news like that. Very likely this was meant to go out on Tuesday for weeks now. And it just happened to have coincided with another news.

▲JacobAsmuth 2 hours ago | parent | prev | next [-]

Yeah they read the news this morning and whipped up a quick Torch->XLA translation layer and coordinated with four different inference engines (who also all wrote their own blog posts) and shoved this out the door quick to stay on top of the news cycle

▲parthdesai 2 hours ago | parent | next [-]

Why be rude on purpose? OP clearly prefaced by saying it was a dumb question

▲caaqil an hour ago | parent [-]

Welcome to the internet, great to have you here.

▲mathisfun123 2 hours ago | parent | prev [-]

they're releasing this today because the pytorch conf is this week...

▲geremiiah an hour ago | parent | prev | next [-]

No, these are two very different objectives.

▲Tanjreeve 2 hours ago | parent | prev | next [-]

They do different things and sit in different parts of the stack (training vs inference). TorchTPU seems more like a play to get more people familiar with Googles TPU chips as they want to sell them to people outside of google.

▲beardedetim an hour ago | parent [-]

Yeah I'd assume this is to allow us to train on their TPUs with torch instead of needing to rent a GPU

▲yipinwong an hour ago | parent [-]

ty. that helps a lot and know where to research next.

▲mathisfun123 2 hours ago | parent | prev [-]

lol no this is a replacement for https://github.com/pytorch/xla