Experiment Orchestration¶
group config → many unit runs
How do I run many variations, and collect their results together?
Intro¶
One YAML group config varies your unit configs into many unit runs, each landing in its own dir under one group directory.
# configs/groups/aya_lr_search.yml
configs:
tune_aya_bebe: ../units/tune.lm.aya.ds.bebe.yml
runs:
- {config: tune_aya_bebe, name: lr1e-4, seed: 1, overrides: {training_args.args.learning_rate: 1e-4}}
- {config: tune_aya_bebe, name: lr5e-5, seed: 1, overrides: {training_args.args.learning_rate: 5e-5}}
In a group config each entry in runs: resolves one unit config from configs: and forms one unit run. The runs land side by side, in artefacts/runs/groups/{group}/{time_id}_{runs[i].name}/. Every result row is stamped with the run’s identity, so the group’s runs concatenate into one table.
python -m micm_nlp run-group \
--group-config configs/groups/aya_lr_search.yml \
--run-index 0 \
--root-path /path/to/your/workspace \
--runner /path/to/your/custom/run.py
--run-indexselects one run; skip it to run everything.--root-pathis only needed whenPROJECT_ROOT_PATHis not set.--runnerallows your own customrun(config, ctx), or can be skipped — resolved config, run entry, and unknown CLI flags are passed. Append:fnto name a function other thanrun.
sbatch --array=0-1 my_wrapper.sh \
"python -m micm_nlp run-group --group-config configs/groups/aya_lr_search.yml"
Under a SLURM array each task picks its own run by SLURM_ARRAY_TASK_ID.
Identity columns¶
Each run in a group writes the same directory as a unit run.
Every row of its eval_*.csv and test_*.csv also gets the run’s identity: group, name, index, seed, and any extra key you add to the run entry, e.g. method: spt.
Bringing your own science¶
The default runner is micm_nlp.pipeline:run. Replace it with --runner when a run needs to do something the pipeline does not.
E.g. transfer learning: fine-tune the model on one dataset, then test it on another.
That takes two configs in a single entry: config with mode: finetune, and separate_test.config with mode: test.
A runner is a callable with this contract:
def run(config: CONFIG, ctx: RunContext) -> RunOutput:
... # tokenizer, dataset, model — whatever your science needs
trainer = TRAINER(model, dataset, tokenizer)
return trainer.run()
configis the resolved config.ctxis aRunContext: the group and run names, the index and the entry as written, unknown CLI flags asextras, and resolvedtest_configwhen the entry declared aseparate_test.The return value is the trainer’s
RunOutput— the trainer is what writes the results into the run directory.
Note
For the test phase, a second TRAINER built from ctx.test_config writes its separate_-prefixed files into the same directory.