Multi-GPU LLM Setup: Running 70B Models Across Multiple Cards
Running a 70B model on a single consumer GPU isn't feasible — even an RTX 4090 with 24GB falls short of the 40GB needed for Q4_K_M. Multi-GPU setups distribute model layers across multiple cards, making large models accessible without professional hardware. Here's how to set one up and what to expect.
Tensor Parallelism vs Pipeline Parallelism
Tensor parallelism splits individual matrix operations across GPUs — every GPU participates in every layer, requiring high-bandwidth GPU interconnect (NVLink). Pipeline parallelism assigns different layers to different GPUs — each GPU completes its layers before passing to the next. For consumer setups without NVLink, pipeline parallelism via PCIe is more practical and what llama.cpp uses by default with multiple GPUs.
llama.cpp Multi-GPU Setup
llama.cpp automatically distributes layers across all detected GPUs. With two GPUs of different sizes, use --tensor-split 24,16 to allocate proportionally (24GB GPU gets 60%, 16GB GPU gets 40%). This ensures neither GPU runs out of VRAM. The --override-tensor flag gives fine-grained control over which layers land on which device.
PCIe Bandwidth Considerations
Without NVLink, GPUs communicate via PCIe — typically ~16 GB/s for a PCIe 4.0 x16 slot. This creates a bottleneck at layer boundaries. For inference, PCIe bandwidth is usually sufficient — most of the time is spent on memory-bandwidth-limited matrix operations within each GPU. The overhead is typically 15-25% compared to NVLink. Avoid running three or more GPUs in PCIe x8 slots without testing bandwidth first.

Comments
Post a Comment