知识卡片
优化器内存依算法与实现
普通无动量SGD没有两组Adam状态,带动量SGD增加相应状态,Adafactor可因矩阵分解而减少某些二阶状态。内存应按具体配置和张量形状估算,不应把“每参数4字节”当这两种算法的统一规律。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
- · 微调
原书出处 · 1 处
- · 查看原书依据
Adafactor and SGD use four bytes of memory per parameter, while AdamW uses eight bytes per parameter. This means that a 7B model undergoing full fine-tuning with the AdamW optimizer requires 7 * 8 = ~56GB of memory to store the optimizer states alone. Even more memory is needed to store the parameters, gradients, and the forward activations.
参考来源
- 位置:《Designing Large Language Model Applications》第06章《微调》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Designing Large Language Model Applications/_epub-src/OEBPS/ch06.html)
- 结论依据:摘录中关于优化器内存依算法与实现的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。
- 原始内容:Adafactor and SGD use four bytes of memory per parameter, while AdamW uses eight bytes per parameter. This means that a 7B model undergoing full fine-tuning with the AdamW optimizer requires 7 * 8 = ~56GB of memory to store the optimizer states alone. Even more memory is needed to store the parameters, gradients, and the forward activations.