puzzled-neuron commited on
Commit
c764096
·
verified ·
1 Parent(s): 58f007a

Upload training/config.yaml with huggingface_hub

Browse files
Files changed (1) hide show
  1. training/config.yaml +83 -0
training/config.yaml ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DoRA Fine-tuning Config for Qwen3-4B
2
+ # Optimized for H100 80GB
3
+
4
+ # Model
5
+ base_model: Qwen/Qwen3-8B
6
+ model_type: AutoModelForCausalLM
7
+ tokenizer_type: AutoTokenizer
8
+ trust_remote_code: true
9
+
10
+ # Dataset
11
+ datasets:
12
+ - path: output/qwen3_train_v2.jsonl
13
+ type: chat
14
+ split: train
15
+ - path: output/qwen3_val_v2.jsonl
16
+ type: chat
17
+ split: eval
18
+
19
+ # Chat template (Qwen3 uses ChatML)
20
+ chat_template: chatml
21
+
22
+ # DoRA Configuration
23
+ adapter: dora
24
+ lora_r: 64 # Rank - higher for more capacity
25
+ lora_alpha: 128 # Alpha = 2 * r is common
26
+ lora_dropout: 0.05
27
+ lora_target_modules:
28
+ - q_proj
29
+ - k_proj
30
+ - v_proj
31
+ - o_proj
32
+ - gate_proj
33
+ - up_proj
34
+ - down_proj
35
+
36
+ # Training hyperparameters
37
+ num_epochs: 1
38
+ micro_batch_size: 64 # Per GPU batch size
39
+ gradient_accumulation_steps: 2 # Effective batch = 4 * 4 = 16
40
+ learning_rate: 0.0002
41
+ lr_scheduler: cosine
42
+ warmup_ratio: 0.05
43
+ weight_decay: 0.01
44
+ max_grad_norm: 1.0
45
+
46
+ # Optimizer
47
+ optimizer: adamw_torch_fused
48
+ adam_beta1: 0.9
49
+ adam_beta2: 0.999
50
+ adam_epsilon: 1e-8
51
+
52
+ # Precision
53
+ bf16: true
54
+ tf32: true
55
+
56
+ # Sequence length
57
+ sequence_len: 2048 # Sufficient for Q&A pairs
58
+ sample_packing: true # Pack multiple samples per sequence
59
+ pad_to_sequence_len: false
60
+
61
+ # Evaluation
62
+ eval_steps: 500
63
+ eval_batch_size: 4
64
+ save_steps: 500
65
+ save_total_limit: 3
66
+
67
+ # Logging
68
+ logging_steps: 50
69
+ report_to: tensorboard
70
+ wandb_project: tha-fm-qwen3
71
+ wandb_run_name: dora-qwen3-4b-v1
72
+
73
+ # Output
74
+ output_dir: ./outputs/qwen3-4b-dora
75
+ hub_model_id: null # Set to push to HuggingFace
76
+
77
+ # Performance
78
+ gradient_checkpointing: true
79
+ flash_attention: false
80
+ dataloader_num_workers: 4
81
+
82
+ # Misc
83
+ seed: 42