Quick verdict
Use tensor parallelism for single-node multi-GPU. Use pipeline parallelism for multi-node. This rule covers most setups.
Tensor parallelism explained
Tensor parallelism splits each layer’s weight matrices across GPUs. When a forward pass runs, every GPU computes a slice of the matrix multiplication simultaneously, then they synchronize via a high-bandwidth interconnect (NVLink, PCIe, or InfiniBand).- Every GPU holds a fraction of every layer
- All GPUs are active on every token
- Requires high-bandwidth interconnect (NVLink >> PCIe)
- Adds synchronization overhead per layer, but keeps latency low per token
- vLLM calls this
--tensor-parallel-size
Pipeline parallelism explained
Pipeline parallelism assigns different layers to different GPUs. GPU 0 holds layers 0–15, GPU 1 holds layers 16–31. A forward pass flows like an assembly line: GPU 0 processes the input, passes activations to GPU 1, which continues.- Each GPU holds a contiguous shard of layers
- Only 1 GPU is active per token at a time (the others are idle or processing different tokens)
- Tolerates slower interconnects — activations are smaller than full weight matrices
- Adds pipeline bubbles (idle time) that reduce utilization
- vLLM calls this
--pipeline-parallel-size
Decision matrix
Answer these questions to pick your strategy:-
Does the model fit on 1 GPU?
- Yes → no parallelism needed. Use data parallelism if you need more throughput.
- No → continue.
-
Are all GPUs in the same machine?
- Yes → tensor parallelism (lower latency, better decode throughput).
- No → continue.
-
Are GPUs across 2+ machines?
- Yes → pipeline parallelism across nodes. If each node has 2+ GPUs, use TP within each node + PP across nodes.
-
Is it a very large model (405B+)?
- Yes → hybrid TP + PP. Example: TP=2 within each DGX Spark, PP=2 across 2 Sparks.
Hardware-specific recommendations
Data parallelism and expert parallelism
Two other strategies matter for specific scenarios: Data parallelism (DP) — replicate the full model on each GPU and split incoming requests across them. Use this when the model already fits on 1 GPU and you want more concurrent users. vLLM supports this natively — just launch multiple instances behind a load balancer. Expert parallelism (EP) — specific to MoE models. Different GPUs hold different expert groups. When a token routes to an expert, the activation is sent to the GPU holding that expert. Useful for very large MoE models where TP alone wastes memory on inactive experts.Configuration examples
vLLM with tensor parallelism
vLLM with pipeline parallelism
Hybrid TP + PP (large model, multi-node)
For a 405B model across 2× DGX Spark (TP within each node, PP across nodes):SGLang with tensor parallelism
SGLang is competitive with vLLM on dual-GPU setups for specific workloads:NCCL environment variables
For multi-GPU communication, set these before launching:On DGX Spark clusters connected via 200Gb/s QSFP, NCCL automatically selects the optimal transport. You typically do not need to override
NCCL_IB_DISABLE or NCCL_SOCKET_IFNAME unless you are debugging connectivity issues.Performance comparison
Based on community benchmarks for 70B-class dense models:When not to use parallelism
Not every setup benefits from splitting across GPUs:- Model fits on 1 GPU with room to spare — parallelism adds overhead. Run on 1 GPU and use data parallelism for throughput.
- Small models (7B–13B) on consumer GPUs — TP synchronization overhead can make 2× GPU slower than 1× GPU for small models. SGLang shows measurable degradation here.
- Single-user inference — unless the model literally does not fit, 1 GPU is simpler and often faster.
- Network slower than 10GbE between nodes — pipeline parallelism starves on slow links. Upgrade networking first.
Troubleshooting common issues
OOM on multi-GPU with vLLM
vLLM reserves memory for CUDA graphs and KV cache aggressively. On 2× RTX 3090 (48GB total), a 32B model may OOM even though Ollama handles it fine. Reduce--gpu-memory-utilization from the default 0.90:
NCCL connection failures
If GPUs cannot communicate, check:nvidia-smi topo -m— verify NVLink or PCIe topologyNCCL_DEBUG=INFO— confirm which transport NCCL selects- Firewall rules on port 29500 (default NCCL rendezvous port)
Mixed GPU types
vLLM supports heterogeneous GPU setups, but the slowest GPU determines throughput. For best results, use matched GPUs. If mixing, assign more layers to the faster GPU via pipeline parallelism with uneven stage allocation.Expose multi-GPU deployments via Tokios
Whether you run TP, PP, or both, your vLLM or SGLang server exposes an OpenAI-compatible/v1 API on localhost. Run the Tokios connector on the same machine and your deployment becomes reachable from any device, agent, or teammate — without opening inbound ports.
Next steps
Model serving and scaling
Understand how inference engines manage memory, batching, and KV cache.
DGX Spark use case
Set up Tokios on a DGX Spark or a 2-Spark cluster.
vLLM remote access
Expose your vLLM server securely from anywhere.
Quantization guide
Shrink models to fit on fewer GPUs before reaching for parallelism.