groundy
Infrastructure & Runtime

Gemma 4 31B on Cloud TPU vs GPU: The Serving Cost Crossover Point

TPU v6e Flex-start delivers 308M prefill tokens per dollar for Gemma 4 31B, undercutting H100 rates, though the community benchmark leaves decode cost unmeasured.

Published Updated 10 references
On this page8 sections

A community benchmark on Google’s Trillium TPU v6e reports 463,345 tok/s of peak prefill for Gemma 4 31B on a v6e-4 pod, which works out to roughly 309 million prefill tokens per dollar at Google’s published Flex-start rate of $1.35/chip-hr. If production decode tracked prefill, that number would end the GPU-default assumption for open-weight serving. It does not track it, and the useful question is where the real crossover sits. That question now has computed answers, because both sides have published numbers: a direct Gemma 4 31B row in a GPU benchmark, list TPU pricing, and a serving study that measures this exact model on v6e against an H100 baseline.

The GPU baseline: H100 cost context for 30B-class inference

Spheron’s 2026 cross-GPU benchmark carries a direct Gemma 4 31B row: on a single H100 SXM5 at $2.90/hr, with rates recorded 18 April 2026, it sustains 3,100 tok/s for $0.26 per million tokens. The model’s 62 GB of FP16 weights fit one 80 GB card with no tensor parallelism, per the same benchmark. No proxy model is needed anymore.

The April rates are already stale, and this time in the TPU’s favor: Spheron’s own on-demand H100 rate reads $3.96/hr as of 14 November 2026, and the GetDeploying index puts the on-demand median at $4.00/GPU-hr across the 46 providers with a priced on-demand config (the index tracks 63 providers in total), up roughly 12% over 90 days, with a spot median of $2.46 and the cheapest listed on-demand config at $1.80. At Spheron’s measured 3,100 tok/s, a $4.00 hour implies about $0.36/M tokens.

The operative phrase is still “at full batch.” Spheron’s batch-size sweep for Llama 3.3 70B on 8x H100 shows cost per million tokens moving from roughly $258 at batch 1 to $2.30 at batch 256 (FP16, April rates). Production serving rarely sustains batch-256 concurrency, so real cost per token sits above the headline, and the gap widens as traffic thins.

TPU v6e Flex-start: 308M prefill tokens per dollar, at list rates

Flex-start is not a v6e-specific promotion. It is a provisioning tier of Google’s Dynamic Workload Scheduler, billed on usage the same way on-demand instances are; DWS’s other tier, Calendar mode, ties capacity to a reservation at a higher per-chip rate ($1.89 for Trillium). Google’s price list puts v6e Flex-start at $1.35/chip-hr against $2.70 on-demand in us-east1 (Tokyo lists at $3.24 on-demand), so a v6e-4 pod costs $5.40/hr on Flex-start and $10.80/hr on-demand. A single community submission to Google’s Gemma 4 Challenge, run on an rc/dev build of vLLM v0.20.2, reported:

  • Peak prefill throughput: 463,345 tok/s at concurrency 256
  • Time-to-first-token: 0.55s at concurrency 1
  • Stated Flex-start rate: ~$0.40/hr for the pod
  • Claimed cost efficiency: ~308 million tokens per dollar at peak (benchmark author’s figure)

The stated hourly rate and the efficiency claim contradict each other, and the efficiency claim is the one that checks out. 463,345 tok/s is about 1.67 billion tokens per hour; dividing by 308 million tokens per dollar implies a pod cost of roughly $5.42/hr, almost exactly the $5.40/hr that Google’s published Flex-start rate produces for four chips. The practical upshot is better than the original framing: the ~308M tokens-per-dollar headline holds at published list rates rather than resting on an unsourced discount, while the $0.40/hr figure in the post looks like a transcription error.

Two structural caveats remain:

  1. Flex-start’s scheduling terms live outside the pricing page. The DWS page prices the tiers and describes how each bills, but it states no availability guarantee, run-length limit, or preemption terms for Flex-start; that detail sits in the DWS provisioning documentation, not the price list. The unreserved on-demand price for the same pod is double at $10.80/hr. Budget the crossover both ways before quoting either to finance.
  2. 463K tok/s is prefill throughput, not generation. Prefill measures prompt ingestion speed; production autoregressive decode is sequential per token and typically an order of magnitude slower. The benchmark does not report decode throughput, so 308M tokens per dollar cannot be applied directly to production CPM.

