Reputation: 4314
I can't find a way to load config group options from parent directories in hydra.
E.g. here I want to load the config group option from datamodule/wikipedia1m.yaml
from variant/default.yaml
but it does not give what I expected.
Here are my hydra setup:
conf
├── config.yaml
├── datamodule
│ ├── dummy.yaml
│ └── wikipedia1m.yaml
├── task
│ ├── concat_t5_base.yaml
│ ├── concat.yaml
└── variant
└── default.yaml
config.yaml
defaults:
- variant: default
- _self_
variant/default.yaml
# @package _global_
task: concat_t5_base
datamodule: wikipedia1m
Resulting config:
task: concat_t5_base
datamodule: wikipedia1m
Expected config:
task:
_target_: xxx
model_name: t5-base
shuffle_labels: true
datamodule:
_target_: xxx
num_workers: 4
batch_size: 8
Any idea on how to achieve the expected behaviour?
Upvotes: 3
Views: 2143
Reputation: 33646
This is supported in Hydra 1.1 and newer.
You need a defaults list in variant.yaml, and you need to refer to the parent parent with a /
prefix.
What you are trying to do is described in the Configuring Experiments page.
Upvotes: 3