Why Putting a Large Model on a GPU Can Make It Slower: The Cost of VRAM Overflow
A counterintuitive but reproducible result: partially offloading a mid-sized model to a GPU can deliver lower throughput than running entirely on host memory. This article explains why, how to measure token/s under a consistent methodology, what four configurations reveal about the real inflection point, the three mechanisms behind negative acceleration, and a practical order of operations for tuning and capacity planning.
1. The Real Problem Hidden Behind the Marketing: Not “Can It Run” but “How Fast”
A common claim in the industry is that a consumer-grade GPU can “run” a model of a certain parameter size. The statement itself is not wrong, but it answers “can it load” rather than “how many tokens per second does it produce.” For engineering deployment, the latter is the metric that determines user experience. A model loading successfully only means the weights were placed into some available memory; where the computation actually happens and how many times data is moved are details the marketing line usually leaves out.
This leads to a counterintuitive but fully reproducible phenomenon: putting a mid-sized model “partially on the GPU” yields lower throughput than not using the GPU at all and running everything from host memory. The reason is not mysterious — the bandwidth of the data path between GPU and host memory is typically far lower than the bandwidth of the GPU’s own VRAM. Once the weights do not fit, every layer must be shuttled back and forth between host memory and VRAM, and the transfer time drowns out the compute gains, producing “negative acceleration.”
2. Fix the Measurement Methodology First, or the Numbers Are Not Comparable
The comparison above only proves its point because the methodology is strictly consistent:
- Fix the output length (for example, 150–200 tokens) and compare speed only, not generation quality;
- Take speed as “generated tokens ÷ generation-phase elapsed time,” excluding model loading, compilation, and warm-up;
- Record model size (approximate footprint of the decompressed weight files) and the VRAM utilization ratio;
- Keep parallelism, context length, and quantization precision identical.
The methodology issue the original emphasizes is this: the speed unit is tokens per second, not time-to-first-token or requests per second. The three are often conflated: token/s measures single-stream generation throughput, time-to-first-token measures interactive responsiveness, and requests per second measures server-side concurrency. Mixing them leads to entirely different conclusions.
Illustrative measurement logic (pseudocode, expressing methodology only, not pointing to any specific tool):
# Count the generation phase onlystart = now()for _ in range(num_predict): # num_predict fixed at 150~200token = model.generate_one()end = now()tps = num_predict / (end - start) # tokens/second, excluding load time
3. The Comparison: What Four Configurations Show
Under a unified methodology, the four configurations show a clear inflection point (values are illustrative magnitudes, used to show the trend):
- Small model (~2.5 GB), ~86% of weights in VRAM and 14% falling back to host memory: ~17.4 s for 200 tokens, ~11.5 token/s;
- Mid-sized model (~5.2 GB), about half in VRAM and half in host memory: ~81.3 s for 200 tokens, ~2.46 token/s;
- The same mid-sized model forced to skip the GPU (0% in VRAM): ~53.6 s for 150 tokens, ~2.80 token/s;
- Larger model (~9.3 GB), fully resident in host memory: ~158.2 s for 200 tokens, ~1.26 token/s.
Two conclusions matter. First, comparing the second and third configurations shows that 50% on the GPU does not mean “half the acceleration” — it can be slower than 0% on the GPU, by roughly a dozen-plus percent. Second, the first configuration shows that the GPU delivers order-of-magnitude gains only when the weights “almost entirely” fit; the threshold is not “half fits” but “essentially all fits.”
4. Why Negative Acceleration Happens: Three Mechanisms
- Bandwidth mismatch. VRAM bandwidth is typically an order of magnitude or more above host memory bandwidth, and cross-path transfers also pass through the bus and copies, so effective bandwidth is lower still. Moving weights layer by layer means repeatedly spending the most expensive resource on transfers.
- Idle compute units. The generation phase is a per-token, memory-access-intensive workload, so compute is not the bottleneck. While data is being moved, compute units wait, utilization drops, and power draw goes up.
- Scheduling and synchronization overhead. Cross-device execution requires frequent synchronization and context switching, and with a small batch these fixed costs are amplified as a share of total time.
5. Diagnosis and Tuning: From “Can Run” to “Runs Fast”
To tell whether overflow is happening, watch two things: whether VRAM usage stays pinned near the ceiling over time, and whether the generation phase shows noticeable periodic stalls. If overflow is already occurring, handle it in this order:
- Reduce weight size first: adopt a mainstream quantization approach (such as a lower-bit weight representation); size drops roughly linearly with bit count;
- Compress context and output length: the context cache also occupies VRAM, and a long context squeezes the space available for weights;
- Choose one extreme rather than a compromise: either keep the weights essentially fully resident in VRAM, or send everything to host memory, avoiding the worst zone of “half on the GPU”;
- Improve host-memory-side execution efficiency: platforms with a unified memory architecture can significantly shrink transfer costs;
- For server-side scenarios, consider multiple instances and batching, trading concurrency for throughput instead of forcing a single stream to “tough it out.”
Decision pseudo-flow:if weight size + context cache <= available VRAM * 0.9:keep everything resident in VRAMelse:run everything on host memory (or switch to a smaller model / lower bits)
6. Capacity Planning Checklist
- Goals: set separate targets for single-stream token/s and time-to-first-token;
- Budget: account for VRAM, host memory, and power at the same time;
- Headroom: reserve more than 10% of VRAM for context and temporary buffers;
- Observability: continuously collect throughput, VRAM usage, and fallback ratio via monitoring, alerting, and logging services;
- Elasticity: scale horizontally on general-purpose compute forms such as container platforms or function compute, and use object storage to distribute model weights.
7. Conclusion
Between “can run” and “runs fast” sits a VRAM capacity red line. Cross it and the gain is order-of-magnitude; fail to cross it and force the GPU anyway, and the gain may be negative. Before making a deployment decision, measure your own model-and-hardware combination under a unified methodology, then decide where to place it — that is more reliable than any marketing claim. If you need a complete chain from load testing to monitoring to elastic scaling, you can build a validation environment yourself on general-purpose capabilities such as container platforms, monitoring and alerting, and object storage offered by Baidu AI Cloud.
