Views
No views yet
0.13.0.dev01# axolotl train config.yaml
2
3# Prevent NCCL timeout
4ddp_timeout: 7200 # 2 hours timeout instead of 10 minutes
5
6# Load model from local models directory first, fallback to HuggingFace if not found
7base_model: AiForgeMaster/Qwen3-4B-Pretrain-v1-p3 # Local path - will fallback to Qwen/Qwen3-4B if not found locally
8# Automatically upload checkpoint and final model to HF
9hub_model_id: AiForgeMaster/Qwen3-4B-P3-GK-SFT
10
11load_in_8bit: false
12load_in_4bit: false
13strict: false
14
15# SFT dataset configuration - using HuggingFace datasets
16datasets:
17 - path: AiForgeMaster/SFT-General-CS-2025_08_2025 # Private HF dataset - requires API key
18 type: chat_template
19 split: train
20 field_messages: messages
21 trust_remote_code: false
22 # skip: 0 # number of rows of data to skip over from the beginning
23
24# Local paths relative to working directory
25dataset_prepared_path: ./data/prepared
26val_set_size: 0.0 # Set to 0 for SFT (no validation split)
27output_dir: ./outputs
28
29# Cache directories for HuggingFace downloads (relative to working dir)
30# This ensures models and datasets are downloaded to local directories
31hf_use_auth_token: true # Use HF token for private repos if needed
32
33sequence_len: 8192
34sample_packing: false # Standard for SFT
35eval_sample_packing: false # Disable for SFT
36
37# WandB configuration - fill in your details
38wandb_project: ngpt-cpt
39wandb_entity: null
40wandb_watch: gradients
41wandb_name: qwen3_4b_p3_gksft
42wandb_log_model: end
43
44# Batch size configuration (total effective batch size = micro_batch_size * gradient_accumulation_steps * num_gpus)
45# For batch size 8-16: micro_batch_size=2, gradient_accumulation_steps=4 gives effective batch size of 8 per GPU
46gradient_accumulation_steps: 3
47micro_batch_size: 6 # Adjust based on your GPU memory
48optimizer: adamw_torch_fused
49lr_scheduler: cosine
50learning_rate: 2e-4 # Good learning rate for SFT
51
52bf16: auto
53tf32: true
54
55max_grad_norm: 1.0
56
57gradient_checkpointing: true
58gradient_checkpointing_kwargs:
59 use_reentrant: false
60logging_steps: 10 # Log every 10 steps
61flash_attention: true
62
63warmup_steps: 150 # Good warmup for SFT
64# Checkpoint saving configuration - save every 50 steps
65save_steps: 50
66save_strategy: steps
67save_total_limit: 5 # Keep only 5 most recent checkpoints
68save_only_model: false # Save full checkpoint including optimizer state
69
70# Evaluation configuration removed for pure SFT (val_set_size: 0.0)
71# eval_steps: 2000 # Not supported when val_set_size == 0
72# eval_strategy: steps # Not supported when val_set_size == 0
73weight_decay: 0.01 # Good weight decay for SFT
74
75# Liger optimizations for memory efficiency and speed
76plugins:
77 - axolotl.integrations.liger.LigerPlugin
78
79liger_rope: true
80liger_rms_norm: true
81liger_glu_activation: true
82liger_layer_norm: true
83liger_fused_linear_cross_entropy: true
84
85# Additional SFT optimizations
86# Enable for first run to validate checkpoint saving works
87save_first_step: true
88
89# Memory optimizations
90dataloader_pin_memory: true
91dataloader_num_workers: 4
92remove_unused_columns: true
93
94# Advanced training settings for SFT
95# Calculate max_steps for full epoch: dataset_size / (micro_batch_size * gradient_accumulation_steps * num_gpus)
96# max_steps: 175 # Set for one full epoch with your dataset size
97num_epochs: 1
98group_by_length: true # Good for SFT efficiency
99train_on_inputs: false # Don't train on user inputs in SFT
100
101# Loss monitoring
102loss_watchdog_threshold: 10.0 # Stop if loss exceeds this value
103loss_watchdog_patience: 3
104
105# Garbage collection to manage memory
106gc_steps: 100 # Run garbage collection every 100 steps