AI 系统性能工程方法论
第7章:PyTorch Profiling 与 Tuning
torch.compile / TorchInductor / CUDA Graph / TF32-AMP-FP8 决策树、PyTorch profiler 实战——性能工程师视角的框架级调优(待补)
PyTorch torch.compile TorchInductor CUDA Graph AMP FP8 占位
⚠️ 本章正文待补。原书 AI Systems Performance Engineering(Chris Fregly, O’Reilly 2025)的 Early Release 版本中,Ch7 标记为 unavailable。等正式版释出或获取等价资料后再补完整正文。
章节定位
模块零方法论在 PyTorch 框架层的落地。CUDA kernel 写得再好,框架调度不对也跑不快。
计划覆盖的内容
- PyTorch Profiler + TensorBoard 看时间线
- torch.compile 工作机制(Dynamo + AOTAutograd + Inductor)
- 何时开 CUDA Graph、何时不开
- TF32 / BF16 / FP16 / FP8 精度决策树
- AMP(Automatic Mixed Precision)默认策略与坑
- Memory snapshot 与 OOM 排查
- channels_last 内存布局对卷积的影响
- DataLoader pin_memory / prefetch_factor 调参
- 第 10 章 MobileEye 案例的 5 步实验法详解
在补完之前请参考
📚 参考资料
- AI Systems Performance Engineering (Chris Fregly, O’Reilly 2025):learning.oreilly.com —— 待原书 Ch7 释出
- PyTorch Profiler Recipe:pytorch.org/tutorials/recipes/recipes/profiler_recipe.html
- torch.compile 文档:pytorch.org/docs/stable/torch.compiler.html