← Back
Home › Systems › AI and ML infrastructure

llm-inference

LLM inference server

vLLM, TensorRT-LLM

SystemTechniques · 1Primitives · 37 llm-inference Prefill decode disaggregationml-training · medium: Running prompt prefill and token decode on separate GPU pools with KV-cache transferContinuous batchingml-training · low: Schedule LLM inference per iteration, not per request; finished sequences leave and new ones join the running batch every step, which keeps the GPU full.›Paged KV cacheml-training · low: Store each sequence's attention keys/values in fixed-size blocks mapped through a block table, like virtual memory pages; near-zero fragmentation and copy-on-write sharing.›Constrained decodingagentic-ai · low: Force LLM output to match a regex, JSON schema or grammar by masking, at every step, the tokens that would leave the language.›Prompt cachingagentic-ai · low: Reuse the attention keys/values of a repeated prompt prefix, so an agent's growing context is prefilled once and later turns pay only for the new tokens.›Attention variantsmachine-learning · low: Multi-head, multi-query, grouped-query, sliding-window and latent attention; same softmax(QKᵀ/√d)V core, different trade-offs between quality and KV-cache size.›Mixture of experts (MoE)machine-learning · low: Replace one FFN with many expert FFNs and a router sending each token to its top-k; parameters scale with E, per-token compute with k.›Cuda graphsml-training · low: Capturing a sequence of GPU kernel launches once and replaying it to remove CPU launch overheadFlashAttentionml-training · low: Exact attention computed tile by tile in on-chip SRAM with online softmax, so the N×N score matrix never touches HBM; 2-4x faster, O(N) memory.›Kernel fusionml-training · low: Merge chains of memory-bound GPU ops into one kernel, so intermediates stay in registers instead of round-tripping through HBM.›Lora adaptersml-training · low: Low-rank adapter matrices for fine-tuning; QLoRA; serving many adapters on one base modelToken samplingml-training · low: Turn a vector of scores into one chosen item with temperature, top-k, top-p, min-p, repetition penalties and a seed.›Speculative decodingml-training · low: A cheap draft proposes γ tokens, the big model verifies them in one pass, and rejection sampling keeps the target's exact distribution at 2-3x speed.›Tensor parallelismml-training · low: Split each layer's weight matrices across GPUs (Megatron-style column then row splits) so one layer's math runs on t devices with one all-reduce per block.›Tiled matrix multiplicationml-training · low: Block GEMM into tiles held in shared memory and registers, so each byte loaded from DRAM feeds many FMAs; the core of fast GEMM.›Weight quantizationml-training · low: Store weights as 8/4-bit integers with per-group scales; decode is memory-bound, so 4-bit weights give about 3-4x tokens/s and fit 4x larger models.›Server-sent eventsnetworking · low: One long-lived HTTP response carries text events one way; each event may carry an id, so a reconnecting client names its last one and the server resumes.›+ 21 more primitives

Similar systems

Share the most building blocks with this one.