R180 · AI education › Teaching materials and glossaries

Serving Trace Lab: an interactive simulator for LLM batching and KV-cache memory

Read the original

Authors Pallavi Ahuja

teachinginferenceserving

Sources: Pallavi Ahuja's LinkedIn post announcing the tool; the simulator itself at serving-trace-lab.base44.app. It is an explainer, not a benchmark; the author says so explicitly.

What it is

A browser simulator that steps an LLM server through its scheduling loop one iteration at a time. Requests with different prompt and output lengths arrive, go through prefill (reading the prompt) and decode (emitting tokens), and occupy KV-cache blocks. You can follow one request, pause and step, and compare policies side by side. The modes cover static versus continuous batching, whole versus chunked prefill, and reserved versus paged KV allocation, including what happens when KV memory runs short.

The concepts it makes visible

How to use it for teaching

  1. Start with static batching and one long request among short ones; ask learners to predict when the short ones finish.

  2. Switch to continuous batching on the same workload and compare the arrival timeline.

  3. Add a long document prompt with whole prefill, watch streaming answers stall, then switch to chunked prefill.

  4. Shrink KV memory and compare reserved with paged allocation to show why paging became standard.

Limits

Review checklist when reasoning about a real serving setup

  1. Is the workload prefill-heavy (long prompts, RAG, agents) or decode-heavy (long outputs)?

  2. Is continuous batching on, and what is the maximum concurrent batch size?

  3. Is chunked prefill enabled, and what chunk size trades time-to-first-token against stream smoothness?

  4. Is KV allocation paged, and what happens on memory pressure: preempt, swap or recompute?

  5. Are latency targets stated separately for time-to-first-token and inter-token latency?

Cited in field guides

Connections

See R180 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.