Skip to content
$ lynuxpro
← AI Infrastructure & GPUs

LESSON 1 OF 18 · BEGINNER · 10 MIN

Why AI needs special infrastructure

Free previewLesson 1 of the 2 free lessons in this Pro course.Unlock all 18

HOW IT WORKSWhy GPUs

CPUa few strong workersHuge maths jobbillions of multipliesGPUthousands of small workersSlowone group at a timeFastall at once
1/5

AI work is a huge pile of similar maths.

In simple words

  • AI infrastructure: the hardware, software and platforms used to train and run AI models.
  • Training: teaching a model from data. Very heavy, runs for hours to weeks on many GPUs.
  • Inference: using a trained model to answer requests. Needs to be fast and cheap at scale.
  • GPU: graphics processing unit: a chip with thousands of small cores, ideal for the maths AI uses.

Big picture

Normal web apps do many small jobs: read a row, send a page. AI models do a few enormous jobs: multiply huge tables of numbers, billions of times. A regular server's CPU can do this, but slowly. A GPU (graphics processing unit) does thousands of small calculations at the same moment, so it is much faster at this kind of work.

Think of a kitchen. A CPU is one master chef who can cook any dish, one at a time. A GPU is a line of 5,000 helpers who can each chop one carrot at the same time. For one complicated dish, the chef wins. For chopping a mountain of carrots, the helpers win.

Because GPUs are rare and costly, AI infrastructure is mostly about two things: keeping GPUs busy and feeding them data fast enough.

The two kinds of AI work

TrainingInference
What it isTeaching a model by showing it lots of dataUsing a trained model to answer a request
How longHours to monthsMilliseconds to seconds per request
Who uses itA few engineers or researchersEvery user of your product
Hardware needMany GPUs working together, fast networkEnough GPUs to meet traffic, low delay
Main goalFinish the job, do not waste GPU timeFast answers, stable cost
Load patternBig batch, then doneGoes up and down with users

Most companies use models far more than they train them, so inference is where most teams spend their time.

What is different from normal infrastructure

Normal appAI workload
CPU and RAM are the limitGPU memory (VRAM) is the limit
Servers are cheap, add moreOne GPU server can cost more than a car per year
A container is a few hundred MBA model file can be 10 to 800 GB
Start in secondsLoading a model can take minutes
Share a server between many appsA GPU is often given to one job at a time
Any network is fineTraining needs very fast links between GPUs

The parts of an AI platform

Data  ->  Training  ->  Model files  ->  Serving  ->  Users |           |              |               | storage    GPU cluster    registry        GPU pods + gateway              |                               |          monitoring, scheduling, cost control
OUTPUTterminalutf-8 · 5L

Each part has a lesson in this course:

PartLessons
The GPU and its software2, 3
GPUs on Kubernetes4, 5, 7
Serving models6, 11, 12, 13, 16
Training and data8, 9, 10, 14, 15
Safety and money17, 18

A first look at a GPU server

On a machine with NVIDIA GPUs and drivers installed, one command shows what you have:

nvidia-smi
SHELLbashutf-8 · 1L
+-----------------------------------------------------------------------------------------+| NVIDIA-SMI 560.35.03    Driver Version: 560.35.03    CUDA Version: 12.6                 ||-----------------------------------------+------------------------+----------------------|| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC || Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. ||=========================================+========================+======================||   0  NVIDIA A100-SXM4-80GB          On  |   00000000:07:00.0 Off |                    0 || N/A   34C    P0             62W /  400W |       4MiB /  81920MiB |      0%      Default |+-----------------------------------------+------------------------+----------------------+
OUTPUTterminalutf-8 · 9L

How to read it: A100-SXM4-80GB is the model, 81920MiB is the 80 GB of GPU memory, and 0% is how busy it is right now. A GPU that is paid for but sits at 0% is wasted money.

Why teams struggle

  • GPUs are scarce. You may wait weeks for capacity, or pay a lot per hour.
  • They are easy to waste. A GPU reserved for a notebook that is idle at night still costs the same.
  • Many layers must match. The driver, CUDA, the container image and the framework all need versions that work together.
  • Failures are expensive. A 3-day training job that crashes on day 3 loses a lot of money.

Rules of thumb

  1. Measure GPU use before buying more GPUs.
  2. Keep models close to the GPU (fast local disk) so they load quickly.
  3. Use one GPU for as many requests as it can safely handle.
  4. Save training progress (checkpoints) often.
  5. Track cost per request or cost per training run, not only total spend.

Common mistakes

  • Using a GPU for work that a CPU does fine, such as small models or data cleaning.
  • Buying big GPUs when the model fits on a smaller one.
  • Ignoring the data path: a fast GPU waiting on a slow disk is idle.
  • Treating AI jobs like web servers and expecting them to start in seconds.

Summary

  • AI work is huge amounts of maths. GPUs do it in parallel, so they are much faster than CPUs.
  • Training teaches a model. Inference uses it. Most teams mainly run inference.
  • GPU memory, cost, huge files and fast networks make AI infrastructure different.
  • The main goals: keep GPUs busy, feed them quickly, and watch the cost.

CHECK YOUR UNDERSTANDING

3 quick questions

  1. 1. Why is a GPU much faster than a CPU for AI work?

  2. 2. A GPU is paid for but sits at 0 percent use. What does this mean?

  3. 3. Which statement about training and inference is right?