On a like-for-like Llama 70B serving workload at on-demand list prices, Google Cloud's Trillium (TPU v6e) costs about $0.94 per million output tokens — and an AWS H100 costs about $0.91. A dead heat. But put Trillium on a three-year commitment and the same workload drops to $0.42 per million tokens, less than half the H100's price. Same silicon, same model, 55% cheaper — because on TPUs, how you buy the hardware matters as much as which hardware you buy.

This is GDE post #15, and it is the hardware-decision post for the whole TPU lane. GDE #8 covered the framework half — running vLLM on TPU, TorchTPU, XLA compile times, kernel gaps. This post covers the silicon underneath it: what a TPU actually is, what changes when you move inference from a GPU to a TPU, and the dollars-per-million-tokens arithmetic that decides which one wins for your workload. Every number below is recomputed in the companion notebook from Google Cloud's published price list (checked September–November 2026) and Qovery's October 2026 Llama 70B comparison.

A GPU is a flexible workshop: thousands of small workers that can each do almost any job, so it handles whatever code you throw at it. A TPU is an assembly line built for exactly one job — matrix multiplication. Its core, the Matrix Multiply Unit (MXU), is a systolic array: numbers flow through a grid of multipliers like parts down a conveyor belt, each one doing its multiply-add as the data passes, instead of fetching operands from memory for every operation. For the dense matmuls that dominate LLM inference, that conveyor belt is brutally efficient. For anything that isn't a dense matmul — a custom kernel, a weird activation, a sparse op — the assembly line stalls, and the flexible workshop wins.

That single trade-off explains nearly everything that follows: TPUs win when your workload is dense matmuls at large batch sizes on committed capacity. GPUs win when it is anything else.

Google's current lineup, from the published price list:

| Chip | Peak bf16 TFLOPS | HBM per chip | HBM bandwidth | Max pod | On-demand $/chip-hr | |---|---|---|---|---|---| | TPU v5e | 197 | 16 GB | 800 GB/s | 256 chips | $1.20 | | TPU v5p | 459 | 95 GiB | 2.77 TB/s | 8,960 chips | $4.20 | | Trillium (v6e) | 918 | 32 GB | 1.64 TB/s | 256 chips | $2.70 | | Ironwood (v7) | 2,307 (4,614 fp8) | 192 GiB | 7.37 TB/s | 9,216 chips | $12.00 | | NVIDIA H100 (AWS) | 989 | 80 GB | 3.35 TB/s | 8 GPUs/node | ~$6.88 |

Three things jump out. First, Trillium has nearly the H100's peak compute (918 vs 989 TFLOPS) at 39% of the hourly price — but only 32 GB of HBM against the H100's 80 GB, and half the memory bandwidth. Second, Ironwood is the generational jump: 6x Trillium's HBM and 2.5x its bf16 compute, priced at $12/hr. Third, v5p is the odd one: more memory (95 GiB) and a far bigger pod (8,960 chips) than Trillium, but less compute per dollar — it is a training chip that happens to serve, not a serving chip.

1. You compile; you don't write kernels. GPUs run CUDA kernels, and the ecosystem has spent a decade hand-optimizing them (FlashAttention, fused kernels, custom ops). TPUs run XLA: your model is compiled ahead of time into a static graph, and the compiler — not you — decides how the MXU is fed. The upside is that a compiled model runs at near-peak MXU utilization with no kernel-launch overhead. The price is static shapes: variable-length sequences get padded to the largest bucket, and every new shape triggers a recompile. GDE #8 measured the compile-cache effect directly — recompiles are the tax you pay for the assembly line.

2. The memory wall is the binding constraint. LLM decoding is memory-bandwidth-bound, not compute-bound: each generated token reads the whole model and the whole KV cache. So the number that caps your concurrency is HBM per chip, not TFLOPS. For an 8B GQA model at 4K-token sequences (128 KB of KV per token, FP8 weights), one chip holds about 16 concurrent sequences on v5e, 48 on Trillium, 174 on v5p, 368 on Ironwood, and 144 on an H100. v5e's 16 GB is so small that the model weights alone eat half of it. Trillium is 3x v5e's concurrency at 2.25x the price — a genuine improvement, but still a third of the H100's. Ironwood is the first TPU where memory stops being the story.

