Jia-Bin Huang releases a 9-episode, 230-minute "AI Training and Inference" training-and-inference video series
English text is being prepared.
Jia-Bin Huang (@jbhuang0604) produced the 9-episode, roughly 230-minute "AI Training and Inference" video series, covering the fundamentals of foundation model training and inference. Shao Meng went through the content of each episode in order: ZeRO and FSDP, five-dimensional parallelism (including the example of Llama 3's 16384-GPU layout), LoRA and its variants, speculative decoding, on-policy distillation, from PPO to GRPO, AdamW, and Muon and MuonClip; Episode 9, LLM Serving, is members-only content. Among these, fine-tuning a 70B-scale model on a single 48GB GPU with QLoRA, and Muon's compute efficiency being about twice that of AdamW, are both claims made by the speaker in the videos.
Why read this
AI score 63
This content strings the 9-episode training-and-inference course into a learning path in the order of memory, parallelism, fine-tuning, decoding, distillation, RL, and optimizers, making it easy to follow step by step.
Topics
View original postI'm building a playlist/course for LLM training and inference (WIP). https://t.co/0JdUqjiiQm So far, we have common topics like distributed training, fine-tuning, RL, OPD, serving, spec. decoding, and basic optimizers. What else should I include to make this more complete? 🤔
View original
I'm building a playlist/course for LLM training and inference (WIP). https://t.co/0JdUqjiiQm So far, we have common topics like distributed training, fine-tuning, RL, OPD, serving, spec. decoding, and basic optimizers. What else should I include to make this more complete? 🤔
Body
9集、230分钟 @jbhuang0604 系列视频「AI Training and Inference」把基座模型训练和推理基础讲清楚了,覆盖整个训推架构:单卡显存 → 千卡并行 → 便宜微调 → 推理加速 → 小模型蒸馏 → 推理 RL → 优化器(AdamW→Muon)
这个训推系列的串联逻辑 先解决「模型塞不进一张 GPU」,再用五维并行铺到万卡级;然后 LoRA 系把适配成本压下来;推理侧用投机解码在不改输出分布的前提下加速;能力压缩走 on-policy 蒸馏;推理能力用从 PPO 到 GRPO 的 RL 线;最后回到优化器基线与 Muon。服务侧(KV cache、调度等)放在最后第 9 集。 https://t.co/guGpu2DlaP
1. ZeRO & FSDP(约 23 分钟) 浮点与混合精度如何吃显存;数据并行会复制优化器状态与梯度。ZeRO-1/2 切优化器与梯度,ZeRO-3 再切权重;FSDP 是同一套分片日程在 PyTorch 里按模块落地。
2. 五维并行(约 40 分钟) 纯数据并行不够时,沿数据 / 张量 / 序列·上下文 / 流水线 / 专家切开。张量并行的行列切与 all-reduce;上下文并行与 ring attention;流水线从 GPipe、1F1B 到 zero-bubble / DualPipe;MoE 的 all-to-all;并以 Llama 3 的 16384 GPU 布局作示例,给出排并行的「小抄」三步。
3. LoRA 与变体(约 21 分钟) 冻住 W0W_0W0,学低秩 ΔW=BA\Delta W=BAΔW=BA;初始化常用随机 A、零 B。LoRA+ 给 A/B 不同学习率;QLoRA 用 NF4 等把骨干量化、适配器仍高精度(字幕称可在单卡 48GB 上微调 70B 量级,为讲者表述);VeRA 共享冻结随机基、只训缩放;DoRA 拆幅度与方向。
4. 投机解码(约 25 分钟) 小草稿模型往前猜,大模型并行验证;拒绝采样保证与目标模型同分布。再展开 draft tree、Medusa、MTP、EAGLE 系列与 DFlash / DFlash 2。
5. On-policy 蒸馏(约 31 分钟) 软标签与「暗知识」→ 序列级蒸馏;曝光偏差;on-policy RL 奖励稀疏。On-policy distillation:学生用自己的轨迹,仍拿教师的稠密指导;并强调 KL 方向;应用提到推理、个性化、数据复用与自蒸馏。
6. GRPO(约 23 分钟) 从 REINFORCE、baseline/价值、GAE、Actor-Critic、TRPO/PPO(尤其 clip)推到 GRPO:同一题采一组回答,组内归一化奖励当优势,整段共用优势、可不另训 value;相对参考策略加 KL。Dr. GRPO 去掉长度归一与标准差除法,减轻「对了就变短、难了优势被放大」等偏差。视频将其与 DeepSeek-R1 类推理训练挂钩。
7. AdamW(约 7 分钟) SGD → 动量 → RMSProp → Adam;Adam 把衰减和自适应步长缠在一起会伤泛化;AdamW 解耦 weight decay,成为长期默认。
8. Muon / MuonClip(约 18 分钟) 线性层动量矩阵近低秩,稀有方向更新弱;Muon 用 Newton–Schulz 等把动量矩阵正交化(讲者称相对 AdamW 算力效率约高一倍,为片中说法)。大规模时配合衰减与按矩阵尺寸调学习率;注意力 logit 爆炸用 QK-clip,MLA 场景延伸为 MuonClip。
9. LLM Serving(约 42 分钟) 会员内容,如果前面 8 集看完觉得有需要,朋友们自行学习。