deepspeedai / deepspeedai/DeepSpeedExamples
How to use deepspeed for multi-node and multi-card task in slurm cluster
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.8k
- Forks
- 1.1k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 1
Description
slurm command as following :
#!/bin/bash
#SBATCH --job-name=pretrain_7 # name
#SBATCH --nodes=2 # nodes
#SBATCH -w server-gpu-[10,15]
#SBATCH --ntasks-per-node=1 # crucial - only 1 task per dist per node!
#SBATCH --cpus-per-task=80 # number of cores per tasks
#SBATCH --gres=gpu:8 # number of gpus
#SBATCH --gpus-per-task=8
srun --jobid $SLURM_JOBID bash -c '
deepspeed --master_port 28727 \
--num_gpus 16 \
--num_nodes 2 \
--hostfile hostfile \
pre_train_ft_7b_ds.py \
--model_path="/demo/Llama2-7b-Instruct-hf/" \
--dataset_name="/demo/train.json" \
--seq_length 8192 \
--num_train_epochs 1 \
or
#!/bin/bash
#SBATCH --job-name=pretrain_7 # name
#SBATCH --nodes=2 # nodes
#SBATCH -w server-gpu-[10,15]
#SBATCH --ntasks-per-node=1 # crucial - only 1 task per dist per node!
#SBATCH --cpus-per-task=80 # number of cores per tasks
#SBATCH --gres=gpu:8 # number of gpus
#SBATCH --gpus-per-task=8
srun --jobid $SLURM_JOBID bash -c '
python -m torch.distributed.run \
--nnodes 2 \
--nproc_per_node 8 \
--master_addr $MASTER_ADDR \
--master_port 9001 \
pre_ft_7b_ds.py \
--model_path="/demo/Llama2-7b-Instruct-hf/" \
--dataset_name="/demo/train.json" \
--seq_length 8192 \
--num_train_epochs 1 \
the two above all has problems , maybe because node server need socket connection or ssh connect with each other
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the two Slurm command blocks and the referenced entry points, pre_train_ft_7b_ds.py and pre_ft_7b_ds.py. Reproduce the reported multi-node launch issue and inspect the DeepSpeed and torch.distributed startup behavior, including the node connection configuration. Done means the failure is identified with a reproducible diagnosis or a verified working launch configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, shell
- Domain
- devops, distributed-systems, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100