Add training config
Browse files
config/llama31_hatexplain_qlora_sft.yaml
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### model
|
| 2 |
+
model_name_or_path: meta-llama/Meta-Llama-3.1-8B-Instruct
|
| 3 |
+
quantization_bit: 4 # QLoRA backbone (bnb 4-bit)
|
| 4 |
+
quantization_method: bnb # choices: [bnb, hqq, eetq]
|
| 5 |
+
trust_remote_code: true
|
| 6 |
+
|
| 7 |
+
### method
|
| 8 |
+
stage: sft
|
| 9 |
+
do_train: true
|
| 10 |
+
do_eval: true
|
| 11 |
+
finetuning_type: lora # LoRA on quantized base = QLoRA
|
| 12 |
+
use_dora: false # DoRA is not compatible with PTQ/QLoRA here
|
| 13 |
+
lora_rank: 8
|
| 14 |
+
lora_alpha: 16
|
| 15 |
+
lora_dropout: 0.05
|
| 16 |
+
lora_target: all
|
| 17 |
+
gradient_checkpointing: true
|
| 18 |
+
|
| 19 |
+
### dataset
|
| 20 |
+
dataset: hatexplain_rationale_train
|
| 21 |
+
eval_dataset: hatexplain_validation
|
| 22 |
+
template: llama3
|
| 23 |
+
cutoff_len: 1024
|
| 24 |
+
overwrite_cache: true
|
| 25 |
+
preprocessing_num_workers: 8
|
| 26 |
+
dataloader_num_workers: 2
|
| 27 |
+
|
| 28 |
+
### output
|
| 29 |
+
output_dir: saves/llama31-8b/hatexplain_rationale/qlora
|
| 30 |
+
logging_steps: 10
|
| 31 |
+
save_steps: 500
|
| 32 |
+
eval_steps: 500
|
| 33 |
+
save_only_model: true
|
| 34 |
+
overwrite_output_dir: true
|
| 35 |
+
report_to: none # [none, wandb, tensorboard, swanlab, mlflow]
|
| 36 |
+
|
| 37 |
+
### train
|
| 38 |
+
per_device_train_batch_size: 3 # increase if memory allows
|
| 39 |
+
gradient_accumulation_steps: 8
|
| 40 |
+
learning_rate: 2.0e-5
|
| 41 |
+
num_train_epochs: 3.0
|
| 42 |
+
lr_scheduler_type: cosine
|
| 43 |
+
warmup_ratio: 0.1
|
| 44 |
+
bf16: true
|
| 45 |
+
ddp_timeout: 180000000
|
| 46 |
+
|
| 47 |
+
### eval
|
| 48 |
+
per_device_eval_batch_size: 1
|
| 49 |
+
eval_strategy: steps
|
| 50 |
+
|