Why Putting an LLM on a GPU Can Be Slower: Do the VRAM Math First
This article explains a counterintuitive result in local LLM deployment: an 8B model split between GPU and system memory can run about 14% slower than a CPU-only setup. It breaks down the three root causes—insufficient VRAM capacity forcing sharding, the bandwidth gap between VRAM and host memory, and scheduling overhead from split granularity—then offers a decision flow and a tuning checklist to help you decide whether GPU offload is worth it.}
1. The Counterintuitive Result: Adding a GPU Lowers Throughput
In discussions about local LLM deployment, the loudest claims are usually slogans like “this generation of interconnect lets you run larger models.” What actually determines the experience is a plain benchmark result: the same model of roughly 8 billion parameters produces only about 2.46 tokens per second when half of the weights sit in VRAM and the other half stay in system memory, computed by the processor. Force everything onto the processor, and throughput rises to about 2.80 tokens per second. That makes the hybrid setup roughly 14% slower.
This is not measurement noise, and it is not a missing driver. It is the physical VRAM budget failing to add up. To understand why, you need to separate two paths: compute and memory access.
2. Root Cause 1: Not Enough Capacity Forces Sharding
During inference, generating each token theoretically requires reading the full set of model weights. At a common 16-bit precision, 8 billion parameters need about 16 GB of VRAM. Add the KV cache, runtime context, and framework overhead, and actual usage typically climbs another 20% to 40%. When the GPU only has 8 GB or 12 GB of VRAM, the model cannot reside entirely on the device. It has to be split into layers or operators, with part on the GPU and part in memory.
A rough formula is enough to gauge the order of magnitude:
weight VRAM ≈ parameter count × bytes per parameterKV cache ≈ 2 × layers × hidden dimension × sequence length × batch size × bytes per elementtotal need ≈ weights + KV cache + runtime overhead
Once “total need > VRAM capacity,” sharding is a certainty, not an option.
3. Root Cause 2: The Bandwidth Gap Turns Sharding into a Bottleneck
The GPU’s advantage comes from high-bandwidth VRAM. Common consumer and data-center GPUs deliver memory bandwidth in the range of hundreds of GB/s to several TB/s, while host memory bandwidth is typically only tens of GB/s. When all weights reside in VRAM, the bottleneck is VRAM bandwidth. Once sharding happens, every layer must move data between VRAM and memory over the bus and memory bandwidth, and speed drops sharply.
More importantly, the overall throughput of a sharded setup is dictated by the slowest segment. Even if only half the weights are on the GPU and half in memory, the entire pipeline has to wait for the memory segment to finish. The GPU degrades from an accelerator into a bystander, while also paying the cost of an extra data round trip.
4. Root Cause 3: Split Granularity and Scheduling Overhead
Sharding is not free. The more boundaries between layers and between operators, the more synchronization and copies you get. Common implementations pack several consecutive layers into one execution block and keep data within the block on a single device as much as possible, but activations and intermediate results still have to cross between blocks. If the split is too fine, scheduling overhead eats the parallel gains; if it is too coarse, it may exceed VRAM capacity.
On top of that, in a hybrid deployment, computation and transfer are often hard to overlap fully. Device utilization rises and falls in turns, which ultimately shows up as “it looks like the GPU is being used, but it is actually slower.”
5. Decision Flow: Decide Whether to Use the GPU at All
Start with a minimal decision chain before any tuning:
- Estimate whether total need is below 80% of VRAM capacity (leaving runtime headroom);
- If yes, keep the whole model resident on the GPU and disable any automatic sharding strategy;
- If no, benchmark “CPU-only” against “sharded” throughput and take the higher one;
- Only invest effort in split and precision tuning when sharded throughput is clearly higher.
Illustrative configuration logic (pseudocode, expressing the decision only):
if total_need <= 0.8 * vram:mode = "gpu_full"else:t_cpu = bench(mode="cpu_only")t_mix = bench(mode="split")mode = "gpu_full" if t_cpu > t_mix else "split"
6. Tuning Checklist: Make the Physical Budget Add Up
- Lower precision: with acceptable quality, use lower-bit quantization to compress weights—the most direct capacity lever;
- Shrink context: the KV cache grows linearly with sequence length, so limiting context length frees VRAM significantly;
- Control batch size: larger batches mean more cache and activation usage; small batches are usually more stable in a local single-machine setup;
- Reduce the number of split blocks: keep consecutive layers on the same device to cut cross-device round trips;
- Unify precision and operators: avoid extra conversion copies caused by mixed precision;
- Trust measurements: validate any “theoretically faster” claim with a benchmark using fixed input and fixed length.
7. The Same Trade-off in the Cloud
When local hardware cannot make the VRAM budget add up, a common move is to migrate inference to the cloud: use a container platform to host the inference service, object storage to hold model files, logging and monitoring with alerts to observe throughput, latency, and VRAM usage, and a message queue to smooth request spikes. Baidu AI Cloud offers general-purpose capabilities for this kind of scenario, but the actual selection should still come back to quantitative evaluation along the three main lines—capacity, bandwidth, and scheduling—rather than being pulled by parameter slogans.
8. Conclusion
“Being able to run” and “running fast” are two different things. An 8B model running 14% slower on a GPU comes down to insufficient VRAM capacity triggering sharding, and sharding colliding with the bandwidth gap and scheduling overhead. Estimate first, decide second, tune last—that is how you make every bit of compute count.
