KatInterview

Speeding Up a 175B-Parameter LLM Serving Cluster

Machine LearningModel answer
MediumModel answerMachine Learningllm-servingkv-cachequantization

Last updated

Diagnose and fix low GPU utilization and high latency in a large transformer serving fleet, covering KV cache memory, compute efficiency and multi-node communication.

Situation

Your team runs inference for a 175-billion-parameter decoder-only transformer on a multi-GPU cluster. During busy periods, users see slow responses, yet monitoring shows the GPUs are far from saturated.

Your task

Walk through how you would find out where the time is going, then lay out a prioritized plan to raise throughput and cut latency. Cover three areas:

  1. Memory: How you would keep the key-value (KV) cache under control as sequences grow token by token.
  2. Compute: How you would make each transformer layer run faster.
  3. Communication: How you would limit the cost of synchronization when the model spans several GPUs or nodes.

What a good answer includes

  • At least three distinct optimization techniques (for example kernel fusion, quantization, paged cache allocation, or a parallelism scheme).
  • A short trade-off discussion for each one, covering accuracy, latency and memory use.
  • A profiling plan that shows how you would confirm each change actually helped.

State any assumptions you make about hardware, traffic mix and latency targets, and support your reasoning with rough numbers where you can.

Hints

Hint 1

Before proposing fixes, do a back-of-envelope calculation: how many bytes are the weights, how large is the KV cache per token, and is token-by-token decoding limited by memory bandwidth or by arithmetic?

Hint 2

Low utilization combined with high latency under load often means batches are small or memory is wasted. Think about how requests are scheduled and how cache memory is allocated before reaching for model-level tricks.

Hint 3

Rank techniques by payoff and risk: lossless ones (scheduling, paged cache, exact attention kernels, fusion) first, then lossy ones (quantization), then communication tuning. Verify each with a replayed traffic trace and a throughput-versus-tail-latency curve.