LearnQuestion bank

Will a 70B dense model serve 32 concurrent users at 32k context on two 80 GB GPUs? Explain tensor, pipeline and data parallelism along the way.

Applied LLMTechnicalHard

Theme reported publicly: Isomorphic Labs, Google DeepMind

Answer it yourself first, out loud or on paper, then compare.

Answer

Model answer, written in a candidate's voice

In short

  • No as stated: bf16 weights ~140 GB leave ~20 GB on 160 GB, while KV for 32 x 32k is ~320 GiB
  • Weights: bf16 ~140 GB; FP8 ~70 GB; INT4 ~35–40 GB
  • KV: 2 (K,V) x 80 layers x 8 KV heads x 128 dims x 2 B = 320 KiB/token; 32 x 32,768 = 1,048,576 tokens = 320 GiB (160 GiB in FP8)
  • FP8 weights + FP8 KV ≈ 242 GB still exceeds 160 GB; four 80 GB GPUs fit
  • Tensor parallel splits matmuls (needs NVLink, helps latency); pipeline splits layers (bubbles, low bandwidth, spans nodes); data parallel replicates for throughput; expert parallel for MoE
  • Fixes: FP8 weights + FP8 KV, more GPUs, capped context, realistic length distribution, or fewer concurrent users

In full

No — not as stated. In bf16 the 70B weights alone are about 140 GB, leaving only about 20 GB across two 80 GB GPUs, while the KV cache for 32 concurrent users at 32k context is far larger. For a Llama-3-70B-like model (80 layers, 8 KV heads, head_dim 128) the cache needs about 320 KiB per token, so 32 users at 32k tokens is about 1M tokens and about 320 GiB.

Weights, bf16: 70e9 params x 2 B = 140 GB GPU memory: 2 x 80 GB = 160 GB -> 160 - 140 = 20 GB left KV per token: 2 (K,V) x 80 layers x 8 KV heads x 128 dims x 2 B = 327,680 B = 320 KiB Tokens: 32 users x 32,768 = 1,048,576 tokens KV, bf16: 1,048,576 x 320 KiB = 320 GiB (about 344 GB) KV, FP8: 320 GiB / 2 = 160 GiB (about 172 GB) FP8 weights + FP8 KV: 70 GB + 172 GB = about 242 GB > 160 GB -> still does not fit Four 80 GB GPUs: 320 GB -> fits, with about 78 GB for activations and overhead

FP8 weights cut the model to about 70 GB and INT4 to about 35–40 GB, but even FP8 KV only halves the cache to about 160 GiB, so two GPUs still cannot hold the worst case. Tensor parallelism splits each matmul across GPUs and helps latency, but it needs NVLink-class interconnect and does not shrink the total KV footprint. Pipeline parallelism splits the layers across GPUs, reducing per-GPU memory at the cost of pipeline bubbles; because it only passes activations between stages, it needs much less bandwidth than tensor parallelism and is the usual way to span nodes. Data parallelism replicates the whole model on each replica for throughput, which multiplies memory needs, and expert parallelism is the analogous split for MoE models. A realistic deployment would use FP8 weights and FP8 KV, more GPUs (four 80 GB GPUs hold the worst case above), a capped context length, and a measured length distribution rather than every user at maximum context: KV need scales with the tokens actually in flight, so if the average context is a quarter of the maximum, the cache need is a quarter too. Otherwise, serve fewer concurrent users.

Corrected by an independent AI reviewer.

What a strong answer covers

  • Weights: 70B × 2 B ≈ 140 GB in bf16 → almost no room on 160 GB; FP8 ≈ 70 GB; INT4 ≈ 35–40 GB
  • KV (Llama-3-70B-like: 80 layers, 8 KV heads, head_dim 128): ≈320 KiB/token; 32 × 32k ≈ 1M tokens ≈ 320 GiB → impossible as stated
  • Tensor parallel splits matmuls (needs NVLink, helps latency); pipeline parallel splits layers (bubbles, crosses nodes); data parallel replicates for throughput; expert parallel for MoE
  • Proposes changes: FP8 weights + FP8 KV, more GPUs, capped context, realistic length distribution rather than all users at max

Common mistakes

  • Sizing weights only
  • assuming every user sits at maximum context without discussing the distribution