Skip to content

Cheatsheets

Chapters explain; these pages remind. Keep one open next to the code you are writing. Every page links back to the chapter or guide that explains each item.

Golden cheatsheet

A dense quick reference to the TorchTPU ecosystem, from TPU silicon to TorchTPU, TorchTitan, vLLM-TorchTPU, SGLang-TorchTPU and llm-d, organised by topic. Start at the Golden cheatsheet or the overview of the stack.

Page What it covers
Fundamentals TPU hardware, the ecosystem map, glossary, CUDA to TorchTPU translation
How it works Execution modes, memory, precision, dynamic shapes, collectives, disaggregated serving
Recipes Setup, idioms and Hugging Face, training, serving, llm-d, model blueprints
Diagnosis and evaluation Profiling, diagnostics, observability, trade-offs, validation gates
Extending the stack Custom kernels, compiler passes, plugins, end-to-end blueprints
Reference tables Environment variables, API matrix, llm-d API

Repositories

One page per repository: what it is, where things live, the entry points and commands you use, where to extend it and how to run its tests. File links go to the upstream repository.

Page Repository Taught in
torch_tpu The PyTorch backend for Cloud TPU Part I, API matrix
vllm-torchtpu vLLM platform plugin Chapter 18
sglang-torchtpu SGLang engine fork and TPU plugin Chapter 19
torchtitan TorchTitan with its TPU lane Chapter 14
tpu-agent-suite Agent skills, runtime and evals for TPU work Chapter 26

Quick reference

Printable pages, about one sheet each: dense tables and short rules. Print from the browser; navigation and the table of contents are left out.

Page What it covers From
Execution and recompiles Eager modes, host syncs, dynamic, buckets, catching recompiles Chapters 4, 7
Precision Matmul precision modes, excess precision, mixed precision, tolerances Chapter 6
Collectives Placements, ring cost formulas, mesh layout, tpu_dist launch and fusion modes Chapter 13
Serving flags vLLM-TorchTPU and SGLang-TorchTPU flags side by side, cache variables, sizing rules Chapters 18, 19
Profiling steps Capturing a trustworthy XProf trace and reading it in order Chapter 10

For runnable code, see Code; for complete tables of APIs and variables, see Reference.