使用deepspeed训练你的大模型
- 概述
- 可能的方式去训练大模型
- 决定使用什么技术
- 理解性能的权衡在zero 与 3D并行
作者:ygz
来源”https://www.deepspeed.ai/tutorials/large-models-w-deepspeed/、
时间:20230719
地点:hby
概述
deepspeed被用来训练或者是训练一些大模型的过程
Megatron-Turing NLG 530B language model trained in collaboration with NVIDIA
Big Science (near 200 billion parameter) model, in collaboration with Hugging Face and hundreds of researchers around the world.
Turing-NLG (17.2 billion parameters) trained by Microsoft
deepspeed 提供了一个系统级的技术,让训练这些模型得到可能。最佳的技术去训练大模型依赖于多样的因素,如:模型结构、批次、互联带宽等等。鉴于大量可用的选择,这是让人困惑的或者是令人烦躁的【调节参数】,这个页面是开始训练大模型的一个指南。
可能的方式去训练的大模型
1,ZERO,内存不够,使用更低一级的内存。
2,3D并行,算的不够,使用多块GPU来凑。
ZeRO based tech :这是一个数据并行的内存高效技术,允许你去访问你可用的所有GPU设备的内存。当没有zero技术,使用数据并行的时候就需要进行复制。deepspeed 也使用层次内存技术,ZeRO-Offload and ZeRO-Infinity,这能让你去使用cpu内存还有nv