Dev builds LLM inference engine from scratch, hits 2143 tok/s on RTX 3060 (~98% of vLLM)

udmrzn · x · 2026-12-03

A developer wrote an LLM inference engine from scratch to understand where vLLM and SGLang's speed comes from, recording every optimization in its own git commit so readers can follow the exact path.

Starting from 150 tok/s, the engine reached 2143 tok/s on a single RTX 3060 — about 98% of vLLM and SGLang's max throughput. An architecture diagram lays out the key optimizations: continuous batching with prefix caching and preemption, overlap scheduling, chunked prefill, ragged (CSR) batching, paged KV cache, FlashAttention, torch.compile, and decode-only CUDA graphs.

Original post →

More from Infra

Infra channel →