Add instructions

dev_multi_gpu
duzx16 2023-04-15 11:05:12 +08:00
parent 8633db1503
commit c34ad40092
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ bash train.sh
在默认配置 `quantization_bit=4`、`per_device_train_batch_size=1`、`gradient_accumulation_steps=16` 下INT4 的模型参数被冻结,一次训练迭代会以 1 的批处理大小进行 16 次累加的前后向传播,等效为 16 的总批处理大小,此时最低只需 6.7G 显存。若想在同等批处理大小下提升训练效率,可在二者乘积不变的情况下,加大 `per_device_train_batch_size` 的值,但也会带来更多的显存消耗,请根据实际情况酌情调整。
如果你想要[从本地加载模型](https://github.com/THUDM/ChatGLM-6B#%E4%BB%8E%E6%9C%AC%E5%9C%B0%E5%8A%A0%E8%BD%BD%E6%A8%A1%E5%9E%8B),可以将 `train.sh` 中的 `THUDM/chatglm-6b` 改为你本地的模型路径。
#### Finetune
如果需要进行全参数的 Finetune需要安装 [Deepspeed](https://github.com/microsoft/DeepSpeed),然后运行以下指令: