DLLXW / baby-llama2-chinese

用于从头预训练+SFT一个小参数量的中文LLaMa2的仓库;24G单卡即可运行得到一个具备简单中文问答能力的chat-llama2.
MIT License
2.34k stars 288 forks source link

多个节点多卡的pretrain #49

Closed lixin716 closed 6 months ago

lixin716 commented 6 months ago

请问作者这个能用多个节点多卡进行分布式训练吗,我用4个节点,每个节点两张gpu,但只有一个节点正常工作,另外几个节点的GPU并没有工作。

谢谢!

DLLXW commented 6 months ago

请问作者这个能用多个节点多卡进行分布式训练吗,我用4个节点,每个节点两张gpu,但只有一个节点正常工作,另外几个节点的GPU并没有工作。

谢谢!

应该是可以直接支持的,以下来源于llama2.c: To run on a single GPU small debug run, example: $ python -m train.py --compile=False --eval_iters=10 --batch_size=8

To run with DDP on 4 gpus on 1 node, example: $ torchrun --standalone --nproc_per_node=4 train.py

To run with DDP on 4 gpus across 2 nodes, example:

lixin716 commented 6 months ago

好的谢谢!