,

GPU vs TPU: what is the difference for AI workloads

GPU vs TPU explained: how Nvidia-style GPUs and Google’s TPUs differ in design, software, performance, cost and availability, and how to choose for AI training and inference.

9 min read

Two abstract lime chip grids side by side on a dark background

GPUs are flexible and available everywhere. TPUs are built only for machine learning and rented only from Google. Here is how they compare, and how to choose for your AI workloads.

> Key points

  • GPUs are general parallel processors from Nvidia, AMD and others, backed by the dominant CUDA software ecosystem. TPUs are Google-designed ASICs for machine learning.
  • TPUs suit large, matrix-heavy training and serving on Google Cloud. GPUs suit flexible, portable and custom workloads and are available from every cloud.
  • Vendor performance claims are not a substitute for benchmarking your own model on both, measured as cost per training run or per million tokens.

The short version

GPUs and TPUs are both chips that speed up AI, but they come from different design philosophies. A GPU, or graphics processing unit, is a general-purpose parallel processor that happens to be excellent at the math behind AI. A TPU, or Tensor Processing Unit, is a chip Google designed only for machine learning. GPUs are sold by several companies and available almost everywhere. TPUs are made by Google and rented only through Google Cloud.

For most businesses, the right choice depends less on raw speed than on software, availability, cost per task and how much flexibility you need. This explainer compares the two across the factors that matter when you are choosing hardware for training or running AI models. For a deeper look at Google’s chip on its own, see our explainer What is a TPU.

What a GPU is

GPUs were built to render graphics, which means doing the same simple calculation on millions of pixels at once. That turns out to be the same kind of work AI needs: multiplying large grids of numbers in parallel. Over the past decade, GPUs became the default hardware for training and running AI models.

Nvidia dominates the market for AI GPUs, with AMD as the main alternative. A modern data center GPU contains thousands of small cores for parallel work, specialized units for matrix math (Nvidia calls them Tensor Cores), and large amounts of high-bandwidth memory. GPUs can be bought outright for your own data center, or rented from every major cloud provider and many specialist GPU clouds.

Nvidia’s biggest advantage is software. Its CUDA platform and libraries have been the foundation of AI research and engineering for years, and nearly every AI framework, library and tutorial supports it first. AMD offers its own ROCm software stack, which has improved but has a smaller ecosystem.

What a TPU is

Google’s documentation describes TPUs as “custom-developed, application-specific integrated circuits (ASICs) used to accelerate machine learning workloads.” The core of each chip is the matrix multiply unit, or MXU, which Google describes as “a 128×128 systolic array”: a grid of arithmetic units that passes data between neighbors so each number fetched from memory is reused many times.

Code for TPUs is compiled by XLA, Google’s machine learning compiler. Google says TPUs have “native, high-performance support” for PyTorch and JAX, and supports inference engines such as vLLM and SGLang. TPUs are linked into pods, which Google describes as “a massive physical cluster of TPU chips,” and customers rent slices of a pod. They are available through Compute Engine, Google Kubernetes Engine and Gemini Enterprise Agent Platform.

GPU vs TPU at a glance

  • Designed for: GPU, general parallel computing including AI, graphics and simulation. TPU, machine learning only.
  • Made by: GPU, Nvidia, AMD and others. TPU, Google only.
  • Where you get it: GPU, buy it or rent it from almost any cloud. TPU, rent it from Google Cloud.
  • Software: GPU, CUDA (Nvidia) or ROCm (AMD), supported by nearly every AI tool. TPU, XLA with JAX, PyTorch and TensorFlow.
  • Best at: GPU, flexibility, custom operations, research and mixed workloads. TPU, large, matrix-heavy training and serving at scale.
  • Weak spots: GPU, supply constraints and high prices for top models. TPU, Google says it is “not suited” to workloads needing high-precision arithmetic, and it ties you to Google Cloud.
  • Scale: both can be linked into very large clusters. Google designs TPU systems, networking and data centers together.

Performance: what the numbers mean

Comparing GPU and TPU performance directly is harder than it looks. Vendors publish peak figures under ideal conditions, and real results depend on the model, the software, the precision used and how well the code is tuned for each chip.

On the TPU side, Google claims its seventh-generation Ironwood TPU supports up to 9,216 liquid-cooled chips per pod, delivers 42.5 exaflops per pod and offers 4x better performance per chip than the previous Trillium generation, according to its product page. Google also claims Trillium delivered 4.7x higher peak compute per chip than TPU v5e. On the GPU side, Nvidia and AMD release new generations on roughly annual cycles with their own claims.

These are vendor figures. The only comparison that matters for a business is your own workload: the cost and time to train your model, or the cost per million tokens to serve it, measured on each option.

Software and portability

Software is usually the deciding factor. Most AI code is written and tested on Nvidia GPUs first. Moving to TPUs is straightforward for teams using JAX or standard PyTorch models, because XLA handles the translation. It is harder for code that depends on custom CUDA kernels or GPU-only libraries, which have no direct TPU equivalent.

Google’s documentation recommends sizing model dimensions in multiples of 128 or 8 so the MXU is fully used. Small details like this mean code tuned for one chip may not run at full speed on the other without work.

Portability also matters for the long term. GPU workloads can move between clouds and on-premises servers. TPU workloads run only in Google Cloud. Teams that value flexibility often standardize on frameworks that run on both, so they can switch if prices or availability change.

