Multi-GPU LLM serving interview questions
Interview questions on multi-GPU LLM serving: tensor vs pipeline vs data vs expert parallelism, all-reduce cost, NVLink vs PCIe, pipeline bubbles, and how to choose a layout for a 70B or MoE model.
Once a model does not fit on one GPU, or one GPU cannot meet the latency target, you have to split it. Interviewers look for whether you know what each kind of parallelism communicates, how often, and over which link, because that decides whether adding GPUs makes it faster.
Question 1
Explain tensor parallelism. What does it communicate and when?
Model answer
Tensor parallelism (TP) splits each layer's weight matrices across GPUs, so every GPU holds a slice of every layer and all GPUs work on every token.
In the Megatron-style layout for a transformer block:
- The attention block splits heads across GPUs (the QKV projection is split by columns, the output projection by rows). Each GPU computes attention for its heads with its share of the KV cache.
- The MLP splits the first projection by columns and the second by rows.
Each split-by-rows matmul produces partial sums, so there is one all-reduce after attention and one after the MLP: two per layer, per forward pass. Each all-reduce carries the activations for the batch, roughly batch tokens times hidden size times bytes.
Benefits: per-GPU weight bytes per decode step fall by the TP degree, so memory-bound decode gets faster and latency drops, and the KV cache is split too. Cost: those all-reduces happen 2 times per layer per step, so TP needs a fast interconnect like NVLink and is normally kept within one node.
Likely follow-up questions
- Why does TP degree usually need to divide the number of KV heads?
- Estimate the all-reduce volume per decode step for a 70B model at batch 32 with TP 4.
- Why does TP over PCIe often scale badly?
Question 2
How does pipeline parallelism differ, and what is the bubble?
Model answer
Pipeline parallelism (PP) assigns contiguous groups of layers to different GPUs. Activations flow from stage to stage with point-to-point sends, once per stage boundary per micro-batch, which is far less communication than TP. That makes PP suitable across nodes or slower links.
The catch is the bubble: with stages, a single request's tokens pass through the stages one after another, so only one stage is busy at a time. Splitting work into micro-batches keeps stages busy, and the idle fraction for a simple schedule is about
For inference, PP does not reduce single-request latency (each token still goes through every layer in sequence, plus transfer hops). It increases capacity and throughput when there are enough concurrent requests to fill the pipeline.
Likely follow-up questions
- Why is PP common for serving across two nodes while TP stays within a node?
- How does continuous batching interact with pipeline micro-batches?
- What is the memory balance problem with uneven stages, for example the embedding and output layers?
Question 3
When do you use data parallelism or expert parallelism instead?
Model answer
- Data parallelism (DP): independent replicas of the whole model behind a load balancer. No communication between replicas during inference, so it scales throughput nearly linearly. Use it whenever the model fits on the GPUs of one replica; it is often better than TP for throughput because it avoids all-reduces.
- Expert parallelism (EP): for mixture-of-experts models, place different experts on different GPUs. Each token is routed to its top- experts, so the layer needs an all-to-all to send tokens to their experts' GPUs and another to bring results back. Attention is often run with DP or TP while the MoE layers use EP.
EP's challenges are load imbalance (popular experts become hot spots, mitigated with redundant copies of hot experts) and the all-to-all latency, which is why large MoE deployments use high-bandwidth fabrics and overlap communication with computation.
Likely follow-up questions
- For an 8B model on a node of 8 GPUs, would you use TP 8 or DP 8? Why?
- What does DP attention plus EP MoE buy you for a model like DeepSeek-V3?
- How do you detect expert load imbalance in production?
Question 4
How do you choose a parallelism layout for a 70B model on 8 H100s?
Model answer
Start from memory, then latency, then throughput:
- Memory: 70B in BF16 is about 140 GB, so it needs at least 2 GPUs plus room for KV cache; in FP8 it is about 70 GB, which technically fits on one 80 GB GPU but leaves almost no KV cache, so 2 is the practical minimum.
- Latency target: higher TP means fewer bytes per GPU per step and lower inter-token latency, with diminishing returns as all-reduces grow relative to compute.
- Throughput: for a fixed node, compare layouts such as TP 8 times DP 1, TP 4 times DP 2, and TP 2 times DP 4. Lower TP with more replicas usually gives more total tokens per second; higher TP gives lower latency per request and more KV cache per replica for long contexts.
Then measure each candidate with a realistic load test and pick the one that maximises goodput under the SLO. A typical outcome is TP 4 times DP 2 in FP8 for a balanced chat workload, and TP 8 for very long contexts or strict latency.
Likely follow-up questions
- How does the answer change if the GPUs are connected only by PCIe?
- What changes for a 405B model?
- Where does prefix caching push this decision?
Question 5
What are NVLink, NVSwitch and InfiniBand, and why do they matter for serving?
Model answer
- PCIe links a GPU to the host. PCIe Gen5 x16 gives about 64 GB/s each way, and GPU-to-GPU traffic over it is slow relative to HBM.
- NVLink is NVIDIA's direct GPU-to-GPU link; on H100 it provides about 900 GB/s of total bandwidth per GPU. NVSwitch connects all GPUs in a node (and in rack-scale systems like NVL72, many nodes) so any pair communicates at full NVLink speed.
- InfiniBand or RoCE connects nodes, typically 400 Gb/s per NIC (about 50 GB/s), with RDMA so GPUs can send directly without going through host memory.
Why it matters: tensor parallelism does two all-reduces per layer per step, so it needs NVLink-class bandwidth and low latency; pipeline and data parallelism tolerate slower links. Disaggregated prefill and decode and KV cache transfer also depend on the inter-node fabric. The rule of thumb is TP within an NVLink domain, PP or DP across nodes.
Likely follow-up questions
- What is the bandwidth cost of a ring all-reduce in terms of message size and number of GPUs?
- Why does all-reduce latency, not bandwidth, dominate at small batch sizes?
- What does a rack-scale NVLink domain change about how you shard a very large MoE model?
The lesson behind these answers · 14 min · free
Mixture of experts: routing, memory and why MoE decodes fast but needs big GPUs
Worked numbers, step-through diagrams and a quiz, so you can derive the answer in the interview instead of reciting it.
Read the lesson →- Model parallelism: tensor, pipeline, expert and data parallel inference · Performance Techniques15 min · Pro
- Multi-GPU interconnects: PCIe, NVLink, NVSwitch and InfiniBand · Bottlenecks and Hardware20 min · Pro
- Lab: tensor parallel versus data parallel on two GPUs · Benchmarking, Labs and Capstone90 min · Pro · lab
- Placing a model across GPUs, CPU and RAM: MoE offload and multi-GPU splits · Performance Tuning14 min · Pro
- Case study: serving a trillion-parameter hybrid MoE (Kimi K3) · Performance Techniques20 min · Pro
Articles on this topic
- How many GPUs do you need to serve an LLM? A worked capacity plan (9 min read)
- Mixture of experts inference: cheap to compute, expensive to hold (7 min read)
- Tensor vs pipeline vs data vs expert parallelism for LLM inference (7 min read)
- Can you run a 70B model at home? What hardware works (7 min read)
Related interview questions
- Mixture of experts (MoE) interview questions (6 questions)
- Roofline model interview questions for LLM inference (5 questions)
- KV cache interview questions (5 questions)
- vLLM, SGLang and llama.cpp internals interview questions (5 questions)