For comparison, Spheron’s Gemma 4 31B row on one H100 works out to about 3.8M tokens per dollar at April rates and 2.8M at a $4.00 median hour. Against 308M the raw ratio is roughly 80x at April rates and about 110x at the median, but the two numbers measure different things: Spheron reports sustained batch throughput (prefill plus decode), while the TPU figure is pure prefill.

Earlier TPU generations: v5e and v5p context

The v6e numbers are not an isolated data point. Easecloud’s TPU v5p analysis reports 7B-class inference at $1.08/M tokens on v5e versus $3.82/M on a single A100, which their monthly math calls a 56% saving. On Google’s current price list, v5e runs $1.20/chip-hr on-demand in most US regions with Flex-start at $0.60; v5p lists at $4.20/chip-hr on-demand, $2.10 Flex-start, and $1.89 on a three-year commitment. Easecloud’s per-chip table adds spot/preemptible v5p at $1.26/chip-hr, a 70% discount to list, while their own summary quotes the same discount as moving costs “from $4.00/hour to $1.20/hour” for a v5p-8 pod, rates that match neither their per-chip table nor Google’s list. When unit-matching against their benchmarks, use the per-chip table, not the prose rates.

On the GPU side, Spheron recorded H100 on-demand at $2.90/hr in April 2026. Seven months later the on-demand median across the providers GetDeploying prices is $4.00 and Spheron itself charges $3.96, so the April baseline now reads low rather than high. The lesson is directional, not numerical: hourly rates moved double-digit percentages inside seven months, and any crossover computed against a stale rate is a fiction. Recompute against the rate you can actually buy.

The trend through Trillium is consistent: v6e at $2.70/chip-hr lists about a third below the $4.00 median H100 hour, before the Flex-start halving. Ironwood, discussed next, is where the pattern breaks.

TPU v7 Ironwood: list pricing is out, and it is not aimed at 31B models

Any v6e-versus-H100 cost model has a dating problem, and it now has hard numbers attached. Google announced Ironwood, its seventh-generation TPU and the first designed specifically for inference, at Cloud Next in April 2025 with availability later that year; by November 2026 it carries list pricing. Per Google’s published rates, Ironwood is $12.00/chip-hr on-demand in us-central1 ($13.20 in London), $6.00 Flex-start, $8.40 on a one-year commitment, and $5.40 on three years. Per-chip specs from the announcement: 4,614 TFLOPs FP8 peak, 192 GB of HBM (6x Trillium), 7.37 TB/s of HBM bandwidth (4.5x Trillium), and 2x perf/watt, with pods scaling to 9,216 chips.

For Gemma 4 31B the arithmetic is unforgiving. Ironwood costs 4.4x Trillium’s rate per chip on both tiers ($12.00 versus $2.70 on-demand, $6.00 versus $1.35 Flex-start), and 62 GB of FP16 weights that fit a single H100 have no use for 192 GB of HBM per chip. Google’s Cloud blog claims “more than 4X better performance per chip for both training and inference workloads compared to TPU v6e”, which even at face value sits at or below the price multiple, and it is a vendor peak claim rather than a measured 31B serving result. Unless per-chip serving throughput for a 30B dense model rises by more than 4.4x, the per-token crossover moves away from the TPU, not toward it. Ironwood’s pricing targets models that genuinely saturate the part, and Google’s launch material points the same direction: Anthropic states plans to access up to one million TPUs, which says where early supply goes.

Two adjacent moves do matter for smaller tenants. The vLLM TPU stack now ships v7x (Ironwood) recipes alongside v6e, and Google’s Cloud blog claims its GKE Inference Gateway cuts time-to-first-token by up to 96% and serving costs by up to 30% across TPU servers. Both are vendor claims. For this model size, the v6e-versus-H100 comparison remains the live one.

Dense vs MoE: the 26B sibling may be the real winner

Gemma 4 31B is a dense model: 30.7B parameters across 60 layers, figures carried by the arXiv serving study and GetDeploying’s H100 model-fit table. Its Mixture-of-Experts sibling, the Gemma 4 26B, activates only 3.8B of its 26B total parameters per token, per the benchmark’s comparison table.

