问题:fused_adam/fused_adam.so: cannot open shared object file: No such file,fused_adam是deepspeed中一个需要编译的组件
解决:下载deepspeed源码编译
git clone https://github.com/microsoft/DeepSpeed.git
cd deepspeed
# 指定需要编译的fused_adam
DS_BUILD_CPU_ADAM=1 pip install -e .
问题:使用torchrun无法使用conda的虚拟环境
解决:激活虚拟环境后使用python -m运行
python -m your_script.py
问题:torchrun运行时报错[‘local_rank’=0]
解决:使用torch.distributed.run代替torchrun
可能的原因是transformers版本过高
#之前
torchrun finetune.py
#之后
torch.distributed.run finetune.py