Skip to content

Commit 57cd99f

Browse files
authored
[npu] add npu deepspeed example (#6716)
1 parent 5e81239 commit 57cd99f

File tree

1 file changed

+31
-0
lines changed
  • examples/ascend/train/qwen3_lora_deepspeed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# hardware: Atlas 900 A2
2+
export TASK_QUEUE_ENABLE=2
3+
export CPU_AFFINITY_CONF=2
4+
nproc_per_node=8
5+
ASCEND_RT_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 \
6+
NPROC_PER_NODE=$nproc_per_node \
7+
swift sft \
8+
--model 'Qwen/Qwen3-32B' \
9+
--train_type lora \
10+
--dataset 'swift/self-cognition#1000' \
11+
--torch_dtype bfloat16 \
12+
--num_train_epochs 10 \
13+
--per_device_train_batch_size 1 \
14+
--per_device_eval_batch_size 1 \
15+
--learning_rate 1e-4 \
16+
--lora_rank 8 \
17+
--lora_alpha 32 \
18+
--target_modules all-linear \
19+
--gradient_accumulation_steps $(expr 16 / $nproc_per_node) \
20+
--eval_steps 100 \
21+
--save_steps 100 \
22+
--save_total_limit 2 \
23+
--logging_steps 1 \
24+
--max_length 2048 \
25+
--output_dir output \
26+
--system 'You are a helpful assistant.' \
27+
--warmup_ratio 0.05 \
28+
--dataloader_num_workers 4 \
29+
--model_author swift \
30+
--model_name swift-robot \
31+
--deepspeed zero3

0 commit comments

Comments
 (0)