On the same v6e-4 hardware, the community benchmark reports the dense 31B edges out the 26B MoE in peak prefill (463K vs ~457K tok/s) and in low-load latency (0.314s TTFT at concurrency 1 on 128-token inputs, against the MoE’s sub-1.2s interactive figure). But the MoE achieves comparable peak throughput with 7.5x less compute per token. In serving terms, the MoE handles more concurrent requests at the same hardware budget, or matches throughput on cheaper silicon. The same benchmark notes the MoE’s shared KV cache scales to a 256K context window while the dense stack was tested to 16K.

What the benchmark does not settle is quality. The hardware case for the MoE is one-sided if its outputs are close enough for your workload, and no throughput number can make that call; it needs an evaluation against your own traffic before you commit serving to it.

One more anchor on all of these numbers: they come from a single runtime, vLLM v0.20.2rc1.dev111+g8eb401134 (an rc/dev build of the v0.20.2 line) on the v2-alpha-tpuv6e image, per the benchmark’s deployment overview. A cost model built on them inherits that build’s scheduling and kernel behavior, so re-benchmark when the serving stack moves.

MetricGemma 4 31B (dense)Gemma 4 26B (MoE)
Total params30.7B26B
Active params/token30.7B3.8B
Peak prefill (v6e-4)463K tok/s~457K tok/s
Compute per token (relative)1x7.5x lower
Max context (benchmark)64K, tested to 16K256K (shared KV cache)
TTFT at low load0.314s (C1, 128 tokens)under 1.2s (interactive)

Sources: dev.to community benchmark, arXiv serving study, GetDeploying H100 index

Hidden costs: JAX migration, kernel maturity, and the prefill-decode gap

The throughput numbers tell one story. The operational economics tell another.

JAX conversion overhead. Easecloud’s analysis estimates 1-3 days of engineering time to port a generic PyTorch model to JAX for TPU deployment. The Gemma 4 TPU paper reports the first-pass cost for this exact model: roughly a week for mesh configuration, sharding annotation fixes, a custom data pipeline, and checkpoint conversion, which the authors describe as a one-time cost amortized across runs. For teams with deep CUDA investments (custom kernels, Triton ops, vLLM plugin chains), the migration tax is real.

vLLM TPU support. The benchmark uses an rc/dev build of vLLM v0.20.2 with an experimental TPU backend. The stack has since consolidated and then split again: the TPU documentation now describes vLLM JAX (formerly the tpu-inference plugin), focused on serving JAX models on TPU, while PyTorch-native TPU serving has moved to a separate vllm-torchtpu project that ships its own releases. Recipes cover both v6e and Ironwood. Recommended recipes are still not the same as proven under sustained production load, and the serving study’s GPU-advantages list leads with exactly this: “Ecosystem maturity: PyTorch + HuggingFace has broader library support, simpler LoRA injection, and faster prototyping with fewer workarounds”. The same paper makes the operational tax concrete: vLLM on v6e-8 requires the official Docker image with privileged device access and host networking for gRPC coordination, only the v2-alpha-tpuv6e runtime works correctly, the Tunix stack needs Python 3.11 on VM images that ship 3.10, and the 97 GB boot disk cannot hold the 62.5 GB model download, forcing staging in RAM-backed shared memory.

Prefill vs decode. This is the variable the community benchmark leaves open, but it is no longer entirely unmeasured. A 2026 arXiv serving study fine-tuned and served Gemma 4 31B on TPU v5p-8 and v6e-8, comparing against a 2×H100 baseline selected for cost equivalence using GCP pricing at test time. Reported results: at short context (up to 2,048-token inputs) throughput is comparable with a marginal GPU edge (+6%), while at 4,096-token inputs the TPU delivers 66% higher throughput and 23.6x faster TTFT (61 ms vs 1,443 ms at QPS=4). FP8 KV cache on TPU doubles effective KV capacity and enables 4x higher QPS saturation at medium context. One research group, one baseline, but it is the first direct serving comparison for this model, and it lands where the mechanism predicts.

