Zenaique

At batch 16 and 4k context with FP8 weights, which model still fits on one 80 GB H100?

MCQ·Medium·4.0 · 0·~1 min·Asked atNVIDIAQualcommRazorpay
Attempt it
TL;DR

On one 80 GB H100 at FP8, a 70B GQA model fits: weights consume ~70 GB and GQA shrinks the KV cache for B=16 / L=4k to fit the residual ~10 GB.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Think about packing a moving truck. The big furniture is the model weights, and the smaller boxes are the KV cache, one box per person riding along. An H100 is an 80-cubic-meter truck. A 70B FP8 model is furniture that fills about 70 cubic meters. You have 10 cubic meters left for the boxes. If the model uses GQA, the boxes are small (about an eighth the size), so 16 people's worth of luggage fits in those 10 meters. A 100B dense model is furniture that does not even fit before you start loading boxes. And a mixture of experts model is not like a truck where you only bring the experts you need today, the rules say every expert has to ride along because you do not know who will be needed when. Capacity planning is just: pack the heavy stuff first, count what is left, then check if the boxes fit.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Single-GPU capacity questions are a favorite of inference interviews because they force you to keep two costs in your head at once: the static cost of the model weights, and the dynamic cost of the KV cache that grows with how many tokens you are processing concurrently. Candidates who only size the weights look smart for the first sentence and then get caught by the second.

This question hands you an 80 GB H100, an FP8 precision target, and a working batch (16 sequences) and context (4k tokens). Four options are offered. Three of them get something wrong about how serving actually works. One of them, the 70B GQA model, is the deployment shape you would actually pick in production. Walking through why the wrong options are wrong is more instructive than walking through why the right one is right.

We will work the two-bucket budget end to end, then explain the architectural choices (GQA, MoE, MLA) that change the second bucket dramatically.

The two-bucket budget

Every inference deployment has the same headline equation:

HBM used=Weights+KV cache+Activations + scratch\text{HBM used} = \text{Weights} + \text{KV cache} + \text{Activations + scratch}

Weights are static. Once you pick a precision (FP16, FP8, INT4), the number is fixed for the entire deployment.

KV cache is dynamic. Every token in every active sequence contributes one K vector and one V vector per attention layer. The footprint scales linearly with batch and context.

Activations and scratch are smaller but not zero. PagedAttention block tables, FlashAttention shared-memory tiles, CUDA graph capture buffers, NCCL buffers in multi-GPU, all add up to a few GB in practice.

For an 80 GB H100, you have to fit all three. A clean way to triage any 'does it fit?' question is to write the two big numbers (weights, KV) on the back of a napkin, allow ~5 to 10 GB for scratch, and check the sum.

Sizing the weights at FP8
Sizing the KV cache (the part that catches people)
Why the distractors are wrong
What the question is really testing
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
Model + precisionWeight costFits on one H100 80 GB?Why
70B GQA-8, FP8 weights, FP16 KV~70 GBYes (tight)Residual ~10 GB holds KV for B=16, L=4k; KV quantization gives margin
70B dense MHA, FP8 weights~70 GBNo at B=16, L=4kKV without GQA is ~8x larger, blows the budget
100B dense, FP8 weights~100 GBNoWeights alone exceed 80 GB
13B GQA, FP8 weights~13 GBYes (large headroom)67 GB free for KV, easily handles batch 32+ at 4k
8x7B MoE, FP8 weights~52 GB total expert tableYes for the modelAll experts must be resident; can't stream active ones at decode

Real products, models, and research that use this idea.

  • Llama-3-70B FP8 on a single H100 80 GB: a routine deployment, viable precisely because of GQA group size 8 plus FP8 weights, with KV quantization often layered on top for headroom.
  • Llama-3.1-405B does NOT fit on a single H100 at any common precision; multi-GPU tensor parallel (TP=4 or TP=8) is the minimum, which is the practical capacity threshold.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QAt what batch size and context length does the KV cache start to dominate the weight footprint for Llama-3-70B?
A

Write KV per token in bytes (2 * N_layers * H_kv * d_head * bytes), multiply by batch and context, and compare against the 70 GB weight cost. With H_kv = 8, d_head = 128, N_layers = 80, FP16 KV is ~327 KB per token. KV overtakes weights once B * L exceeds roughly 220k tokens, e.g., B=32 at L=8k or B=8 at L=32k.

3 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Assuming MoE serving lets you stream in only the active experts at decode time. Production routing is per-token, so all experts must already be resident in HBM, MoE saves compute, not memory.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Recite the two-bucket capacity formula for fitting a model in HBM.

  • Approximate the FP8 weight size per parameter.

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is the KV cache in transformer inference?
Flashcard·Easy