Llm Inference Serving easy
A 70B model needs about 140 GB for its fp16 weights, but each server has one 80 GB GPU, and you want to avoid multi-GPU serving. Which approach is reasonable, and what is the tradeoff?
- A Keep fp16 and offload some weights to CPU RAM, which keeps full quality with only a minor slowdown in decoding.
- B Use smaller static batches, which reduces weight memory enough for the full fp16 model to fit on one GPU.
- C Quantize weights to 4-bit (about 35 GB), accepting a small quality loss that you verify on your own evals.
- D Quantize weights to 8-bit (about 70 GB), which fits with ample headroom left for KV cache at long contexts.
Answer: C. Quantize weights to 4-bit (about 35 GB), accepting a small quality loss that you verify on your own evals.
**4-bit quantization** trades a small, task-dependent quality loss for a 4x smaller weight footprint, leaving room for KV cache. It is not free, so you check it on your own evals. 8-bit is tempting but leaves only about 10 GB for KV, which long contexts quickly exhaust. It is the better pick when the GPU has more memory or contexts are short. CPU offload keeps quality but makes decoding far slower, because weights must cross the much slower PCIe link on every step.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- Your 70B-class model servers each handle about 40 concurrent chats with 4K-token contexts. Product raises the maximum context to 32K tokens, and many users start using it. What is the main capacity consequence?
- A 70B-class model (80 layers, grouped-query attention with 8 KV heads of dimension 128) is served in fp16 on one 8-GPU node with about 640 GB of total HBM. Product wants 256 concurrent sessions, each holding a full 32K-token context. What is the binding constraint, and what does it imply?
- Your server reserves a contiguous KV region sized for max_tokens = 8,192 for every request at admission, but the average sequence ends near 600 tokens. The node reports out-of-KV-memory at about 20 concurrent requests while GPU compute sits at 30%. Which change best raises concurrency without restricting legitimate long outputs?
- You must summarize 10 million documents overnight, and no user is waiting on any single result. How should you configure the serving stack compared with your interactive chat deployment?
- You serve a 7B-parameter model in fp16 (about 14 GB of weights) for a chat app. Users say single-conversation token generation is too slow, and you are choosing new GPU hardware. Which hardware spec most directly increases per-sequence decode speed?
- Your RAG workload sends 8K-token prompts and gets ~150-token answers from a 70B-class model. You plan to move prefill and decode onto separate GPU pools so long prefills stop stalling decode. What new resource must you size carefully?