Skip to content

About

vLLM and SGLang serving internals rebuilt from scratch and compared: paged vs radix KV cache, grammar masking vs jump-forward decoding.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

inference-serving

ci

How vLLM and SGLang make LLM inference fast, rebuilt from scratch and measured.

Path
inference-comparison vLLM's paged KV cache, prefix cache and grammar masking next to SGLang's radix cache and jump-forward decoding. Logits match a dense reference.
gpu-execution CUDA launch, sync and stream overlap measured on an L4.
disagg-prefill-decode vLLM + LMCache prefill on one GPU, decode on another.
bench Concurrency load tester for any OpenAI-compatible server.

Results

  • Radix vs block prefix cache. On a multi-turn workload, SGLang's radix cache prefills 275 of 942 prompt tokens; vLLM's block cache prefills 334.
  • Jump-forward decoding. A 32-byte JSON object takes 4 forward passes instead of 33, with identical output.
  • Batching knee. Llama 3.1 8B on an M4 Pro: throughput flattens past 4 concurrent requests while latency doubles.
  • Disaggregated prefill/decode. The pipeline runs and returns HTTP 200, but no KV crosses over. Why a 200 proves nothing here.
  • CUDA execution. A matmul launch returns in 0.09 ms; the kernel takes 12 ms. Two streams overlap but don't add throughput.

About

vLLM and SGLang serving internals rebuilt from scratch and compared: paged vs radix KV cache, grammar masking vs jump-forward decoding.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages