VRAMScore
Architecture & Physics•9 min read•Updated 2026-11-28•PURE ENGINEERING REFERENCE

Multi-GPU Tensor Parallelism, System RAM Offloading & MoE VRAM Reality

How inference engines split massive 70B–671B models across multiple GPUs or host RAM: Pipeline Parallelism vs Tensor Parallelism, PCIe overhead, why CPU offloading drops speed 80%, and the real memory math behind Mixture-of-Experts (MoE).

Engineering Takeaways

  • Layer Split (Pipeline Parallelism, default in Ollama/llama.cpp) adds capacity cleanly across mismatched GPUs, while Tensor Parallelism (vLLM) multiplies aggregate memory bandwidth for faster tok/s.
  • Spilling even 20–30% of transformer layers into host DDR5 RAM slows decode by 60–85% because DDR5 (~60 GB/s) and PCIe transfers bottleneck the entire token loop.
  • Mixture-of-Experts (MoE) models require VRAM for 100% of total experts (e.g., 109B for Llama 4 Scout, 671B for DeepSeek-R1) even though only a tiny subset executes per token.
  • Selective MoE expert offloading (keeping attention + shared experts on GPU while routing cold experts to fast multi-channel DDR5) works dramatically better than offloading dense layers.

1. Pipeline Parallelism (Layer Split) vs Tensor Parallelism (TP)

When a 70B Q4_K_M model (~44 GB with KV cache) exceeds a single 24 GB or 32 GB GPU, multi-GPU inference splits the workload using one of two distinct mechanisms: Pipeline Parallelism (commonly called layer splitting) or Tensor Parallelism (TP).

Pipeline Parallelism — the default in Ollama and standard llama.cpp — places layers 0–39 on GPU 0 and layers 40–79 on GPU 1. When generating a token, GPU 0 processes the first half, sends a tiny activation vector across PCIe to GPU 1, and GPU 1 completes the remaining layers. Because PCIe transfer volume is tiny, Pipeline Parallelism works reliably even across PCIe 3.0/4.0 x4 slots or mismatched GPUs (such as an RTX 4090 paired with an RTX 3090). However, only ONE GPU actively computes at any instant during batch=1 decode, so aggregate bandwidth stays close to a single card's speed.

Tensor Parallelism (supported in vLLM, ExLlamaV2/TabbyAPI, and llama.cpp row-split) slices EVERY weight matrix vertically across all GPUs simultaneously. Both cards compute every layer in parallel and synchronize partial sums via all-reduce over NVLink or PCIe P2P. At 2x or 4x GPUs, Tensor Parallelism delivers roughly 1.5x to 2.6x higher tokens/sec than pipeline splitting, making it the gold standard for shared office vLLM servers.

Parallelism ModeDefault RuntimeMismatched GPUs?PCIe SensitivitySpeed Scaling (2x GPU)
Pipeline / Layer SplitOllama, llama.cppYes (any VRAM mix)Very Low (even x4 works)~1.0x single-card speed
Tensor Parallel (TP)vLLM, ExLlamaV2, SGLangIdentical GPUs strongly preferredHigh (prefers x8/x16 or NVLink)~1.55x–1.75x faster tok/s
MLX Distributed RingApple MLX / Exo (TB5)Best with matched MacsMedium (Thunderbolt 5 80Gbps)~1.35x–1.60x faster tok/s

2. The Physics of Partial CPU + System RAM Offloading

If a model exceeds total GPU VRAM by 6 GB, Ollama does not automatically refuse to load it; instead, it offloads overflow layers to host CPU RAM. While this prevents a hard crash, the performance cliff is brutal and often misunderstood.

Suppose 75% of layers fit inside an RTX 5070 Ti (896 GB/s) and 25% spill into dual-channel DDR5-6000 RAM (~60 GB/s theoretical, ~34 GB/s effective CPU SIMD). Even though 75% of the model sits on an 896 GB/s card, Amdahl's Law dictates that total time per token equals GPU time PLUS CPU time PLUS PCIe synchronization latency. Reading just 25% of weights at 34 GB/s takes nearly ten times longer than reading 75% of weights at 700 GB/s — crashing output speed from ~45 tok/s down to ~6–9 tok/s.

# Amdahl's Law in Partial Offload (32B Q4 = 20 GB active weights)
# Case A: 100% on 896 GB/s GPU (eff. 700 GB/s) -> 20 / 700 = 0.028s/tok (~35 tok/s)
# Case B: 70% GPU (14 GB) + 30% DDR5 CPU (6 GB @ 34 GB/s):
#   GPU time: 14 / 700 = 0.020s
#   CPU time:  6 /  34 = 0.176s  <-- 88% of total latency!
#   Total: ~0.21s/tok (~4.7 tok/s — an 86% speed collapse!)

