Profiles would absorb and expand upon the functionality of defaults. There would also be the option during `unlock` to override the default name for profiles, potentially making it `defaults` again.
In the most basic case, profiles can work exactly how defaults currently work:
yaml
profiles:
- /path/to/config1
- /path/to/config2
In this case, all of the values from the specified sub-configs are brought into the highest level of the main config just as they are with defaults.
---
The first additional behavior that comes with this construct is the ability to specify multiple named profiles.
yaml
profiles:
profile1:
- /path/to/config1
- /path/to/config2
profile1:
- /path/to/config3
- /path/to/config4
In essence, this is just two different sets of defaults that can be switched between via the command line. The syntax for specifying profile on the command line would look something like `python main.py --profiles profile1` or potentially `python main.py profile1`.
Additionally, the user will be able to specify configs on the command like to add to the set used. That looks something like `python main.py --profiles profile1 "/path/to/config4"`, in which case the values from the sub-config, onfig4, would be brought in on top of all of the sub-configs brought in from profile 1.
---
Additionally, the user can optionally name the configs brought in from a given profile to enable easier overriding from the command line. Here is an example of what that may look like in an ML pipeline.
yaml
profiles:
train:
model: train/model.yaml
dataset: train/dataset.yaml
debug:
model: debug/model.yaml
dataset: debug/dataset.yaml
In this case, the user specifys the mode to use while also bringing in individual components from the other mode.
`python main.py --profiles train debug.dataset`. Which would select the train profile, but also bring in the debug dataset sub-config.
It is important to note that naming sub-configs does not stop a sub-config from being brought in by path.
---
It is also be possible to have lists of sub-configs as a named set in a profile. For example, one could place several config paths within `train.model` as a list, which would indicate that each of those sub-configs should be brought in when train.model is brought in.
Additionally, sub-profiles allows more fine-grained control of combining aspects of profiles. Consider if the model key had two sub-keys, `backbone` and `head`. Each of these may have one or more sub-config paths specified. Whenever a profile is specified, all sub-configs from every sub-profile (and sub-sub-profile etc.) are also brought in.
Here is an example that exhibits both of these potential behaviors
yaml
profiles:
train:
model:
head: train/head.yaml
backbone: train/backbone.yaml
datasets:
- train/dataset1.yaml
- train/dataset2.yaml
debug:
model:
head: debug/head.yaml
backbone: debug/backbone.yaml
datasets:
- debug/dataset1.yaml
- debug/dataset2.yaml
A command for such set of profiles looks like `python main.py --profiles train debug.model.head` which indicates that the training pipeline should be run, but that the model head should be the debug version.