This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
# How to run
|
||||
|
||||
## 1. Install pdsh in your nodes
|
||||
|
||||
```shell
|
||||
# https://code.google.com/archive/p/pdsh/downloads
|
||||
# For example, download to /root:
|
||||
cd /root
|
||||
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pdsh/pdsh-2.29.tar.bz2
|
||||
tar -xvf pdsh-2.29.tar.bz2
|
||||
cd pdsh-2.29
|
||||
./configure --prefix=/root/pdsh-2.29 --with-ssh --without-rsh --with-exec --with-timeout=60 --with-nodeupdown --with-rcmd-rank-list=ssh
|
||||
make
|
||||
make install
|
||||
```
|
||||
|
||||
In case of the privilege is correct:
|
||||
```shell
|
||||
chown root:root /root/pdsh-2.29
|
||||
```
|
||||
|
||||
## Configure the ssh
|
||||
|
||||
vim your ~/.ssh/config and input:
|
||||
```text
|
||||
Host worker-0
|
||||
HostName your-worker-0-ip-here
|
||||
User root
|
||||
Host worker-1
|
||||
HostName your-worker-1-ip-here
|
||||
User root
|
||||
```
|
||||
Say you have two nodes, when doing this, make sure your other nodes can be logined with `ssh root@worker-x` without password(with ssh-key).
|
||||
|
||||
## Clone swift repo and run
|
||||
|
||||
```shell
|
||||
git clone https://github.com/modelscope/ms-swift.git
|
||||
cd ms-swift
|
||||
# If your node number is different, edit examples/train/multi-node/deepspeed/host.txt
|
||||
sh examples/train/multi-node/deepspeed/train.sh
|
||||
```
|
||||
@@ -0,0 +1,2 @@
|
||||
worker-0 slots=2
|
||||
worker-1 slots=2
|
||||
@@ -0,0 +1,20 @@
|
||||
# If your need only a part of the GPUs in every node, try:
|
||||
# --include="worker-0:0,1@worker-1:2,3"
|
||||
deepspeed --hostfile=./examples/train/multi-node/deepspeed/host.txt \
|
||||
swift/cli/sft.py \
|
||||
--model Qwen/Qwen2.5-7B-Instruct \
|
||||
--tuner_type lora \
|
||||
--torch_dtype bfloat16 \
|
||||
--dataset 'swift/self-cognition#1000' \
|
||||
--load_from_cache_file true \
|
||||
--num_train_epochs 1 \
|
||||
--lora_rank 8 \
|
||||
--lora_alpha 32 \
|
||||
--learning_rate 1e-4 \
|
||||
--gradient_accumulation_steps 16 \
|
||||
--eval_steps 100 \
|
||||
--save_steps 100 \
|
||||
--save_total_limit 2 \
|
||||
--logging_steps 5 \
|
||||
--model_author swift \
|
||||
--model_name swift-robot
|
||||
Reference in New Issue
Block a user