| name | Autolab Campaign Design |
| description | This skill should be used when the user asks to "design a campaign", "create experiment campaign", "plan experiments", "set up parameter sweep", "design parameter grid". It guides designing effective Autolab campaign YAML files. |
| version | 0.1.0 |
Design an effective Autolab experiment campaign.
Campaign Design Principles
-
Hypothesis-first: Every campaign starts with a testable hypothesis. Write it before choosing parameters.
-
Isolate variables: Each campaign should test one primary variable. Use defaults to hold everything else constant.
-
Grid sizing: Aim for 5-20 experiments per campaign. Fewer is too sparse to draw conclusions. More wastes time before analysis.
-
Moonshot ratio: Check if the project needs more moonshots (.autolab/state.json vs autolab.yaml target). If so, design a campaign that challenges fundamental assumptions rather than incrementally tweaking parameters.
-
Metric selection: Choose a primary metric that directly measures what the hypothesis predicts. Add secondary metrics for context.
Campaign YAML Schema
version: 1
name: descriptive_snake_case_name
hypothesis: "Clear testable prediction"
question: q1
moonshot: false
runner:
backend: local
command: "python experiment.py --param {grid_param}"
working_dir: ./experiments
timeout_seconds: 3600
defaults:
seed: 42
epochs: 10
grid:
learning_rate: [0.1, 0.01, 0.001]
batch_size: [16, 32, 64]
metrics:
primary: throughput
direction: maximize
collect:
- name: throughput
source: stdout
pattern: "Throughput: ([\\d.]+)"
type: float
- name: loss
source: stdout
pattern: "Loss: ([\\d.]+)"
type: float
stopping:
window: 3
threshold: 0.05
max_failures: 3
SSH Runner Configuration
For remote experiments:
runner:
backend: ssh
host: gpu-server.lab
user: researcher
key_path: ~/.ssh/lab_key
command: "python train.py --lr {learning_rate}"
working_dir: /home/researcher/experiments
deploy_files:
- local: experiments/train.py
remote: /home/researcher/train.py
cleanup_command: "rm -f /tmp/experiment_lock"
timeout_seconds: 7200
Metric Extraction
The experiment command writes to stdout. Autolab parses metrics using regex:
- Pattern must have exactly one capture group
(...) for the value
- Type can be
float, int, or str
- Source is
stdout (default) or stderr
For structured output, write a JSON file and use the file collector pattern.
Naming Convention
Name campaigns as NNN_description.yaml where NNN is a sequential number:
000_example.yaml
001_baseline_throughput.yaml
002_batch_size_sweep.yaml
050_moonshot_sparse_attention.yaml
After Creating
- Link the campaign to a question: update
research_plan.yaml
- Run it:
PYTHONPATH=src python3 -m autolab.cli run campaigns/<name>.yaml
- Analyze results:
PYTHONPATH=src python3 -m autolab.cli results --campaign <name> --metric <primary>