Model and Inference EngineeringParallelism and placementPrincipal
How would you combine tensor, pipeline and data parallelism across eight GPUs on two nodes?
By Amit Kumar3 min readWorked answer includedReviewed 26 Sept 2026
The question
Interview question
A model cannot fit on one GPU. Eight GPUs span two four-GPU nodes with a much slower inter-node link. Explain what each parallelism strategy splits or replicates, build a memory and communication budget, choose candidate placements and compare single-stream with loaded serving. Explain why doubling one model’s parallel width need not double throughput.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
“Eight GPUs” is not enough information to choose. I need the model's weights at serving precision, runtime workspace, peak key-value (KV) cache memory per live sequence, target prompt and output lengths, concurrency, and the memory and link topology. A model that barely fits across two GPUs can still fail at the first long prompt because weights are only one part of the memory budget. A placement that fits may miss first token or per token latency because each decode step crosses a slow link.
The KV cache stores attention state for preceding tokens and grows with live sequence length. After reserving it and runtime workspace, compare the placements:
| Strategy | What is replicated or split | Main serving cost |
|---|---|---|
| Data parallel | Full model replica per worker group, different requests | Weight memory per replica, traffic balance and local KV capacity |
| Tensor parallel | Operations within layers split across devices | Communication at repeated layer boundaries, including during every decode step |
| Pipeline parallel | Different layer ranges on different devices | Stage transfer and idle gaps, especially at low concurrency |
If the model plus a useful KV budget fits on one GPU, start with replicas. Each can schedule independent requests and a slow link between nodes need not carry every token's intermediate state. If it does not fit, use the minimum parallel group that gives safe headroom and acceptable latency. Tensor parallelism within a fast connected node is often a reasonable first experiment for a model too large for one card. The collective communication cost repeats across layers and generation steps, so increasing tensor parallel width across a slow inter-node link can make decode slower even as per-device memory falls.
Pipeline parallelism places groups of layers on different devices or nodes. Inter-stage activations cross the boundary, but every request still has to traverse all stages. With a small number of active requests, stages wait for each other and the pipeline can have a large idle fraction. With enough concurrent sequences or microbatches it can fill better, at the cost of queueing and per-request latency. For two four-GPU nodes, a candidate might use tensor parallelism inside each node and two pipeline stages across nodes. That is a candidate to benchmark, not a formula that always wins. vLLM's parallelism guide documents these serving modes and their combinations.
The slow link changes the decision. Measure latency and utilization for a single stream, small interactive batch, and loaded batch. Capture cross-node bytes and collective time by layer or stage, per-stage idle time, KV headroom, time to first token, inter-token time, and completed requests within SLO. If a model fits in four GPUs with a smaller KV budget, two four-GPU replicas may beat one eight-GPU parallel group on this topology. If it only fits across all eight, quantify the unavoidable inter-node cost and whether the target can still be met. Quantization or a different model could be a better product decision, but it must pass a quality gate.
There is a follow-up about doubling QPS. Adding another eight-GPU group can add independent serving capacity. Doubling the parallel width of one group mostly changes how one request is executed. It does not automatically double useful throughput. Keep data parallel groups separate from the degree of model splitting. The vLLM data parallel deployment guide makes this distinction in its configuration, but the choice of group sizes should come from our memory and latency measurements.
If someone says “pipeline is for training,” I would correct that too. Pipeline and tensor splitting can both serve inference, though their scheduling costs differ from training. The final answer is a measured placement with memory headroom and a failure plan for one GPU or node, not a slogan that one parallelism type is always faster.
Related questions
Keep practising model and inference engineering
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux