跳过导航
I built an interactive simulator that shows why LLM inference capacity is hard.
0:00 / 2:20

I built an interactive simulator that shows why LLM inference capacity is hard.

Khushboo Verma

@khushbooverma_16万 位关注者

在 X 上查看
104 个赞下载原帖

25,217 次观看

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.

23 条评论

评论来自 X (Twitter) 上的原帖

  • Khushboo Verma 的头像

    @khushbooverma_

    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.

    13 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    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.

    5 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    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%.

    1 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    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.

    1 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    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

    1 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    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.

    2 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    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! 👀

    1 个赞

  • PsudoMike 🇨🇦 的头像

    @PsudoMike

    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.

    2 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    Yeah, complex systems

    1 个赞

  • Harnoor Singh 的头像

    @Harnoor29581982

    That’s a great explanation!

    2 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    glad you liked it :)

    1 个赞

  • Shivay Lamba 的头像

    @HowDevelop

    great visuals!

    1 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

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

    2 个赞

  • David Uche 的头像

    @daviduche03

    Nice stuff

    1 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    Thanks 🙏

    1 个赞

  • NoiselessTrading 的头像

    @neha041187

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

    1 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    Thanks :)

  • Aniket Maurya 的头像

    @aniketmaurya

    great explaination!

    1 个赞

  • Khushboo Verma 的头像

    @khushbooverma_

    Thank you :)

  • PsudoMike 🇨🇦 的头像

    @PsudoMike

    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.