3. Mixture-of-Experts (MoE) VRAM Reality: Total vs Active Parameters

Sparse Mixture-of-Experts architectures — including DeepSeek-R1 (671B total / 37B active), Llama 4 Scout (109B total / 17B active), Llama 4 Maverick (400B total / 17B active), Qwen 3 30B-A3B (30.5B total / 3.3B active), and Qwen 3 235B-A22B (235B total / 22B active) — decouple memory capacity from compute/bandwidth cost.

Here is the non-negotiable VRAM rule for MoE: the router selects a different combination of experts on EVERY SINGLE TOKEN. Because you cannot predict which experts token N+1 will call, ALL total parameters must reside in fast memory simultaneously. Llama 4 Scout still needs ~66 GB of memory at Q4_K_M despite activating only 17B parameters. Once loaded, however, each generated token streams only those 17B active parameters — delivering 17B-class speed with 109B-class world knowledge.

4. Why MoE Models Tolerate CPU RAM Offloading Far Better Than Dense Models

There is one brilliant exception to the CPU offload speed penalty: sparse MoE expert offloading (via llama.cpp -ot flags or KTransformers). If you pin the small shared attention layers, KV cache, and router inside a 24 GB GPU while storing the giant routed expert matrices in 128 GB to 512 GB of fast DDR5 RAM, the CPU only needs to read the ACTIVE experts (e.g., 3.3B or 17B) rather than the entire dense network. On a dual-channel or 8-channel workstation CPU, hybrid MoE offloading can achieve usable 8–18 tok/s on 100B–671B models that would run at <1 tok/s if they were dense.

# Example: Pinning attention/KV to GPU while offloading MoE experts to host RAM in llama.cpp
llama-cli -m Qwen3-235B-A22B-Q4_K_M.gguf -ngl 99 -ot ".ffn_.*_exps.=CPU" -c 16384 -fa

5. Multi-GPU Power, PCIe Lanes & Thermal Design Rules

Building a reliable multi-GPU local AI rig requires planning beyond VRAM totals. Consumer motherboards typically split x16 lanes into x8/x8 across two slots (ideal for 2x GPUs), while 3x or 4x builds often require workstation platforms (Threadripper, Xeon, or PCIe bifurcation risers). Always size power supplies for sustained simultaneous load — two RTX 3090s or RTX 5090s running continuous vLLM prefill can sustain 700W to 1,150W continuously for hours, making power limiting (via nvidia-smi -pl) one of the highest-value stability tricks in local AI homelabs.

  • Power-limiting an RTX 3090 or RTX 4090 by 15–20% (e.g., 350W -> 280W) typically loses under 3% LLM decode speed while dropping fan noise and GDDR6X junction temps dramatically.
  • Enable Above 4G Decoding and Resizable BAR (ReBAR) in BIOS before installing 2x+ high-VRAM cards.
  • For 2x identical GPUs with >48GB total VRAM, verify P2P / NCCL communication if deploying vLLM Tensor Parallelism.

Frequently Asked Technical Questions

Do I need NVLink to run Dual 2x RTX 3090 or 2x RTX 5090 for local LLMs?

No. Ollama and llama.cpp layer splitting work cleanly over standard PCIe 4.0/5.0 without NVLink. NVLink mainly accelerates multi-GPU fine-tuning and gives a modest ~10–15% boost to Tensor Parallelism.

Can I mix two different GPUs like an RTX 4090 (24GB) and RTX 3060 (12GB)?

Yes, under Ollama and llama.cpp pipeline layer splitting. You will gain 36 GB total VRAM, though overall token generation speed will be weighted by whichever GPU handles layers on the narrower memory bus.

Why does Llama 4 Scout need ~66 GB VRAM if it only has 17B active parameters?

All 109B total expert weights must remain loaded in memory because the MoE router chooses different experts dynamically on every token. Only the 17B active parameters are read per token, giving it fast 17B-class speed once loaded.

Does power-limiting GPUs hurt Local LLM tokens/sec?

Barely. Because decode is memory-bandwidth bound rather than core-clock bound, reducing GPU TDP by 15–20% preserves memory clocks and typically retains 96–98% of full tok/s while slashing heat and electricity bills.

Interactive Tools & Referenced Models

Open Live VRAM Simulator