blog.dopana

Back

vLLM là open-source LLM inference & serving engine hiệu suất cao, ra đời từ UC Berkeley (SOSP 2023), Apache 2.0. Phiên bản mới nhất: v0.26.0 (7/2026). ~77.5k GitHub stars, 2.79M PyPI downloads/tuần. Là #1 OSS project theo contributors (GitHub Octoverse 2025).

PagedAttention — Đột phá cốt lõi#

PagedAttention quản lý KV cache giống như virtual memory của OS: chia thành fixed-size blocks, cấp phát/giải phóng động, copy-on-write sharing. Kết quả:

  • Lãng phí memory giảm từ 60-80% xuống <4%
  • Throughput cao hơn 24 lần so với naive HF Transformers serving
  • Prefix sharing: system prompt tính một lần, dùng lại cho mọi request

Tính năng chính#

Tính năngMô tả
Continuous batchingRequest mới vào batch đang chạy, không chết GPU cycles
Chunked prefillChia prompt dài thành chunk, không block decode
Prefix cachingGiảm 40% latency cho repeated system prompts
Tensor/pipeline/expert parallelismScale ngang 8+ GPUs
Speculative decodingEAGLE 3.1, DFlash — tới 2x throughput
Disaggregated prefill/decodeTách prefill và decode ra server riêng
KV cache quantizationFP8, NVFP4, INT8, INT4

Quantization hỗ trợ#

FormatImplementationHardware
FP8 (W8A8)Dynamic/static, per-token-group activationHopper+
NVFP44-bit float NVIDIA native (SM100+)Blackwell
MXFP4OCP Microscaling 4-bitBlackwell, Hopper
INT4 (AWQ/GPTQ)Marlin kernelsTuring+
INT8llm-compressor, staticAmpere+
KV cacheFP8, NVFP4, INT8, INT4Hopper+

Consensus 2026: BF16 → FP8 (Hopper) → NVFP4/MXFP4 (Blackwell).

Hardware#

  • NVIDIA CUDA: Volta → Blackwell (SM 7.0–12.0). Full features
  • AMD ROCm: MI300X, MI355X
  • Intel XPU: Arc Pro B-series
  • Google TPU: Plugin (PyTorch + JAX)
  • Apple Silicon: Plugin vllm-metal (MLX-based), ~525 tok/s M4 Max
  • CPU: x86/ARM/PowerPC/S390X
  • Huawei Ascend, AWS Trainium/Inferentia, IBM Spyre: Plugins

200+ kiến trúc model hỗ trợ trên Hugging Face.

Multi-modal#

Từ 2025-2026, vLLM mở rộng ra multi-modal:

  • Image: LLaVA, Qwen2.5-VL, Pixtral, Gemma3
  • Video: Qwen2.5-VL, Qwen3-VL
  • Audio: Whisper, Qwen2-Audio, Ultravox
  • Omni: Qwen3-Omni — interleaved audio+video

vLLM-Omni (11/2025) mở rộng thêm: Diffusion Transformers (DiT), TTS, non-autoregressive generation, heterogeneous outputs.

Serving features#

  • OpenAI-compatible API: /v1/chat/completions, /v1/completions, /v1/embeddings — drop-in replacement
  • Anthropic Messages API
  • Structured outputs: xgrammar + guidance. guided_json, guided_regex, guided_grammar
  • Tool calling: Hermes, Mistral, Llama3, Qwen, xLAM, Granite…
  • Multi-LoRA: Fused kernels cho dense + MoE layers
  • Realtime API: WebSocket streaming
  • vLLM Semantic Router: Multimodal routing, load balancing

Hiệu năng#

H100 single-GPU throughput (batch=32, FP16):

Engine7B13B70B
vLLM180 tok/s12050
SGLang16011045
TGI1409040
TensorRT-LLM280200100
llama.ccp862

Concurrent serving — Llama 3 70B (A100 80GB):

ConcurrentvLLMOllama
10~30 tok/s~15 tok/s
50~18 tok/s~4 tok/s
100~12 tok/sOOM
GPU mem utilization~96%60-70%
KV cache waste<4%40-60%

vLLM vs các giải pháp khác#

DimensionvLLMTGITRT-LLMSGLangllama.ccp
PagedAttention✅ NativePartialRadixAttention
ThroughputBaseline~78%2-3x peak~90-95%~5%
Cold start~62sFast~28min compile~58sInstant
HardwareĐa nền tảngCUDA/ROCmCUDA onlyCUDA/ROCmAll
OpenAI APIFull+AnthropicPartialVia TritonFullPartial
QuantizationFP8/FP4/INT4…Tương tựFP4/FP8/INT4Tương tựGGUF

Consensus 2026: Ưu tiên vLLM cho GPU serving. SGLang nếu heavy prefix sharing. TRT-LLM cho peak performance static. TGI chuyển sang maintenance mode.

Lịch sử phát triển 2025-2026#

Thời điểmSự kiện
1/2025vLLM V1 architecture rewrite
11/2025vLLM-Omni ra mắt — omni-modality
1/2026Streaming Requests, Realtime WebSocket API
3/2026P-EAGLE parallel speculative decoding
4/2026FP8 KV-Cache, RTX PRO 6000 NVFP4 — 6.5x throughput
5/2026EAGLE 3.1, Native RL APIs
7/2026v0.26.0 (PyPI)

Tài liệu tham khảo#