WhoBuilt

System Design for Next-Gen Frontier Models

Feb 11, 2025· 18 min· 6.8K views·Watch on YouTube

Speaker

Dylan Patel of SemiAnalysis explains inference systems for large frontier models at AI Engineer.

Why inference is a systems challenge

Patel argues that recent model releases have not yet shown a major capability leap because many are smaller models trained for longer. He says a 1.8-trillion-parameter model is expensive to run, and that even a 200-billion-parameter model can require nearly 600 gigaflops per token.

Prefill and decode have different costs

Prefill processes the prompt and is compute-intensive: Patel estimates a 2,000-token prompt takes a petaflop, while a 32,000-token prompt takes 20 petaflops. Decode generates tokens one at a time and is memory-bandwidth intensive because the model weights must be loaded. For a 1.8-trillion-parameter model, he estimates 30 tokens per second for 64 users would require 60 terabytes per second of bandwidth, compared with about three for an H100.

Serving large models efficiently

Patel says serving Llama 3 405B requires inference systems beyond llama.cpp, pointing to TensorRT-LLM and vLLM as options. Continuous batching lets a service add requests as others are still running, improving accelerator use; running at batch size one in the cloud could cost 10 to 100 times more. Disaggregated prefill assigns prompt processing and token generation to separate accelerator groups, which can help manage latency and service reliability.

Cache long contexts to reduce repeated work

Patel describes context caching as a way to reuse a prompt's KV cache instead of recomputing it for every request. This can help applications such as contract review, where a large document is sent repeatedly and output is comparatively small. He says storing these caches takes substantial memory, so systems such as vLLM are working on storing them in CPU memory or storage.

Large clusters bring reliability problems

Patel says labs are building clusters with around 100,000 GPUs, capable of far more training compute than the systems used for GPT-4. At that scale, optical link failures could occur every few minutes, and differences in GPU performance can slow synchronous training. He cites a ByteDance paper reporting a 25% slowdown on a 20,000-GPU cluster caused by one slower GPU.

Takeaways

  • Profile prompt processing and token generation separately because they stress different hardware resources.
  • Use continuous batching to improve accelerator utilization when serving concurrent users.
  • Consider separating prefill from decode when service volume makes latency and workload isolation important.
  • Cache repeated long contexts to avoid paying to recompute their KV state on each request.
  • Plan for hardware failures and stragglers as cluster size grows; a single slow GPU can affect the whole training job.

Mentioned in this talk

Search inside this talk

What was claimed 17

  • works at
    analyst
    “Dylan Patel, SemiAnalysis”
    YouTube
    Unverified2 sources· Talk
  • metric
    GPT-4: About 1.8 trillion parameters
    “GPT-4 is like 1.8 trillion parameters.”
    YouTube
    Unverified1 source· Talk
  • metric
    H100: About 3 terabytes per second of memory bandwidth
    “An H100 has about three.”
    YouTube
    Unverified1 source· Talk
  • metric
    GPT-3.5: $15 per million output tokens and $5 per million input tokens
    “it's $15 per million tokens for output and $5 per million tokens for input”
    YouTube
    Unverified1 source· Talk
  • metric
    GPT-4o: $15 per million output tokens and $5 per million input tokens
    “it's $15 per million tokens for output and $5 per million tokens for input”
    YouTube
    Unverified1 source· Talk
  • feature
    vLLM: Works on AMD and Intel
    “vLLM, which works on AMD and Intel”
    YouTube
    Unverified1 source· Talk
  • feature
    TensorRT-LLM: Works only on NVIDIA
    “TensorRT-LLM, which only works on NVIDIA”
    YouTube
    Unverified1 source· Talk
  • feature
    Llama 3 405B: Cannot be run with llama.cpp as described; requires more capable inference support
    “You can't just run llama.cpp on Llama 3 405B; it's just not going to work.”
    YouTube
    Unverified1 source· Talk
Show all 17 facts

Related talks