How-to guides

vLLM tensor parallelism: TP, PP and multi-node

vLLM tensor parallelism splits each layer of a model across GPUs on one node with --tensor-parallel-size, which you set to the number of GPUs sharing the model. Across nodes, vLLM’s docs say to set tensor parallel size to GPUs per node and --pipeline-parallel-size to the number of nodes. Tensor parallelism needs fast links such as NVLink; on PCIe-only cards such as L40S, the docs suggest pipeline parallelism instead.

NEURAMESH / COMPUTE FIELD NOTES00 / 10

When you need more than one GPU

vLLM’s parallelism guide starts with a simple rule: if the model fits on one GPU, run it on one GPU. Distributed inference adds communication on every token and more ways to fail. Split the model only when the weights plus a useful KV cache do not fit.

At 16-bit precision weights need about two bytes per parameter. A 70B model is about 140 GB, more than one 80 GB H100 holds, so it needs at least two GPUs and in practice four to leave room for traffic. A 405B model at 16-bit is about 810 GB, more than the 640 GB on an eight-GPU 80 GB node, so it needs a second node, a quantized checkpoint, or larger-memory GPUs. The LLM VRAM budget covers the KV cache side, and the base single-GPU setup is in deploy vLLM on a cloud GPU; this guide only covers splitting the model.

When you need more than one GPU
SituationvLLM docs recommendFlags
Model fits on one GPUSingle GPU, no distributionDefaults (tensor parallel size 1)
Too big for one GPU, fits in one nodeTensor parallelism--tensor-parallel-size = GPUs used
Too big for one nodeTensor plus pipeline parallelism-tp = GPUs per node, -pp = nodes
GPUs without NVLink, e.g. L40SPipeline parallelism instead of tensor--pipeline-parallel-size
Fits on fewer GPUs than you haveData parallel replicas--data-parallel-size

References: vLLM documentation: Parallelism and scaling · NVIDIA H100 specifications

Tensor, pipeline and data parallelism in one minute

Tensor parallelism splits every layer across GPUs. Each token’s computation needs all GPUs to exchange partial results several times per layer, so the interconnect sits on the critical path. In return, all GPUs work on every token, which lowers per-token latency.

Pipeline parallelism gives each GPU or node a contiguous block of layers and passes activations from stage to stage. It communicates far less, which suits slow links, but a single request moves through stages in sequence. Data parallelism runs full independent copies of the model and adds throughput, not capacity. For mixture-of-experts models, vLLM adds --enable-expert-parallel, which uses expert parallelism instead of tensor parallelism for the MoE layers.

References: vLLM documentation: Parallelism and scaling · vLLM documentation: vllm serve CLI arguments

Step 1: check the GPU topology and when NVLink matters

Before choosing sizes, run nvidia-smi topo -m on each node. NV# entries mean GPUs talk over NVLink; PIX, PHB, NODE and SYS mean traffic crosses PCIe switches, the CPU or the socket interconnect. Confirm the GPU count and memory with nvidia-smi as well.

The gap is large. NVIDIA lists 900 GB/s of NVLink bandwidth for H100 SXM against 128 GB/s for PCIe Gen5, and 600 GB/s NVLink for A100 SXM against 64 GB/s for PCIe Gen4. The L40S has no NVLink support and a PCIe Gen4 x16 link of 64 GB/s. That is why vLLM’s guide suggests pipeline parallelism for GPUs without NVLink, such as L40S. NVLink vs PCIe goes deeper.

Step 1: check the GPU topology and when NVLink matters
GPUMemoryGPU-to-GPU link (vendor spec)Tensor parallel fit
H100 SXM80 GBNVLink 900 GB/s; PCIe Gen5 128 GB/sStrong within a node
H100 NVL94 GBNVLink 600 GB/s; PCIe Gen5 128 GB/sGood within bridged pairs
A100 80 GB SXM80 GBNVLink 600 GB/s; PCIe Gen4 64 GB/sStrong within a node
A100 80 GB PCIe80 GBNVLink bridge 600 GB/s for 2 GPUs; PCIe Gen4 64 GB/sGood for bridged pairs
L40S48 GBNo NVLink; PCIe Gen4 x16 64 GB/sPrefer pipeline parallelism

References: NVIDIA System Management Interface · NVIDIA H100 specifications · NVIDIA A100 specifications · NVIDIA L40S specifications · vLLM documentation: Parallelism and scaling

