Video wird geladen...
Video konnte nicht geladen werden
I built an interactive simulator that shows why LLM inference capacity is hard. Batching, queues, KV cache, GPU decode, priority tiers - all coupled. Change one knob and the bottleneck moves.
25,217 Aufrufe • vor 4 Monaten •via X (Twitter)
23 Kommentare

The core problem: GPUs hate serving one request at a time. Decode is memory-bandwidth-bound, every forward pass streams the whole model's weights from memory to produce... one token. Serve requests sequentially and your $40k GPU idles between tokens.

The fix: batching. One forward pass = one next token for EVERY sequence in the batch. 16 requests, one pass, 16 tokens. The weight reads are shared, so step cost grows much slower than batch size. Throughput is almost free. Almost.

But requests finish at different lengths. Static batching strands empty slots until the longest sequence finishes, wasted bandwidth every step. Continuous batching backfills each slot the moment it frees, between decode steps. Utilization goes from ~60% to ~95%.

And priority tiers make it worse. Strict priority is great for enterprise traffic and starves free-tier users forever under load. Real schedulers bound starvation: weighted fair queueing, max-wait promotion, reserved slots.

The part nobody tells you: the bottleneck doesn't stay put. Long prompts? Prefill steals decode time → inter-token latency spikes Long outputs? Decode-bound → queues explode Small KV cache? Memory blocks admissions while GPUs sit idle Few CPU workers? GPUs starve

So I built a simulator where you can watch all of this happen. ⚙️ Tune request rate, token distributions, GPUs, batch size, wait deadline, tier mix, SLOs, see throughput, TTFT, p99 and a live "current bottleneck" banner respond instantly.

7 one-click failure scenarios included: - decode saturation - prefill storm - CPU starvation - batching tradeoff - tier starvation - KV cache crunch Each one teaches a different capacity lesson in ~10 seconds. Try now! 👀

KV cache fragmentation is what actually surprises engineers the first time. You've got headroom in theory, but contiguous memory requirements choke it. Spent two weeks tuning batch sizes before realizing the bottleneck was cache eviction, not GPU utilization.

Yeah, complex systems

That’s a great explanation!

glad you liked it :)

great visuals!

Thanks, so far, haven't had much luck in video generation using AI models, this one turned out nice

Nice stuff

Thanks 🙏

Insanely well done,! 🙌 The interactive simulator + failure scenarios make LLM serving concepts finally click. Super valuable tool!”

Thanks :)

great explaination!

Thank you :)

Seen this in payments. Optimize auth latency and now settlement throughput is the ceiling. Fix settlement, reconciliation piles up. Every component looks fine in isolation. You only see the coupling when one part starts to scale and the others don't follow.

The KV cache piece is what gets people. Adding more GPUs sounds like the fix but long sequences fill KV memory fast. You end up memory bound before you're ever compute bound. What latency targets are you modeling at different request rates?

Khushboo, I DMed you something. Can you please check? I think it's in the request tab.

The moving bottleneck aspect is underrated. A lot of engineering intuition assumes "find bottleneck -> optimize bottleneck." In serving systems, fixing one bottleneck often just reveals the next one.
