HumboldtJoker commited on
Commit
51cfc4f
·
verified ·
1 Parent(s): ff61f67

Add training template: train_daimon_config.yaml

Browse files
training-template/train_daimon_config.yaml ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ============================================================================
2
+ # Daimon Training Configuration — Liberation Labs
3
+ # ============================================================================
4
+ # All hyperparameters in one place. The training script reads this file.
5
+ # Edit values here rather than modifying train_daimon.py directly.
6
+ #
7
+ # Model: Qwen3.6-35B-A3B (MoE, 35B total params, ~3B active per token)
8
+ # Hardware target: 1x H200 SXM 141GB on RunPod
9
+ # Method: Full-parameter SFT with DeepSpeed ZeRO-2 + Adafactor
10
+ # ============================================================================
11
+
12
+ # --- Paths ---
13
+ # model_id is the HuggingFace model ID or local path on the pod.
14
+ # data_path points to the HF dataset repo OR a local directory with Arrow data.
15
+ # output_dir MUST be on the persistent RunPod volume (/workspace/).
16
+ model_id: "Qwen/Qwen3.6-35B-A3B"
17
+ model_revision: "995ad96eacd98c81ed38be0c5b274b04031597b0"
18
+ data_path: "HumboldtJoker/daimon-sft-data"
19
+ output_dir: "/workspace/daimon-sft"
20
+
21
+ # --- DeepSpeed ---
22
+ # ZeRO Stage 2 with CPU-offloaded optimizer. Required for full SFT on single GPU.
23
+ # Gradients are sharded across the training step; Adafactor states live in CPU RAM.
24
+ deepspeed_config: "ds_config_zero2.json"
25
+
26
+ # --- Sequence length ---
27
+ # CRITICAL: Previous runs silently truncated 5640-token sequences to 4096.
28
+ # Set this high enough for your longest training example.
29
+ # The training script will pre-split any sequence exceeding this length.
30
+ # Reduced from 8192 to 4096 for full SFT — activation memory scales with seq length,
31
+ # and we need headroom for full gradients. Increase if your data requires it,
32
+ # but monitor GPU OOM carefully.
33
+ max_seq_length: 4096
34
+
35
+ # --- Optimizer ---
36
+ # Adafactor: factored second moments use ~35GB CPU RAM for 35B params.
37
+ # AdamW is NOT viable: fp32 momentum + variance = 35B × 4B × 2 = 280GB,
38
+ # exceeding the 188GB system RAM even with full CPU offload.
39
+ optimizer: "adafactor"
40
+
41
+ # --- Training hyperparameters ---
42
+ num_train_epochs: 1
43
+ max_steps: 10000
44
+ per_device_train_batch_size: 1
45
+ gradient_accumulation_steps: 8
46
+ # Effective batch size = per_device * 1 GPU * grad_accum = 1 * 1 * 8 = 8
47
+
48
+ # Full SFT learning rate — much lower than LoRA (2e-4) because we're updating
49
+ # ALL parameters. Too high a rate destabilizes MoE routing gates.
50
+ learning_rate: 5.0e-6
51
+ lr_scheduler_type: "cosine"
52
+ warmup_steps: 100
53
+ # No weight decay with Adafactor — it handles regularization internally
54
+ weight_decay: 0.0
55
+ max_grad_norm: 1.0
56
+ seed: 42
57
+
58
+ # --- Checkpointing ---
59
+ # Full model checkpoints are ~70GB each (entire model in bf16).
60
+ # save_total_limit=3 means up to ~210GB of checkpoint space needed.
61
+ # With 400GB persistent volume, that leaves room for model + data + final output.
62
+ save_steps: 500
63
+ save_total_limit: 3
64
+
65
+ # --- Evaluation ---
66
+ eval_steps: 500
67
+ eval_strategy: "steps"
68
+
69
+ # --- Logging ---
70
+ logging_steps: 10
71
+ report_to: "none"
72
+
73
+ # --- Precision ---
74
+ bf16: true
75
+
76
+ # --- Gradient checkpointing ---
77
+ # Trades ~30% extra compute for roughly halved activation memory.
78
+ # Critical for full SFT — without it, activations alone would be ~60GB,
79
+ # leaving no room for gradients on GPU. With it, activations drop to ~20GB.
80
+ gradient_checkpointing: true