Menu

1 / 3

The TorchTPU Book: A Free Guide to PyTorch on Cloud TPU, With Numbers You Can Check

DEV Community: pytorch·Omotayo Aina·4 days ago
#7D4cytwg
Long article (1820 words) — no AI summary yet.
Reading 0:00
15s threshold

The TorchTPU Book is a free online book for PyTorch engineers who move real models from CUDA to Cloud TPU and need to know when the numbers they get are correct and real.

TorchTPU is an open-source, native PyTorch backend for Google Cloud TPUs, built by Google together with the PyTorch team at Meta.

The problem: it runs, and that is all you know

You change torch.device("cuda") to torch.device("tpu") and backend="nccl" to backend="tpu_dist" . The model runs. The TorchTPU authors are explicit about what that does not give you: peak TPU performance, because your shapes, sharding and operators may be tuned for a GPU.

Notice the two arrows into TorchTPU, one for each string you changed: operations on the "tpu" device reach it through the dispatcher, and "tpu_dist" collectives through the ProcessGroup API.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.