Step 2: run vLLM tensor parallelism on one node

On a four-GPU node, start the server with vllm serve followed by the model ID and --tensor-parallel-size 4, or the short form -tp 4. The size must divide the model’s attention heads evenly; vLLM refuses to start otherwise with an error that the total number of attention heads must be divisible by tensor parallel size. Check num_attention_heads in the model’s config.json before choosing.

In Docker, add --ipc=host or a large --shm-size so worker processes can share memory, as the vLLM Docker docs describe. Set --max-model-len and --gpu-memory-utilization deliberately; the defaults are covered in the single-GPU runbook.

If GPUs lack NVLink, try -pp 4 instead of -tp 4, or a mix such as -tp 2 -pp 2 when GPUs are bridged in pairs. Then measure. vLLM’s docs state the direction of the trade-off, not a number for your model, so a short load test decides. Use the method in benchmark LLM inference.

References: vLLM documentation: Parallelism and scaling · vLLM documentation: vllm serve CLI arguments · vLLM documentation: Using Docker · vLLM source: model config parallel checks

Step 3: go multi-node with pipeline parallelism

For two nodes of eight GPUs, vLLM’s guide sets tensor parallel size to GPUs per node and pipeline parallel size to the number of nodes: --tensor-parallel-size 8 --pipeline-parallel-size 2. Every node needs the same vLLM version and the model at the same path, either downloaded to each node or on a shared file system.

The default multi-node runtime is Ray. The repository’s examples/ray_serving/run_cluster.sh starts containers on each node and joins them into a Ray cluster; check it with ray status and ray list nodes, then run vllm serve on the head node with --distributed-executor-backend ray. Without Ray, use the multiprocessing backend: the head node runs vllm serve with --nnodes 2 --node-rank 0 --master-addr set to its IP, and the worker runs the same command with --node-rank 1 and --headless. The default master port is 29501.

Cross-node traffic should use InfiniBand or RoCE with GPUDirect RDMA. Run once with NCCL_DEBUG=TRACE and look for [send] via NET/IB/GDRDMA in the log; [send] via NET/Socket means traffic is falling back to TCP, which the guide calls inefficient for cross-node tensor parallelism. InfiniBand vs Ethernet explains the fabric choice.

Step 3: go multi-node with pipeline parallelism
FlagDefaultMeaning
--tensor-parallel-size, -tp1GPUs that split each layer, usually GPUs per node
--pipeline-parallel-size, -pp1Stages of layers, usually the number of nodes
--data-parallel-size, -dp1Independent model replicas
--enable-expert-parallel, -epFalseExpert parallelism for MoE layers
--distributed-executor-backendChosen by vLLMray or mp (multiprocessing)
--nnodes, --node-rank1, 0Multi-node layout with the mp backend
--master-addr, --master-port127.0.0.1, 29501Head node address for the mp backend
--headlessFalseWorker nodes that do not serve the API

References: vLLM documentation: Parallelism and scaling · vLLM documentation: vllm serve CLI arguments

Step 4: secure the cluster

Only the head node’s API port should ever be reachable by clients, and even that should sit behind an SSH tunnel or an authenticated TLS proxy. vLLM’s CLI reference notes that --api-key protects only the /v1, /v2, /inference and /cohere prefixes, so do not rely on it alone.

Ray, NCCL and the multiprocessing master port need open traffic between nodes, not from the internet. Put the nodes on a private network, allow those ports only between the nodes’ private addresses, and keep the provider firewall closed to the public on everything except SSH. For development, reach the API with ssh -N -L 8000:localhost:8000 user@head-node, which the OpenSSH manual describes as local port forwarding without a remote command.

References: vLLM documentation: vllm serve CLI arguments · OpenSSH ssh(1) manual

Common vLLM tensor parallelism errors

The vLLM troubleshooting page recommends NCCL_DEBUG=TRACE and VLLM_LOGGING_LEVEL=DEBUG for any multi-GPU hang, and provides a test script to run with torchrun across the GPUs. If that script hangs, the page says the hardware or drivers are usually at fault, not vLLM. The NCCL timeout guide goes further.

