Efficient ML Inference at Scale
学习大规模机器学习推理中的计算、内存与并行策略。
关于这组笔记
个人自学讲义,参考 CS349E / EE339 的公开课程材料与相关论文整理。
查看原课程资料适合的起点
建议熟悉深度学习、计算机体系结构与并行计算。
本系列为个人学习整理,非学校官方发布,不代表学校或授课教师的认可或背书。
沿着目录阅读
当前 21 篇预备知识
- 预备知识 1前置讲 P1 · 计算机体系结构入门:从指令到存储层次 · A Computer Architecture Primer
- 预备知识 2前置讲 P2 · 并行编程与 GPU 编程模型 · Parallel Programming and the GPU Programming Model
- 预备知识 3前置讲 P3 · 数值表示与舍入误差 · Number Representation and Rounding Error
- 预备知识 4前置讲 P4 · 编译器入门 · A Gentle Introduction to Compilers
- 预备知识 5前置讲 P5 · 网络与集合通信 · Networks and Collective Communication
课程讲义
- Lecture 01Lecture 1 · 导论:效率、能量与 roofline · Introduction: Efficiency, Energy, and Rooflines
- Lecture 02Lecture 2 · Transformer:从词向量到注意力,以及它的计算账本 · Transformers: From Word Vectors to Attention, and Their Arithmetic
- Lecture 03Lecture 3 · 精度、量化与稀疏 · Accuracy, Quantization, and Sparsity
- Lecture 04Lecture 4 · 分布式推理:切分矩阵与 Transformer 的并行 · Distributed Serving
- Lecture 05Lecture 5 · 解耦式推理:prefill / decode 分离与异构硬件 · Disaggregated Serving
- Lecture 06Lecture 6 · 优化自回归 decode:连续批处理与投机解码 · Optimizing Autoregressive Decode
- Lecture 07Lecture 7 · KV cache 管理:PagedAttention 与 Mooncake · KV Cache Management
- Lecture 08Lecture 8 · 硬件引擎:GPU 的 SM 与 Tensor Core、TPU 的脉动阵列 · Hardware Engines
- Lecture 09Lecture 9 · 硬件性能建模:循环嵌套、数据流与 Interstellar · Modeling Hardware Performance
- Lecture 10Lecture 10 · 内核开发:从朴素矩阵乘法到分块、流水与 Tensor Core · Kernel Development
- Lecture 11Lecture 11 · 内核优化技术:FlashAttention、flash-decoding 与 megakernel · Kernel Optimization Techniques
- Lecture 12Lecture 12 · ML 编译器(前端):抓图、中间表示与图级优化 · ML Compilers: Frontends
- Lecture 13Lecture 13 · ML 编译器(内核生成):调度语言、多面体、自动调优与稀疏编译 · ML Compilers: Kernel Generation
- Lecture 14Lecture 14 · 智能体生成内核:KernelBench 与 AlphaEvolve · Agentic Kernel Generation
- Lecture 15Lecture 15 · 智能体的工具使用:反馈、接口与推理系统 · Agentic Tool Use
- Lecture 16Lecture 16 · 总结与课程项目:全栈复盘、部署规划与怎样做一个推理系统项目 · Wrap-up & Course Project
从讲义到代码
按课程目录整理的配套示例,保留各单元的文件结构。阅读讲义时,可以下载整套代码,在本地逐步探索。
下载 CS349E 代码请在独立虚拟环境中查看依赖后运行;未附模型权重和运行产物;示例未逐一验证。