The mechanism: prefill is compute-bound. A long prompt is a large matrix multiply that saturates the matrix units, which is what TPUs are built for. Decode is memory-bandwidth-bound: generating one token reads the full model weights plus the growing KV cache for a single-row matrix-vector product, so throughput tracks HBM bandwidth, not peak FLOPS. The paper measures both sides directly, the H100’s 3.35 TB/s per-GPU HBM bandwidth against roughly 1.6 TB/s per v6e chip explaining the short-context GPU edge, and the v6e-8’s greater aggregate compute explaining the long-context prefill win. A chip can win prefill by a wide margin and lose decode, because the two phases stress different parts of the silicon. This asymmetry is the argument for prefill/decode disaggregation: because the phases scale on different hardware ratios, a serving design that splits them can avoid overpaying for one of the two. A v6e-versus-H100 decision that ignores this picks a winner for the easy half of the workload.

The crossover decision framework

The TPU-vs-GPU question for Gemma 4 31B is a matrix of three variables: pricing tier, batch concurrency, and workload composition.

TPU v6e Flex-start is favorable when:

  • Batch workloads dominate (high concurrency, latency-tolerant)
  • The team has JAX competency or is serving Gemma-family models with mature XLA kernels
  • Interruptible capacity is acceptable (the workload can tolerate restarts)
  • Traffic is prefill-heavy (long prompts, short completions)

H100 is favorable when:

  • The team has existing CUDA infrastructure (custom kernels, TorchServe, TensorRT-LLM pipelines)
  • Latency-sensitive serving with low batch sizes is the primary workload
  • On-demand capacity guarantees are required
  • Mixed-model serving (Gemma alongside Llama, Mistral, etc.) on shared infrastructure

One break-even you can compute now

Anchor the GPU side at Spheron’s measured 3,100 tok/s for Gemma 4 31B on one H100, which yields 11.16M tokens per hour. A v6e-4 pod lists at $5.40/hr Flex-start and $10.80/hr on-demand per Google’s pricing. The sustained throughput the pod needs to match GPU cost per million tokens:

H100 hourly rateImplied GPU costv6e-4 tok/s to match at Flex-startv6e-4 tok/s to match on-demand
$2.90 (Spheron, Apr 2026)$0.26/M~5,800 tok/s~11,500 tok/s
$4.00 (median, Nov 2026)$0.36/M~4,200 tok/s~8,300 tok/s

At Flex-start rates, four TPU chips need to beat one H100 by about 35% to break even at current medians. On-demand, they need 2.7x. The arXiv serving results let you sanity-check the 8-chip shape: $10.80/hr Flex-start for a v6e-8 against $8.00/hr for two median H100s requires 1.35x the two-GPU throughput, so the reported +66% at 4,096-token inputs clears the bar (roughly 19% cheaper per token) and short-context parity does not. Longer prompts flip the comparison toward the TPU; short prompts, cheap reserved H100 capacity, or spot H100 rates hold it for the GPU.

The batch-size sensitivity alone makes blanket CPM comparisons misleading. Spheron’s data shows a steep cost curve as concurrency drops from batch 256 toward batch 1, and production traffic mostly lives on that curve, not at its endpoint.

For infra teams defaulting to H100 for open-weight serving, the exercise is straightforward: benchmark your actual decode throughput and concurrency distribution, then cost both hardware paths at your real batch profile and prompt-length mix. The TPU numbers are good enough now that skipping the comparison is leaving money on the table. But the headline gap between prefill TPU throughput and batch-256 GPU throughput is not the number to take to finance.

References

Follow the links in the article for context. The supporting material is collected here for further reading.

  1. Gemma-4-31B on v6e-4 TPU Benchmarksdev.toAccessed
  2. Google Cloud TPU v5p Specs, Pricing and LLM Benchmarksblog.easecloud.ioAccessed
  3. Ironwood TPUs and new Axion-based VMs for your AI workloadscloud.google.comAccessed
  4. Ironwood: The first Google TPU for the age of inferenceblog.googleAccessed
  5. NVIDIA H100 cloud GPU pricing indexgetdeploying.comAccessed
  6. vLLM TPU backend documentationdocs.vllm.aiAccessed
  7. Google Cloud TPU pricingcloud.google.comAccessed
  8. Dynamic Workload Scheduler pricingcloud.google.comAccessed

Join the discussion

Share a useful perspective or ask a question about this article.

Discussion guidelinesComments privacy