跳到主要內容
AI 武林
影片進階EN1.6 萬 次觀看

How LLM Serving Actually Works

來源 Jia-Bin Huang人物 Jia-Bin Huang

看影片(在新分頁開啟原站)連到 YouTube・Jia-Bin Huang

摘要

深入解析大型語言模型推理伺服器如何處理百萬級請求,以 vLLM 與 SGLang 為例,詳述排程器、KV 快取、取樣器及模型運算的核心技術。內容涵蓋連續批次處理、分頁注意力、字首快取、結構化輸出、猜測性解碼、CUDA 圖最佳化以及多 GPU 張量並行與專家並行等關鍵機制,說明如何透過消除冗餘計算與最佳化記憶體管理來大幅提升吞吐量與效能。

This video explores the core techniques for building a performant LLM inference server, using vLLM and SGLang as examples to cover scheduling, KV cache management, sampling, and model optimization strategies like speculative decoding and multi-GPU parallelism.

摘要、重點與章節標題由語言模型整理,細節(誰說的、數字、先後)可能有誤;要引用請以原始內容為準。

重點

  • 利用連續批次處理與分頁注意力技術,解決記憶體浪費並提升 GPU 利用率。
  • 透過字首快取與意識型排程,避免重複計算共享提示詞以加速回應。
  • 結合結構化輸出、猜測性解碼與多 GPU 並行策略,全面最佳化推理效能。

章節

依話題轉折切分,標題由 AI 產生

  1. 00:00How does an LLM server handle millions of requests?
  2. 01:00The server: scheduler, KV cache, sampler, model
  3. 01:56Next-token prediction: why each step repeats work
  4. 04:31The KV cache: compute keys and values once
  5. 06:01Prefill vs decode: compute-bound vs memory-bound
  6. 07:53The scheduler: batching for throughput
  7. 08:59Continuous batching (Orca) and priorities
  8. 09:46Chunked prefill (Sarathi-Serve)
  9. 10:49Goodput and separate prefill/decode pools
  10. 11:58How much memory does the KV cache need?
  11. 13:02How operating systems manage memory: virtual memory
  12. 13:40PagedAttention: the KV cache in blocks
  13. 14:40Preemption: when the memory pool fills up
  14. 15:23Shared prefixes: system prompts, chats, agents
  15. 16:40Prefix caching: vLLM's hashed blocks
  16. 17:47RadixAttention: a radix tree of cached prefixes
  17. 19:03Eviction and HiCache: when the cache runs out
  18. 20:45Cache-aware scheduling: longest prefix first
  19. 22:56Results, and the catch: fairness
  20. 24:08Structured outputs: JSON, regex and state machines
  21. 25:28Compressed state machines and XGrammar
  22. 26:38Speculative decoding: draft, then verify
  23. 27:44Drafters: draft models, Medusa, EAGLE, n-gram
  24. 29:14Inside a decode step: FlashAttention
  25. 30:50Kernel launches and CUDA graphs
  26. 32:16torch.compile and overlap scheduling
  27. 33:18Fewer bytes: FP8 KV cache and quantization
  28. 34:14DeepSeek-V3 on 8 GPUs: tensor parallelism
  29. 35:13Latent attention and data-parallel attention
  30. 36:13Mixture of experts and wide expert parallelism
  31. 39:10Replicas and the cache-aware router
  32. 40:21Recap: never idle, never wasteful, never twice

提到的工具與公司

適合誰看

適合系統工程師、AI 基礎設施開發者或希望深入了解 LLM 推理伺服器內部運作原理的技術人員。

摘要依據

講者
Jia-Bin Huang
依據
人工字幕

為什麼排在這裡

人氣
0.59
新鮮
0.90

在主題頁與搜尋結果裡,名次由相關、人氣、新鮮三個分數決定;這一頁沒有搜尋的關鍵字,所以沒有相關分數。排序怎麼算

這個來源最近的內容

Jia-Bin Huang 的所有內容

摘要由 AI 根據原文產生,可能有誤;完整內容請看原站。看影片(在新分頁開啟原站)