progressive-llm/config/training_config_gemma3_1b_8gpu_ddp.yaml
2025-07-10 23:21:23 +09:00

109 lines
No EOL
3.3 KiB
YAML

experiment:
name: "progressive_reasoning_gemma3_1b_8gpu_ddp"
base_model: "google/gemma-3-1b-pt"
output_dir: "./outputs"
use_wandb: true
wandb_project: "matsuo-llm-comp-2025"
model:
load_in_4bit: true # Enable quantization for memory savings
bnb_4bit_compute_dtype: "bfloat16"
bnb_4bit_use_double_quant: true
device_map: "balanced" # Distribute across all GPUs
gradient_checkpointing: true # Enable gradient checkpointing
use_flash_attention_2: false
use_eager_attention: true
# Multi-GPU specific settings
distributed:
strategy: "ddp" # Distributed Data Parallel
find_unused_parameters: false
gradient_as_bucket_view: true
progressive_stages:
- name: "basic_cot"
description: "Basic Chain-of-Thought reasoning"
dataset_path: "./data/basic_cot/"
adapter_config:
r: 8 # Minimal rank for memory
lora_alpha: 16
lora_dropout: 0.1
target_modules: ["q_proj", "k_proj", "v_proj", "o_proj"]
init_lora_weights: true
training:
num_epochs: 2
per_device_batch_size: 1 # 1 * 8 = 8 total batch size (minimal)
gradient_accumulation_steps: 8 # Maintain effective batch size
learning_rate: 5e-4
warmup_steps: 100
max_length: 512 # Reduced sequence length
bf16: true
max_grad_norm: 1.0
weight_decay: 0.001
save_steps: 50
logging_steps: 10
dataloader_num_workers: 2
dataloader_pin_memory: false
- name: "math_reasoning"
description: "Mathematical reasoning with OpenR1-Math-220k dataset"
dataset_path: "open-r1/OpenR1-Math-220k"
inherit_from: "basic_cot"
adapter_config:
r: 8 # Minimal rank for memory
lora_alpha: 16
lora_dropout: 0.1
target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
init_lora_weights: true
training:
num_epochs: 1
per_device_batch_size: 1 # 1 * 8 = 8 total batch size (minimal)
gradient_accumulation_steps: 4
learning_rate: 3e-4
warmup_steps: 200
max_length: 1024 # Reduced sequence length
bf16: true
max_grad_norm: 1.0
weight_decay: 0.001
save_steps: 100
logging_steps: 20
dataloader_num_workers: 2
dataset_config:
streaming: true
max_samples: 400000 # Process substantial data
split: "train"
- name: "complex_reasoning"
description: "Complex multi-step reasoning with Mixture-of-Thoughts"
dataset_path: "open-r1/Mixture-of-Thoughts"
inherit_from: "math_reasoning"
adapter_config:
r: 8 # Minimal rank for memory
lora_alpha: 16
lora_dropout: 0.1
target_modules: ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
init_lora_weights: true
training:
num_epochs: 1
per_device_batch_size: 1 # 1 * 8 = 8 total batch size (minimal)
gradient_accumulation_steps: 2
learning_rate: 2e-4
warmup_steps: 300
max_length: 1024 # Reduced sequence length
bf16: true
max_grad_norm: 1.0
weight_decay: 0.001
save_steps: 200
logging_steps: 50
dataloader_num_workers: 2
dataset_config:
streaming: true
max_samples: 600000
split: "train"
evaluation:
benchmarks:
- "HLE"
- "Do-Not-Answer"
save_results: true
results_dir: "./outputs/evaluation_results"