Skip to content
Inference Academy

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.

5 questions·Model answers and follow-upsFree
Share

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 pp 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 mm micro-batches keeps stages busy, and the idle fraction for a simple schedule is about

bubble≈p−1m+p−1\text{bubble} \approx \frac{p - 1}{m + p - 1}

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-kk 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:

  1. 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.
  2. 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.
  3. 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?

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 →

Articles on this topic

Related interview questions

All interview topics →