50 lines
1.5 KiB
Bash
50 lines
1.5 KiB
Bash
SYSTEM_PROMPT="You are a helpful math assistant. Solve the problem step by step. Show your reasoning in <think> </think> tags, then give the final numerical answer after ####.
|
|
For example:
|
|
<think> ... reasoning ... </think>
|
|
#### 42"
|
|
CUDA_VISIBLE_DEVICES=0,1,2,3 \
|
|
NPROC_PER_NODE=4 \
|
|
swift rlhf \
|
|
--rlhf_type grpo \
|
|
--model Qwen/Qwen2.5-3B-Instruct \
|
|
--external_plugins examples/train/grpo/plugin/gsm8k/gsm8k_plugin.py \
|
|
--reward_funcs gsm8k_accuracy gsm8k_format \
|
|
--columns '{"answer": "solution"}' \
|
|
--enable_thinking false \
|
|
--use_vllm true \
|
|
--vllm_mode colocate \
|
|
--vllm_gpu_memory_utilization 0.4 \
|
|
--vllm_tensor_parallel_size 1 \
|
|
--vllm_max_model_len 10240 \
|
|
--vllm_enable_lora true \
|
|
--sleep_level 1 \
|
|
--tuner_type lora \
|
|
--quant_method bnb \
|
|
--quant_bits 4 \
|
|
--bnb_4bit_quant_type nf4 \
|
|
--torch_dtype bfloat16 \
|
|
--dataset 'modelscope/gsm8k' \
|
|
--load_from_cache_file true \
|
|
--max_length 2048 \
|
|
--max_completion_length 8192 \
|
|
--num_train_epochs 1 \
|
|
--per_device_train_batch_size 4 \
|
|
--gradient_accumulation_steps 4 \
|
|
--learning_rate 1e-5 \
|
|
--lr_scheduler_type cosine \
|
|
--save_steps 10 \
|
|
--save_total_limit 100 \
|
|
--logging_steps 1 \
|
|
--warmup_ratio 0.0 \
|
|
--dataloader_num_workers 4 \
|
|
--num_generations 8 \
|
|
--temperature 1.0 \
|
|
--system "$SYSTEM_PROMPT" \
|
|
--deepspeed zero2 \
|
|
--log_completions true \
|
|
--report_to tensorboard swanlab \
|
|
--max_grad_norm 1.0 \
|
|
--epsilon 0.2 \
|
|
--epsilon_high 0.28 \
|
|
--scale_rewards none
|