modelscope / modelscope/ms-swift

qwen3-4b-base多机多卡继续预训练时hang住

Open
#6,867 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
Python
Stars
15.7k
Forks
1.7k
Avg merge
1d 16h
Merged PRs (30d)
136

Description

环境:2机,每台机器2张H20,单机4卡时可以正常训练
命令:
node 0 的命令:
torchrun --nnodes=2 --node_rank=0 --nproc_per_node=2 --master_addr=2605:340:cd51:4b00:9b86:912c:6586:d4d0 --master_port=10217 ./swift_pt.py --model ./workdir/base_model --model_type qwen3 --dataset ./workdir/dataset/shuffled_dataset.jsonl --output_dir ./workdir/swift_output --dataloader_num_workers 10 --dataset_num_proc 10 --attn_impl flash_attn --max_steps 400 --max_length 32768 --per_device_train_batch_size 1 --per_device_eval_batch_size 1 --sequence_parallel_size 1 --learning_rate 1e-5 --warmup_ratio 0.05 --weight_decay 1e-4 --max_grad_norm 1.0 --gradient_accumulation_steps 8 --save_strategy steps --save_steps 400 --save_total_limit 1 --train_type full --deepspeed zero3_offload --eval_strategy steps --eval_steps 10 --split_dataset_ratio 0.05 --lr_scheduler_type warmup_stable_decay --lr_scheduler_kwargs "{ "num_decay_steps": 120, "num_stable_steps": 260}" --packing True --dataset_shuffle True --train_dataloader_shuffle True --truncation_strategy right --dataloader_num_workers 4 --model_author swift --model_name swift-robot --log_level detail --logging_steps 1 --report_to wandb
node 1 的命令:
torchrun --nnodes=2 --node_rank=1 --nproc_per_node=2 --master_addr=2605:340:cd51:4b00:9b86:912c:6586:d4d0 --master_port=10217 ./swift_pt.py --model ./workdir/base_model --model_type qwen3 --dataset ./workdir/dataset/shuffled_dataset.jsonl --output_dir ./workdir/swift_output --dataloader_num_workers 10 --dataset_num_proc 10 --attn_impl flash_attn --max_steps 400 --max_length 32768 --per_device_train_batch_size 1 --per_device_eval_batch_size 1 --sequence_parallel_size 1 --learning_rate 1e-5 --warmup_ratio 0.05 --weight_decay 1e-4 --max_grad_norm 1.0 --gradient_accumulation_steps 8 --save_strategy steps --save_steps 400 --save_total_limit 1 --train_type full --deepspeed zero3_offload --eval_strategy steps --eval_steps 10 --split_dataset_ratio 0.05 --lr_scheduler_type warmup_stable_decay --lr_scheduler_kwargs "{ "num_decay_steps": 120, "num_stable_steps": 260}" --packing True --dataset_shuffle True --train_dataloader_shuffle True --truncation_strategy right --dataloader_num_workers 4 --model_author swift --model_name swift-robot --log_level detail --logging_steps 1 --report_to wandb

在这一步hang住,下面的wandb日志是daemon进程打的,不关键:

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported swift_pt.py launch commands and reproduce the two-node, two-process-per-node run, then compare it with the working single-node four-GPU configuration. Inspect the training output around the hang, including the deepspeed zero3_offload, dataloader, evaluation, and distributed settings. Done means the hang is reproduced and its cause or a verified resolution is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
distributed-systems, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.