vllm

22 posts

LLMS EXPLAINED · 0348 LAYERS · 3 LINEAR : 1 SPARSE1/9TRAINING FLOPS

Qwen3.8-Flash-Next, Layer by Layer

Qwen's preview of its next architecture, piece by piece: linear and sparse attention, a gated four-branch residual, 512 experts and an n-gram memory, and what each costs to serve.

REQUEST TO TOKENS · 06

Paged Attention: Virtual Memory for the KV Cache

How serving engines hand out KV cache memory in 16-token blocks instead of reserving the maximum, how the same blocks let requests share a prompt, and what that saves in memory and time to first token.

INFERENCE ENGINES · 01MANY USERSYOUR MACHINEONE TARGET

Choosing an Inference Server: The Landscape, from Data Centers to Laptops

Inference servers in three groups: production engines and their stacks, local apps built on llama.cpp, and enthusiasts' specialized engines, with how to pick.

REQUEST TO TOKENS · 01PROMPT · ONE PASSANSWER · ONE PASS PER TOKENFIRST TOKEN 82 ms · THEN 73 ms EACH

From Prompt to Token: The Life of an LLM Request

One chat request followed through a real inference server, from chat template and tokens to prefill, decode, sampling, and streaming, each stage timed.

REQUEST TO TOKENS · 07ONE PIECEIN CHUNKSWORST STALL 7.6 s → 0.22 s

Chunked Prefill: Trading First-Token Time for Smooth Streaming

How engines split long prompts across steps, what the per-step token budget trades between time to first token and time per token, and how to set it.

REQUEST TO TOKENS · 02PREFILL · ALL TOKENS, ONE PASSDECODE · ONE TOKEN PER PASS0.20 ms vs 74 ms PER TOKEN

Prefill vs. Decode: Why the Second Token Is a Different Workload

Why a prompt token costs hundreds of times less than an answer token on the same weights: prefill and decode, seen in a kernel trace.

REQUEST TO TOKENS · 03144 KiBPER TOKEN36 LAYERS × KEY, VALUE

The KV Cache, Sized: What the Formula Says and What Your Engine Gives You

Compute what each token of KV cache costs from a model's config, then predict the capacity vLLM reports at startup, and see where the two differ.

REQUEST TO TOKENS · 054 SLOTS, REFILLED AT EVERY STEP

Continuous Batching, Animated: How a Server Keeps the GPU Busy

Why serving engines re-form the batch at every decode step, what it buys in throughput and latency, and the settings that control it.

REQUEST TO TOKENS · 08VALID ANSWERS: 7 → 199 OF 200

Structured Output: How Engines Force Valid JSON, Token by Token

How vLLM and SGLang guarantee valid JSON or a grammar: compiling a schema into a token mask, applying it at every step, and what it costs in latency and quality.

REQUEST TO TOKENS · 09DRAFTVERIFY2.9× FASTER, SAME OUTPUT

Speculative Decoding from First Principles

How a cheap guess and one verification pass produce several tokens per step, when it speeds things up and when it does not, measured.

REQUEST TO TOKENS · 10ABFIRST TOKEN: 2.26 s → 0.28 s

Prefix Caching: When It Pays and How to Design Prompts for It

Why a repeated prompt can cost almost nothing, how vLLM and SGLang find shared prefixes, what breaks a hit, and how to structure prompts for agents and chat.

QUANTIZATION · 012.7×DECODE VS BF1616 FP4 VALUES PER BLOCK, ONE SCALE EACH

NVFP4 on Blackwell: Serving a 4-Bit Model End to End

What NVFP4 stores, how vLLM serves it on Blackwell, and what it changes in memory, speed, and quality.

QUANTIZATION · 05

GPTQ, Explained and Run

How GPTQ trades weight error for output error, in 30 lines of PyTorch on a real layer, then how to run it with llm-compressor and serve it with vLLM, and which settings actually change the result on Qwen3-8B.

QUANTIZATION · 06INPUT SIZEWEIGHT COLUMNSSCALED UP BY s1% OF CHANNELS, CHOSEN BY THEIR INPUTS

AWQ: Protecting the Weights That Matter

Which 1% of weights matter, why scaling them protects them, and the search behind AWQ, in a few lines of PyTorch on a real layer, then AWQ on Qwen3-8B with llm-compressor and vLLM against plain rounding, GPTQ and a published checkpoint.

QUANTIZATION · 07ACTIVATIONS÷ sSMOOTHEDMAX 17.5 → 1.32, PRODUCT UNCHANGED

SmoothQuant and W8A8: Quantizing Activations Too

Why activation outliers break INT8, how SmoothQuant moves them into the weights, and what it changes for FP8 W8A8, measured on Qwen3-8B with vLLM.

QUANTIZATION · 08ONE TOKEN× QROTATEDOUTLIER 29.8× → 2.1×, PRODUCT UNCHANGED

Rotations for 4-Bit Activations: QuaRot, SpinQuant, and Friends

A rotation flattens activation outliers and, on real layers, rescues INT4 activations. On Qwen3-8B in NVFP4, it cost 5 GSM8K points instead.

QUANTIZATION · 10BF16 · 498K TOKENSFP8 · 975K4-BIT · 1.84MSAME TOKENS, FEWER BYTES

Quantizing the KV Cache: FP8 and Below

Seven KV cache formats in vLLM, from FP8 to 3-bit, on one model: how many more tokens fit, what long-context recall loses, and why speed follows the kernel.

QUANTIZATION · 13BF16QUANTIZEDSAME SCORE, DIFFERENT ANSWERS

Measuring the Damage: Evaluations That Catch Quantization Errors

GSM8K said every 4-bit format matched BF16. A noise baseline, paired comparisons, token-level KL, and a code benchmark showed which ones did not.

SERVING IN PRODUCTION · 01PREFILLKV CACHEDECODE

Disaggregated Serving: Dynamo, llm-d, and When Splitting Prefill from Decode Pays

Why production stacks run prefill and decode on separate GPUs, how NVIDIA Dynamo and llm-d move the KV cache between them, and when the split pays.

SERVING IN PRODUCTION · 02QUIET · FIRST TOKEN, THEN A STEADY STREAMLOADED · LONGER WAIT, LONGER GAPSTHROUGHPUT UP, GOODPUT DOWN

TTFT, ITL, Goodput: Measuring What Users Feel

What TTFT, TPOT, ITL, end-to-end latency, and goodput each measure, how the tools compute them, and why peak throughput is the wrong target.

SERVING IN PRODUCTION · 03SAME BENCHMARK,THREE RUNSMEDIAN TTFT 819 · 1,132 · 894 MS

Benchmark an Inference Server Without Lying to Yourself

Common load-test mistakes made on purpose next to the correct run, on one vLLM server, so each rule comes with how far it moves the numbers.

SPEECH AI · 01

Speech Recognition with Whisper on vLLM: Mel Spectrograms, Streaming, and Who Spoke When

How Whisper turns audio into text, from mel spectrograms to an encoder-decoder; serving it with vLLM, transcribing in real time, and labeling speakers.