Philosophy: Why Hydra?
ATLAS uses Hydra for configuration management to provide:- Composability: Mix and match components without code changes
- Reproducibility: Every experiment is fully defined by configs
- Command-line flexibility: Override any parameter at runtime
- Type safety: Structured configs with validation
The Configuration Hierarchy
Understanding how configurations compose is essential for customization:Layer Breakdown
Each configuration layer serves a specific purpose:Layer | Purpose | Example Files | When to Modify |
---|---|---|---|
train.yaml | Global defaults | Single file | Rarely - only for system-wide changes |
run/*.yaml | Experiment recipes | teacher_rcl.yaml , teacher_sft.yaml | For new experiment types |
model/*.yaml | Model specifications | qwen3_8b.yaml , llama3_8b.yaml | Adding new architectures |
data/*.yaml | Dataset configs | arc_atlas_rl.yaml , arc_atlas_sft.yaml | New datasets or tasks |
trainer/*.yaml | Algorithm settings | teacher_grpo.yaml , sft.yaml | Algorithm modifications |
Walkthrough: Composing teacher_rcl.yaml
Let’s dissect a complete experiment configuration to understand composition:Base Configuration Structure
Base Configuration Structure
override
line pulls in a complete configuration module:_self_
: Current file’s settings take precedence- Order matters: Later overrides win conflicts
trainer: teacher_grpo
trainer: teacher_grpo
This specifies the GRPO algorithm for teacher training:Key parameters:
beta
: Controls exploration vs exploitation (lower = more exploration)temperature
: Output diversity (higher = more creative)- See Trainers API Reference for full details
model: qwen3_8b
model: qwen3_8b
Defines the model architecture and loading:Customization points:
- Change
model_name_or_path
for different checkpoints - Adjust
torch_dtype
for memory/precision tradeoffs - Enable quantization with
load_in_4bit: true
data: arc_atlas_rl
data: arc_atlas_rl
Configures the training dataset:Important settings:
dataset_config
: Selects RL vs SFT data formatmax_train_samples
: Controls training set sizemax_length
: Maximum sequence length (memory impact)
reward: adaptive_teaching
reward: adaptive_teaching
Defines the reward function for RL:Tuning guide:
efficiency_weight
: Higher values favor concise teachingbaseline_threshold
: Minimum performance for rewards- See Reward Design for theory
Customization Patterns
Pattern 1: Command-Line Overrides
Override any parameter without changing files:Pattern 2: Creating New Configurations
1
Choose the Right Layer
Determine which configuration type to create:
- New model? →
configs/model/
- New dataset? →
configs/data/
- New experiment? →
configs/run/
2
Copy a Similar Config
Start from an existing configuration:
3
Modify Key Parameters
Edit your new configuration:
4
Reference in Run Config
Use your new configuration:
Pattern 3: Multi-GPU Scaling
Adjust configurations for different hardware:Common Configuration Scenarios
Scenario 1: Memory Optimization
Default configurations assume 40GB+ VRAM per GPU. Adjust for smaller GPUs:
Scenario 2: Faster Experimentation
Trade accuracy for speed during development:Scenario 3: Production Training
Maximize performance for deployment:Debugging Configuration Issues
Viewing Composed Configuration
See the final merged configuration:Common Errors and Solutions
Override not found
Override not found
Error: Ensure exact filename match (without .yaml extension)
Could not override '/model'
Solution: Check that the config file exists:Type mismatch
Type mismatch
Error:
ValidationError: expected type 'float'
Solution: Check parameter types in configs:Memory overflow
Memory overflow
Error:
CUDA out of memory
Solution: Reduce batch size or enable offloading:Best Practices
- Version Control Configs: Commit configuration files with experiments for reproducibility
-
Use Meaningful Names: Name configs descriptively:
llama3_8b_quantized.yaml
notmodel2.yaml
- Document Custom Configs: Add comments explaining non-obvious parameter choices
- Test Incrementally: Verify each configuration layer works before composing
- Leverage Defaults: Only override what you need to change