Spaces:
Build error
Build error
tune-mgtv-qwen2_72b.sh
Browse files
llama-factory/config/qwen2_72b_lora_sft_4bit-p1.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### model
|
2 |
+
model_name_or_path: Qwen/Qwen2-72B-Instruct
|
3 |
+
|
4 |
+
### method
|
5 |
+
stage: sft
|
6 |
+
do_train: true
|
7 |
+
finetuning_type: lora
|
8 |
+
lora_target: all
|
9 |
+
quantization_bit: 4 # use 4-bit QLoRA
|
10 |
+
loraplus_lr_ratio: 16.0 # use LoRA+ with lambda=16.0
|
11 |
+
# use_unsloth: true # use UnslothAI's LoRA optimization for 2x faster training
|
12 |
+
|
13 |
+
### dataset
|
14 |
+
dataset: alpaca_mac
|
15 |
+
template: chatml
|
16 |
+
cutoff_len: 4096
|
17 |
+
max_samples: 25000
|
18 |
+
overwrite_cache: true
|
19 |
+
preprocessing_num_workers: 16
|
20 |
+
|
21 |
+
### output
|
22 |
+
output_dir: saves/qwen2-72b/lora/sft_4bit_p1_full
|
23 |
+
logging_steps: 10
|
24 |
+
save_steps: 88
|
25 |
+
plot_loss: true
|
26 |
+
overwrite_output_dir: true
|
27 |
+
# resume_from_checkpoint: true
|
28 |
+
|
29 |
+
### train
|
30 |
+
per_device_train_batch_size: 32
|
31 |
+
gradient_accumulation_steps: 8
|
32 |
+
learning_rate: 1.0e-4
|
33 |
+
num_train_epochs: 4.0
|
34 |
+
lr_scheduler_type: cosine
|
35 |
+
warmup_ratio: 0.1
|
36 |
+
bf16: true
|
37 |
+
ddp_timeout: 180000000
|
38 |
+
|
39 |
+
### eval
|
40 |
+
val_size: 0.1
|
41 |
+
per_device_eval_batch_size: 1
|
42 |
+
eval_strategy: steps
|
43 |
+
eval_steps: 88
|
44 |
+
|
45 |
+
report_to: wandb
|
46 |
+
run_name: qwen2_72b_4bit_p1_full # optional
|
llama-factory/config/qwen2_72b_lora_sft_4bit-p2.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
### model
|
2 |
+
model_name_or_path: Qwen/Qwen2-72B-Instruct
|
3 |
+
|
4 |
+
### method
|
5 |
+
stage: sft
|
6 |
+
do_train: true
|
7 |
+
finetuning_type: lora
|
8 |
+
lora_target: all
|
9 |
+
quantization_bit: 4 # use 4-bit QLoRA
|
10 |
+
loraplus_lr_ratio: 16.0 # use LoRA+ with lambda=16.0
|
11 |
+
# use_unsloth: true # use UnslothAI's LoRA optimization for 2x faster training
|
12 |
+
|
13 |
+
### dataset
|
14 |
+
dataset: alpaca_mac
|
15 |
+
template: chatml
|
16 |
+
cutoff_len: 4096
|
17 |
+
max_samples: 25000
|
18 |
+
overwrite_cache: true
|
19 |
+
preprocessing_num_workers: 16
|
20 |
+
|
21 |
+
### output
|
22 |
+
output_dir: saves/qwen2-72b/lora/sft_4bit_p2_full
|
23 |
+
logging_steps: 10
|
24 |
+
save_steps: 88
|
25 |
+
plot_loss: true
|
26 |
+
overwrite_output_dir: true
|
27 |
+
# resume_from_checkpoint: true
|
28 |
+
|
29 |
+
### train
|
30 |
+
per_device_train_batch_size: 32
|
31 |
+
gradient_accumulation_steps: 8
|
32 |
+
learning_rate: 1.0e-4
|
33 |
+
num_train_epochs: 4.0
|
34 |
+
lr_scheduler_type: cosine
|
35 |
+
warmup_ratio: 0.1
|
36 |
+
bf16: true
|
37 |
+
ddp_timeout: 180000000
|
38 |
+
|
39 |
+
### eval
|
40 |
+
val_size: 0.1
|
41 |
+
per_device_eval_batch_size: 1
|
42 |
+
eval_strategy: steps
|
43 |
+
eval_steps: 88
|
44 |
+
|
45 |
+
report_to: wandb
|
46 |
+
run_name: qwen2_72b_4bit_p2_full # optional
|
scripts/tune-mgtv-qwen2_72b.sh
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
|
3 |
+
BASEDIR=$(dirname "$0")
|
4 |
+
cd $BASEDIR/..
|
5 |
+
echo Current Directory:
|
6 |
+
pwd
|
7 |
+
|
8 |
+
BASEDIR=`pwd`
|
9 |
+
|
10 |
+
nvidia-smi
|
11 |
+
uname -a
|
12 |
+
cat /etc/os-release
|
13 |
+
lscpu
|
14 |
+
grep MemTotal /proc/meminfo
|
15 |
+
|
16 |
+
#pip install -r requirements.txt
|
17 |
+
#cd ../LLaMA-Factory && pip install -e .[torch,bitsandbytes]
|
18 |
+
|
19 |
+
export LOGICAL_REASONING_DATA_PATH=datasets/mgtv
|
20 |
+
|
21 |
+
export MODEL_PREFIX=qwen2_72b_lora_sft_4bit
|
22 |
+
|
23 |
+
export CONFIG_FILE=config/$MODEL_PREFIX-p1.yaml
|
24 |
+
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p1.csv
|
25 |
+
echo "Tuning with $CONFIG_FILE"
|
26 |
+
$BASEDIR/scripts/tune-lf.sh $CONFIG_FILE
|
27 |
+
|
28 |
+
export CONFIG_FILE=config/$MODEL_PREFIX-p2.yaml
|
29 |
+
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p2.csv
|
30 |
+
echo "Tuning with $CONFIG_FILE"
|
31 |
+
$BASEDIR/scripts/tune-lf.sh $CONFIG_FILE
|
scripts/tune-mgtv.sh
CHANGED
@@ -1 +1 @@
|
|
1 |
-
tune-mgtv-
|
|
|
1 |
+
tune-mgtv-qwen2_72b.sh
|