Cost and availability

Neither chip is cheap, and prices change often, so compare current cloud pricing for your region rather than relying on published lists. A few patterns hold:

  • Supply. Demand for top Nvidia GPUs has often exceeded supply, leading to waiting lists and high prices. TPUs are an alternative source of capacity for companies willing to use Google Cloud.
  • Pricing models. Both are available on demand, with discounts for committed use. Spot or preemptible capacity is cheaper but can be interrupted.
  • Total cost. Engineering time to port and tune code can outweigh hardware savings for small projects. For large, steady workloads, hardware price per task dominates.
  • Policy. Export controls shape where advanced AI chips can be sold. Our analysis of AI compute export controls explains how this affects buyers.

Training vs inference

Training means building or fine-tuning a model, which needs huge amounts of compute for a period of time. Both GPUs and TPUs are used for frontier model training; Google trains its Gemini models on TPUs, and most other labs rely heavily on Nvidia GPUs. Large training runs depend as much on networking between chips as on the chips themselves.

Inference means running a trained model to answer requests. It is where most ongoing costs sit for businesses that serve AI to customers or staff. Cost per token, latency and the ability to scale up and down matter most. Google’s eighth-generation TPU 8i, announced as coming soon, is aimed specifically at inference, and Google claims an 80% performance-per-dollar improvement for low-latency inference on large mixture-of-experts models. GPU makers are also tuning new chips for inference.

It is not just the chip: memory, networking and power

Comparisons that focus on a single chip miss much of what determines real performance. Three other factors often matter as much:

  • Memory. Large models need to hold billions of parameters close to the processor. Both modern GPUs and TPUs use high-bandwidth memory (HBM) on the chip package, and the amount and speed of that memory often limits how large a model fits on each chip and how fast it serves requests.
  • Networking. Training and serving the largest models means splitting work across many chips. How fast chips talk to each other, inside a server and across a cluster, can decide whether adding more chips actually speeds things up. Google designs TPU pods with dedicated interconnects; GPU vendors and cloud providers build their own high-speed networks.
  • Power and cooling. AI chips draw large amounts of electricity and produce heat. Google says Ironwood pods are liquid-cooled. For companies building their own clusters, power availability is now often a bigger constraint than chip supply.

When comparing options, ask about the whole system, not just the chip: how many chips can work together on one job, how they are connected and what that configuration costs per hour.

Questions to ask your cloud provider

  • What is the price per hour for the configuration I need, on demand and with a one- or three-year commitment?
  • How quickly can I get capacity, and is there a waiting list for the newest chips?
  • Which frameworks and versions are officially supported, and what migration help is available?
  • What reference benchmarks exist for models like mine, and can I run a trial?
  • Which regions offer the hardware, and does that meet my data residency needs?

Other options: custom chips beyond Google

GPUs and TPUs are not the only choices. Amazon builds its own Trainium chips for training and inference, as covered in our story on Amazon’s Trainium deal with Decart, and Microsoft and Meta have their own silicon programs. Specialist companies also build inference chips. The trend is clear: the largest cloud providers want their own chips to control costs and supply, which gives buyers more options.

For many businesses the most practical route is not to choose a chip at all, but to use AI through APIs or managed services and let the provider pick the hardware. Amazon’s new Ergo model, for example, is offered through Bedrock, where customers pay per token rather than per chip.

How to choose

Choose GPUs if:

  • Your code depends on CUDA libraries or custom kernels.
  • You need to run on several clouds or your own hardware.
  • Your work mixes AI with graphics, simulation or high-precision computing.
  • You are doing research that needs maximum flexibility.

Choose TPUs if:

  • You train or serve large transformer models at scale.
  • Your team works in JAX or standard PyTorch and can use XLA.
  • You already run on Google Cloud, or can.
  • You want an alternative to GPU supply constraints and pricing.

Choose neither directly if: you mainly use AI through APIs or software products. Focus on model quality, price per task and data terms instead.

Whatever you lean toward, run a benchmark. Take one representative model, run it on a small TPU slice and a comparable GPU instance, and compare cost per training run or per million tokens served, not just speed.

Frequently asked questions

Is a TPU faster than a GPU? It depends on the workload. TPUs can be faster or cheaper for large, matrix-heavy AI work tuned for them. GPUs are more flexible and often faster for workloads with custom operations.

Can I buy a TPU? Not for data center use. Google rents TPUs through Google Cloud. GPUs can be bought or rented.

Does PyTorch run on TPUs? Yes. Google cites native support for PyTorch and JAX, with XLA compiling the code for TPUs.

Why do most AI companies use Nvidia GPUs? Mainly software. CUDA has been the standard for AI development for years, and GPUs are available from every cloud and for purchase.

Which is better for inference? Both are used. Compare cost per million tokens and latency for your model on each. For more terms, see our AI glossary and our guide to AI chips.

What it means

For business

Most companies should not pick chips directly. Teams running their own models should benchmark GPUs and TPUs on cost per task and weigh portability.

For industry

Custom chips from Google, Amazon and others are giving buyers real alternatives to Nvidia GPUs, easing supply and price pressure.

For workers

Engineers who can work across CUDA and XLA toolchains are more valuable as companies mix hardware to control costs.

Sources