Topic 4 of 5 · 5 min read
CPUs, Apple silicon and unified memory
Goal: Decide whether a unified-memory laptop or a GPU desktop suits a given model and workload.
CPUs and unified-memory machines trade speed for capacity: they can hold much larger models than a consumer GPU, but each token is slower, so they suit large MoE models and light use better than big dense models. Which side wins depends on your model and your patience.
Check yourself · 1 of 3
What does unified memory mean on an Apple silicon machine?
Why it matters
A consumer GPU has 8 to 24 GB. A laptop or mini-desktop with unified memory can offer 64, 128 GB or more that the GPU cores can use directly. That changes which models you can run at all.
How it works
Running on a CPU. Engines such as llama.cpp run on ordinary CPUs and system RAM. Generation speed follows the bandwidth rule: a dual-channel desktop at about 80 to 100 GB/s gives a ceiling near 20 tokens/s for a 4.5 GB model, and a workstation with more memory channels gets more. CPUs are also slower at prefill, so long prompts take noticeably longer.
Unified memory. On Apple silicon the CPU and GPU share one pool of memory, so there is no copy between them and a large share of it is usable by the GPU. Bandwidth depends on the chip: base chips are near 100 GB/s, higher tiers in the hundreds of GB/s, and the top tiers above 800 GB/s. The llama.cpp discussion in the references lists measured speeds beside each chip's bandwidth. Apple's MLX framework and llama.cpp's Metal backend are the two usual ways to run models. Other unified-memory machines with large shared memory work the same way, with their own bandwidth numbers to look up.
Why MoE suits them. Large memory is cheap relative to bandwidth on these machines. An MoE model with 100B total parameters and 10B active, at 4-bit, needs about 56 GB to hold and reads about 5.6 GB per token. On a 400 GB/s machine the ceiling is near 70 tokens/s. A dense 100B model would read 56 GB per token and reach about 7.
A decision rule
- Model fits in a consumer GPU's memory, and you want speed or fine-tuning: GPU desktop.
- Model is far larger than 24 GB, and it is MoE or you accept a few tokens per second: unified memory.
- Need a portable machine, low noise and low power: unified-memory laptop.
Before and after
Weak: "I need to run a 120B model, so I will buy a 24 GB GPU." It will not fit; layers spill into system RAM and speed collapses. Fixed: "I will use a 128 GB unified-memory machine and an MoE model whose active size is small."
What goes wrong
- Expecting GPU-desktop speed from a laptop on a dense model of 70B or more.
- Forgetting that the GPU can only use part of the shared memory by default; the operating system keeps some.
- Ignoring prefill. Long documents and agent contexts of tens of thousands of tokens can take minutes before the first word.
- Skipping thermal limits. A thin laptop under sustained load may throttle.
Examples
A 128 GB laptop and a 24 GB desktop
Model: a 100B-total, 10B-active MoE at 4-bit, about 56 GB. The 24 GB desktop cannot hold it. The 128 GB laptop with about 400 GB/s holds it and has a ceiling near 70 tokens/s. For a 14B dense model at 4-bit (about 8 GB), the desktop with a 1,000 GB/s card reaches a ceiling over 100 tokens/s and the laptop about 50, so the desktop is faster but both are fine for chat.
Long prompt on a laptop
You paste a 60,000-token codebase into a local model. Generation is fast once it starts, but prefill on a laptop might process a few hundred tokens per second, so the first word appears after a few minutes. A GPU desktop does the same prefill several times faster. If you work with long contexts all day, this matters more than generation speed.
Key points
- CPU generation speed obeys the same bandwidth rule, with ordinary desktop memory giving a modest ceiling.
- Unified memory lets a laptop or small desktop hold models far larger than a consumer GPU can.
- Bandwidth varies a lot between chips in the same family, so look up the exact chip.
- Large MoE models match large, mid-bandwidth memory because only the active experts are read per token.
- Prefill is slower on CPUs and laptops, which hurts long-prompt and agent workloads most.
Common mistakes
- Buying a unified-memory laptop for dense 70B-class models and expecting desktop-GPU speed.
- Comparing Apple chips by name without checking their memory bandwidth.
- Judging only generation speed and not the wait for long prompts.
- Assuming all of the shared memory is available to the model; the system and other apps use some.
Check yourself · 2 of 3
Why does a large MoE model suit a machine with lots of memory but modest bandwidth?
Check yourself · 3 of 3
A laptop generates quickly but takes minutes before the first word of a reply to a 60,000-token prompt. What is the likely cause?
Practice items, not counted towards your mastery.
Start here
- Accelerate model memory estimator (opens in a new tab)ToolFree
Shows how to compute the memory a model needs from its parameter count and data type before downloading it.
- Optimizing LLMs for speed and memory (Hugging Face) (opens in a new tab)ArticleFree
Covers memory per parameter at different precisions and why the KV cache grows with context.
- Tim Dettmers: which GPU for deep learning (opens in a new tab)ArticleFree
Explains why memory and memory bandwidth drive GPU choice, with a decision flow for buyers.
More for this topic
- llama.cpp discussion: quantization types and perplexity (opens in a new tab)ArticleFree
Community-measured tokens per second on Apple chips, next to each chip's memory bandwidth.
- MLX (opens in a new tab)ToolFree
Apple's array framework that uses unified memory, the main way to run models natively on a Mac.