ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

swift更新到最新版后无法使用多个节点训练

Open jhrsya opened this issue 1 year ago • 4 comments

Describe the bug What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图) 使用2024年7月1日之前的swift版本可以使用多个节点训练,但是更新到最新版的swift后发现无法使用多个节点训练。 使用类似如下命令:

# If the disk is not shared, please additionally specify `--save_on_each_node true` in the shell scripts on each machine.
# node0
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
NNODES=2 \
NODE_RANK=0 \
MASTER_ADDR=127.0.0.1 \
NPROC_PER_NODE=8 \
swift sft \
    --model_type qwen1half-32b-chat \
    --sft_type full \
    --dataset blossom-math-zh \
    --output_dir output \
    --deepspeed default-zero3 \

# node1
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
NNODES=2 \
NODE_RANK=1 \
MASTER_ADDR=xxx.xxx.xxx.xxx \
NPROC_PER_NODE=8 \
swift sft \
    --model_type qwen1half-32b-chat \
    --sft_type full \
    --dataset blossom-math-zh \
    --output_dir output \
    --deepspeed default-zero3 \

执行代码后发现,还是各跑各的。训练时间并没有降低

Your hardware and system info Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等)

cuda: 12.1 GPU: A800 torch: 2.1.2+cu121

Additional context Add any other context about the problem here(在这里补充其他信息)

jhrsya avatar Sep 18 '24 06:09 jhrsya

swift 2.0可以使用多个节点跑起来,更新到2.4版本后就无法用多个节点了

jhrsya avatar Sep 18 '24 09:09 jhrsya

具体是报了什么错呢

tastelikefeet avatar Sep 18 '24 16:09 tastelikefeet

具体是报了什么错呢

tastelikefeet avatar Sep 18 '24 16:09 tastelikefeet

具体是报了什么错呢

没报错,能直接跑,就是运行时间没有节省一半,跟用一个节点跑时间是一样的。之前用swift 2.0 是能节省一半时间的,同样的代码。

jhrsya avatar Sep 19 '24 02:09 jhrsya

这里的xxxx是你的main node地址吗

Vincent-Li-9701 avatar Oct 08 '24 02:10 Vincent-Li-9701

@jhrsya 大佬,请问解决了吗

manglu097 avatar Jul 09 '25 13:07 manglu097