3. Prefill loves TPUs; decode is a negotiation. Prefill is compute-bound (big matmuls over the whole prompt), so the MXU shines and Trillium's $0.29/hr per 100 peak TFLOPS — the cheapest peak compute on the list — turns into real throughput. Decode is bandwidth-bound (one token at a time, streaming weights and KV), so HBM bandwidth and capacity decide, and the H100's 3.35 TB/s and 80 GB fight back. That is exactly why the measured Gemma 4 result from GDE #8 split the way it did: Trillium delivered 1.62–1.68x a v5e chip's throughput on workloads that fit in 16 GB, and 2.32–2.77x on workloads that didn't. The hardware that wins depends on which phase dominates your traffic.

4. Scale-out is a different machine. TPUs connect over Google's Inter-Chip Interconnect (ICI) into pods: 256 chips for v5e/Trillium, 8,960 for v5p, 9,216 for Ironwood. A pod is one machine from the compiler's point of view — no per-node networking code, no NCCL tuning. For serving, that matters less than for training, but it is why the largest dense deployments (Gemini serving, for example) sit on TPUs: the interconnect is part of the chip's design, not an afterthought.

5. You buy capacity, not servers. TPUs are priced per chip-hour including the host VM, sold as slices (v6e-1, v6e-8, and so on), with three discounts stacked on top of on-demand: Flex-start (dynamic work queues) at 50% off, 1-year commitments at 30% off, 3-year at 55% off. Trillium's $2.70/hr becomes $1.35 flex-start, $1.89 on one year, $1.22 on three years. GPUs on AWS are priced per instance-hour with their own reservation system, but the TPU discount ladder is steeper — and it is the whole reason the committed $/1M-token number ($0.42) is less than half the on-demand one ($0.94).

The Qovery comparison (October 2026, Llama 70B, on-demand list prices) is the cleanest head-to-head published: Trillium $0.94 vs H100 $0.91 per million output tokens. Neither chip is cheaper by default. The notebook turns that into the decision rule: cost per million tokens is just (chips × $/chip-hour) ÷ (tokens per hour) × 1M, so the winner is whoever sustains more tokens per dollar. An 8-chip Trillium host costs $21.60/hr on demand ($9.76/hr on a 3-year commitment), and either way it must sustain ~6,400 tokens/s across the host (~800 per chip) to hit its tier's $/1M figure — the commitment doesn't make the chip faster, it lowers the price at any fixed throughput by 55%.

And the trap to avoid: cheapest peak FLOPS is not cheapest tokens. Trillium is the cheapest peak compute on the list at $0.29/hr per 100 TFLOPS, against $0.52 for Ironwood, $0.61 for v5e, $0.70 for the H100, and $0.92 for v5p. But the third-party Gemma 4 measurement found Trillium's value vs v5e was only 0.73x when the workload fit in 16 GB — you pay 2.25x the chip-hour for 1.62–1.68x the throughput — and 1.13x when it didn't fit. FLOPS per dollar is a price tag; tokens per dollar is the bill.

| Workload | Pick | Why | |---|---|---| | Large-batch dense serving, committed capacity | Trillium / Ironwood | Cheapest $/token at scale; MXU utilization high; 55% commitment cut | | Small model that fits in 16 GB | v5e | $1.20/hr is the cheapest accelerator-hour Google sells; 0.73x value trap doesn't apply if you stay on v5e | | Prefill-heavy traffic (long prompts, RAG) | Trillium | Compute-bound phase, MXU at peak | | Custom kernels, sparse ops, new architectures | H100 / GPU | CUDA ecosystem; XLA recompile and kernel gaps bite | | Small batch / latency-sensitive decode | H100 | 80 GB HBM + 3.35 TB/s bandwidth; more KV headroom per chip | | Training at pod scale | v5p / Ironwood | 8,960–9,216-chip pods, ICI interconnect | | Bursty, unpredictable traffic | GPU spot / Flex-start TPU | On-demand TPU pricing punishes idle chips; flex-start halves it |

vllm-torchtpu is still experimental. Honesty note: prices are Google Cloud / AWS published list rates checked September–November 2026 and vary by region and commitment; the H100 figure is an AWS list price via Qovery, October 2026. The $0.94/$0.91/$0.42 per-million-token figures are Qovery's Llama 70B comparison, one workload, not a controlled A/B. Throughput thresholds in the notebook are arithmetic from list prices, not measured throughput. Gemma 4 throughput ratios are third-party measurements on one model and one output length — read them as shape, not delta. No excluded-vendor content, per the standing exclusion.

Companion notebook: the runnable tutorial for this post — download it here (open in Colab/Jupyter).

原文来源:dev.to