Day 10 - The Map Unfolded: torch.compile, TVM, XLA, and TensorRT

July 19, 2026 (3w ago)

Four real systems over one shared skeleton: capture, graph optimization, kernel acquisition, runtime

Nine days of concepts; the last post is for meeting the cast.

Day 3 ended with a set of coordinates: for any tool, ask three questions. Where does it capture? Which moves does it apply? Whom does it generate code for? This post runs four of the most representative systems through those questions. You will find them strikingly isomorphic: all built on the same skeleton of "capture → graph optimization → get kernels → runtime", differing in what fills each segment.

torch.compile: The Compiler That Coexists with Eager

PyTorch's official compilation path, designed around one philosophy: do not disturb. One line, torch.compile(model), everything else unchanged.

One-line identity: the master of compromise. It does not try to swallow the whole graph; it compiles what it can inside a dynamic Python world, with eager always there as the safety net.

TVM: The Open Stack with Every Layer Exposed

Apache TVM is a complete compilation stack with academic roots, and nearly every concept in this series has a named component inside it.

One-line identity: hardware breadth first. When the target is not an A100 but some phone SoC or a startup's accelerator, an open stack like TVM is often the only road.

XLA: The Fusion Machine of the Static World

XLA is Google's compiler; every JAX jit runs on it, and the TPU is its home turf.

One-line identity: constraints traded for performance. It demands the most from its users (pure functions, stable shapes) and is exactly why it can optimize the hardest.

TensorRT: The Closed but Ruthless Vendor Road

The other three generate kernels; TensorRT walks a different road: it selects them.

One-line identity: squeezing one vendor's hardware to the limit. In production that runs NVIDIA only and wants the last ten percent, it is often the answer.

One Skeleton, Four Temperaments

Side by side, the differences collapse onto four axes:

Nobody wins everywhere; there are only pairings of tool to scenario: research iteration wants flexibility, torch.compile; non-mainstream hardware, TVM; JAX on TPUs, XLA; the last ten percent on NVIDIA, TensorRT.

Closing the Series

Three questions, the whole series distilled

Ten days, and the map is fully unfolded. Looking back: Day 1 posed the problem (movement and wasted work), Day 2 drew the layers, Day 3 named the four moves, Day 4 handed over the ruler, Days 5 through 9 dug into the moves one by one (fusion, scheduling, search, dynamic shapes, quantization), and Day 10 pinned the concepts onto real systems.

From here on, facing any new tool, new paper, or new hardware launch, you carry the same set of questions: where does it capture? Which moves does it apply? Whom does it generate code for? Is the bottleneck movement or compute? The answers may not come immediately, but asking the right questions already puts you on the map.

That closes this series. Next up is a new one that digs into torch.compile itself, from Dynamo through AOTAutograd down to Inductor, tracing what each stage actually does.