Skip to content
Athrael.net logoAthrael.net

Introduction to GPU InferenceChapter 1: Foundations

Inference at scale

Lesson 4 of 4 · about 9 min

What this lesson covers

Previously we looked at inference on a single GPU. An assistant such as ChatGPT or Claude serves millions of users, many of them at the same time, which takes far more than one GPU. This lesson covers the hardware involved, how requests are distributed across it, how demand varies through the day and what it costs.

Consumer and data center GPUs

Consumer and data center GPUs use similar chips and are built for different purposes. A consumer card goes into a personal computer for games and creative work, and has its own fans and display outputs. A data center GPU runs models around the clock alongside many others, and is cooled by the server it sits in.

A consumer GPU and a data center GPU
Consumer GPU
Memory 8 to 32 GB

Built for games and creative work on a personal computer.

Data center GPU
Memory often 80 GB or more

Built for training and running AI models in a data center.

The memory figures are typical of current cards.

They differ most in memory, where a consumer card has 8 to 32 GB and a data center GPU often has 80 GB or more. Memory limits which models fit and how many requests can run at once, so a high-end consumer card can be nearly as fast with a small model and a single request, while large models and many concurrent requests need a data center GPU. Data center GPUs are also linked by fast connections, so a model can run across several of them and requests can be spread over many servers.

Data centers

The GPUs that process your prompts sit in data centers. They are installed in servers called nodes, each with 4 to 8 GPUs, and the nodes are stacked in racks. A large data center can hold tens to hundreds of thousands of GPUs.

A large data center draws tens to hundreds of megawatts, and GPUs turn nearly all of it into heat. Older servers are cooled by fans, but the densest racks produce more heat than air can carry away, so they pump liquid through a cold plate on each GPU.

From one GPU to a data center
GPUs Power

This capacity is spread across several regions of the world, so that a request can be served close to where it was sent and the service continues if one data center goes offline.

Load balancing

One copy of a model runs on one GPU, or on several when it is too large for a single GPU’s memory. Each copy is called a replica, and a large assistant runs thousands of them, each processing its own batch of requests.

When you send a prompt, the request first reaches a load balancer, which selects the replica to process it, usually one with a free slot and a short queue. With this many nodes, replicas fail regularly, and the load balancer sends requests to the others until the failed one is repaired.

A load balancer and five replicas
Load balancerWaiting 0
Sent 0Answered 0
Each square is a slot on a replica. Select a replica to stop it, and select it again to repair it.

Peak demand

Use of an assistant rises through the working day in each part of the world and falls at night, and it jumps when a new model or feature is released.

GPUs have to be bought, installed and powered months in advance, so a company decides early how many to have. If it has enough for the busiest hour, many are idle the rest of the day. If it has fewer, requests queue for a slot at the peak, which raises the time to first token, and replies slow down as batches grow.

Demand through a day
midnight6 amnoon6 pm
  • Served
  • Queued
  • Idle GPUs
  • Capacity
Hours with a queue Idle GPU time
The curve is an example of one region's demand over 24 hours, counted in the GPUs needed to serve every request right away.

Usage limits and notices that a service is at capacity both keep demand within what the GPUs can serve. Many providers also offer a lower price for requests that can wait up to a day, which uses the idle capacity at quiet times.

Costs

A data center GPU costs tens of thousands of dollars, and to that a company adds the building, the electricity, the cooling and the staff who operate it. Most of it is paid for whether the GPUs are busy or idle, so the cost of one reply depends on how many each GPU produces. Batching lowers it, because a GPU serving many concurrent requests spreads its cost across all of them.

The cost of one reply
One GPU for one hour
Price$2.00
Idle, still paid for
Replies produced
Cost of one reply
The price and the length of a reply are examples, on a GPU with capacity for 32 concurrent requests. Each reply takes a little longer as more requests share the GPU.

Most services charge per token, since the computation a GPU does grows with the number of tokens. Output tokens usually cost more than input tokens, because a prompt is processed in one pass while a reply is generated one token at a time. A smaller model costs less because each token takes fewer calculations and more requests fit on one GPU.

Recap

A data center GPU is similar to a consumer one, with more memory and fast connections to other GPUs, and a large data center holds tens to hundreds of thousands of them in nodes and racks. A model runs on them as many replicas, and a load balancer sends each request to one with a free slot. Because demand changes through the day, capacity is planned for the busiest hours and is partly idle the rest of the time, and because the cost of a reply depends on how many each GPU produces, batching lowers it.