Stanford / CS349D已收录

AI Inference Infrastructure

围绕 AI 推理基础设施,理解模型服务中的性能与资源权衡。

关于这组笔记

个人自学讲义,参考公开课程材料与相关系统论文整理。

查看原课程资料

适合的起点

建议熟悉深度学习、计算机系统与基础并行计算。

本系列为个人学习整理,非学校官方发布,不代表学校或授课教师的认可或背书。

沿着目录阅读

当前 23 篇

预备知识

  1. 预备知识 1前置讲 P1 · GPU 与性能的第一性原理:从 roofline 到 Tensor Core 与数值格式 · GPU Performance from First Principles
  2. 预备知识 2前置讲 P2 · Transformer 推理的账本:参数、FLOPs、KV cache 与采样 · The Arithmetic of Transformer Inference
  3. 预备知识 3前置讲 P3 · 操作系统基础:调度、虚拟内存与分页、缓存与淘汰 · OS Basics for Inference Systems
  4. 预备知识 4前置讲 P4 · 排队论与性能评估:延迟、吞吐、尾延迟与实验方法 · Queueing & Performance Evaluation
  5. 预备知识 5前置讲 P5 · 分布式与通信基础:互连、集合通信与并行策略 · Distributed Systems & Communication

课程讲义

  1. Lecture 01Lecture 1 · 导论:为什么 AI 推理是一个系统问题 · Introduction: Why AI Inference Is a Systems Problem
  2. Lecture 02Lecture 2 · 批处理与调度:从 Clipper 的自适应批处理到 Orca 的迭代级调度 · Batching & Scheduling
  3. Lecture 03Lecture 3 · 推理引擎的显存与前缀复用:vLLM 的 PagedAttention 与 SGLang 的 RadixAttention · Serving Engines
  4. Lecture 04Lecture 4 · 高效注意力内核:FlashAttention 与 FlashInfer · Efficient Attention
  5. Lecture 05Lecture 5 · 推测解码:Speculative Decoding 与 SpecInfer · Speculative Decoding
  6. Lecture 06Lecture 6 · 并行:从 FlexFlow 的策略搜索到 Transformer 推理的分区 · Parallelism
  7. Lecture 07Lecture 7 · Prefill 与 Decode:分块 prefill、解耦与 NVIDIA Dynamo · Disaggregation
  8. Lecture 08Lecture 8 · 混合专家模型的推理:专家并行、MegaScale-Infer 与 Helix · Mixture of Experts
  9. Lecture 09Lecture 9 · 上下文管理:Mooncake、CacheGen 与 Strata · Context Management
  10. Lecture 10Lecture 10 · 混合架构与稀疏注意力:Mamba、Marconi 与 DeepSeek-V3.2 · Hybrid LLMs
  11. Lecture 11Lecture 11 · 负载均衡与路由:Preble 与 LLMSelector · Load Balancing & Routing
  12. Lecture 12Lecture 12 · 多租户与 GPU 共享:LithOS、Prism 与冷启动 · Multi-tenancy
  13. Lecture 13Lecture 13 · 智能体工作流:Parrot 与 Autellix · Agentic Workflows
  14. Lecture 14Lecture 14 · 记忆:MemGPT、mem0、Cartridges 与 ACE · Memory
  15. Lecture 15Lecture 15 · 强化学习的推理系统:HybridFlow 与 RLHFuse · RL Systems
  16. Lecture 16Lecture 16 · 案例研究:SGLang——从研究原型到生产推理引擎 · Case Study: SGLang
  17. Lecture 17Lecture 17 · 总结:拼出完整的迷你推理引擎,怎样评测它,以及开放问题 · Wrap-up

补充与延伸

  1. 附录 A附录讲 A · 量化与低精度推理 · Quantization & Low-Precision Inference

从讲义到代码

按课程目录整理的配套示例,保留各单元的文件结构。阅读讲义时,可以下载整套代码,在本地逐步探索。

下载 CS349D 代码

请在独立虚拟环境中查看依赖后运行;未附模型权重和运行产物;示例未逐一验证。

返回全部课程