Common vLLM tensor parallelism errors
SymptomLikely causeFix
Attention heads must be divisible by tensor parallel sizeTP size does not divide the head countPick a TP size that divides num_attention_heads in config.json
Server hangs at start with several GPUsNCCL cannot set up peer communicationNCCL_DEBUG=TRACE; run the torchrun test; try NCCL_P2P_DISABLE=1 to diagnose
NCCL init fails inside a containerMissing IPC_LOCK capability or /dev/shmAdd --ipc=host or --shm-size; check RDMA setup
Nodes cannot find each otherWrong network interface or IPSet VLLM_HOST_IP, GLOO_SOCKET_IFNAME and NCCL_SOCKET_IFNAME
Log shows [send] via NET/SocketNo GPUDirect RDMA across nodesFix InfiniBand config, e.g. NCCL_IB_HCA=mlx5 with --privileged
Low throughput on PCIe-only GPUsTensor parallel traffic over PCIeTry pipeline parallelism or a mixed tp/pp split

References: vLLM documentation: troubleshooting · vLLM source: model config parallel checks · vLLM documentation: Parallelism and scaling

Illustrative cost of splitting a model

Parallelism multiplies GPU-hours, so it should buy something you need. As an illustration at an assumed $2.00 per GPU-hour for 80 GB GPUs, a 70B model on four GPUs costs $8 an hour and about $5,840 for a 730-hour month. Two 8-GPU nodes for a 405B-class model cost $32 an hour, about $23,360 a month. A single replica of an 8B model on one GPU costs $2 an hour.

If a quantized checkpoint lets the model fit on half the GPUs with acceptable quality, it halves the bill; see LLM quantization for inference. Compare cost per million output tokens from your own load test, not GPU count.

Illustrative cost of splitting a model
Layout (assumed $2.00 per GPU-hour)GPUsPer hourPer 730-hour month
8B model, single GPU1$2$1,460
70B model, -tp 44$8$5,840
70B model, -tp 88$16$11,680
405B-class model, -tp 8 -pp 216$32$23,360

Checklist and next step

Model confirmed too big for one GPU. nvidia-smi topo -m checked for NVLink. TP size equals GPUs per node and divides the attention heads. PP size equals nodes for multi-node. Same vLLM version and model path on every node. NCCL log shows GDRDMA across nodes. Inter-node ports private; API behind a tunnel or TLS proxy. Load test run before committing to the layout.

When you know the GPU type, count and interconnect you need, rent it. On NeuraMesh you choose the GPU, a plan, GPU count, hours and region, for example on the H100 rental page, and receive a confirmed quotation, typically within one business day, with nothing charged until you approve. Ask about NVLink and interconnect when you request the quote.

NeuraMesh prices for these GPUs

NeuraMesh prices per GPU-hour in USD, excluding taxes, as of 2026-11-27. Live prices are on the rental pages.
GPUMemoryData centerValue
RTX 409024 GB$0.46$0.40
L40S48 GB$1.26$0.54
A10080 GB$1.56$0.98
H10080 GB$2.88$2.00

Every order is confirmed in a quotation before you pay. See all GPU prices.

Questions readers ask

What should I set tensor-parallel-size to in vLLM?

The number of GPUs on one node that will share the model, and a value that divides the model’s attention heads evenly. On a single four-GPU node that is usually 4. Across nodes, set it to GPUs per node and add pipeline parallelism.

Does vLLM tensor parallelism need NVLink?

It works over PCIe, but every layer exchanges data between GPUs, so slow links cut throughput. vLLM’s docs suggest pipeline parallelism on GPUs without NVLink, such as L40S. Check nvidia-smi topo -m and measure both layouts.

What is the difference between tensor and pipeline parallelism in vLLM?

Tensor parallelism splits every layer across GPUs and communicates many times per token; pipeline parallelism gives each GPU or node a block of layers and passes activations between stages. vLLM combines them for multi-node: tensor within a node, pipeline across nodes.

Do I need Ray for multi-node vLLM?

No. Ray is the default multi-node runtime, but the multiprocessing backend works with --nnodes, --node-rank and --master-addr on each node, and --headless on workers.

Should I use data parallelism instead?

If the model fits on fewer GPUs than you have, yes: run replicas with --data-parallel-size or separate servers behind a load balancer. Data parallelism adds throughput without the per-token communication of tensor parallelism.

Sources and editorial notes

Primary documentation reviewed November 24, 2026. Provider descriptions reflect published documentation. Recommendations are our analysis; worked figures are illustrative unless explicitly stated otherwise. No independent provider benchmark or uptime ranking is claimed.

Read the editorial policy.

Need this GPU? Rent it from NeuraMesh: choose a GPU and plan, get a confirmed quotation, and pay only when you approve. See pricing.