32 lines
883 B
Bash
32 lines
883 B
Bash
# 4 * 50GiB; 2h
|
|
PYTORCH_CUDA_ALLOC_CONF='expandable_segments:True' \
|
|
NPROC_PER_NODE=4 \
|
|
CUDA_VISIBLE_DEVICES=0,1,2,3 \
|
|
swift rlhf \
|
|
--rlhf_type dpo \
|
|
--model Qwen/Qwen2.5-7B-Instruct \
|
|
--tuner_type full \
|
|
--dataset AI-ModelScope/orpo-dpo-mix-40k \
|
|
--load_from_cache_file true \
|
|
--split_dataset_ratio 0.01 \
|
|
--torch_dtype bfloat16 \
|
|
--num_train_epochs 1 \
|
|
--per_device_train_batch_size 1 \
|
|
--per_device_eval_batch_size 1 \
|
|
--learning_rate 1e-5 \
|
|
--gradient_accumulation_steps 1 \
|
|
--eval_steps 200 \
|
|
--save_steps 200 \
|
|
--save_total_limit 2 \
|
|
--logging_steps 5 \
|
|
--max_length 8192 \
|
|
--output_dir output \
|
|
--warmup_ratio 0.05 \
|
|
--save_only_model true \
|
|
--dataloader_num_workers 4 \
|
|
--dataset_num_proc 4 \
|
|
--deepspeed zero3 \
|
|
--attn_impl flash_attn \
|
|
--rpo_alpha 0.1 \
|
|
--packing true
|