# CPU Offloading

- **Canonical URL:** https://getaimath.com/dictionary/cpu-offloading/
- **Topics:** [AI Infrastructure & Runtime](https://getaimath.com/dictionary/category/ai-infrastructure-and-runtime/)
- **Last updated:** 2026-11-25

## What is CPU Offloading?

**In one sentence:** CPU offloading moves some model layers or data from the GPU to the CPU and system RAM.

The CPU either runs those layers itself or holds them until the GPU needs them. Tools like llama.cpp let you choose how many layers stay on the GPU.

![AI Runtime Engines: Sharing the Oven So Nobody Waits in Line — Simple cartoon showing 4 users ordering at a coffee counter: instead of making everyone wait behind one huge order, a smart Runtime Engine serves all 4 side-by-side at the same time.](https://getaimath.com/diagrams/ai-infrastructure-and-runtime.png)
*Napkin Diagram (AI Infrastructure & Runtime): A runtime engine is the traffic controller that lets one AI chip serve dozens of people at once without anyone getting stuck.*

## What is an example of CPU Offloading?

Setting llama.cpp to put 30 of 40 layers on the GPU offloads the other 10 to the CPU.

## Why does CPU Offloading matter?

CPU offloading helps people run models that do not quite fit their GPU.

## Related Concepts

- [Model Offloading](https://getaimath.com/dictionary/model-offloading/): Model offloading moves parts of a model out of fast GPU memory into slower memory, like system RAM or disk, so it can still run.
- [GPU Offloading](https://getaimath.com/dictionary/gpu-offloading/): GPU offloading moves work from the CPU to the GPU to make it faster.
- [Distributed Training](https://getaimath.com/dictionary/distributed-training/): Distributed training spreads the work of training a model across many GPUs or machines.
- [Memory Mapping (mmap)](https://getaimath.com/dictionary/memory-mapping-mmap/): Memory mapping, or mmap, lets a program treat a file on disk as if it were already in memory, loading pieces only when needed.
- [Distributed Inference](https://getaimath.com/dictionary/distributed-inference/): Distributed inference runs a single model across multiple GPUs or machines to answer requests.
- [Model Loading](https://getaimath.com/dictionary/model-loading/): Model loading is the step of reading a model's weights from storage into memory so it can run.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/cpu-offloading/)
