mirror of
https://github.com/microsoft/SkillOpt.git
synced 2026-07-07 00:15:39 +08:00
All six adapters duplicated an identical reflect() that delegates to run_minibatch_reflect. The copies had drifted: OfficeQA/DocVQA silently dropped meta_skill_context and ALFWorld dropped update_mode, so those analysts ran without inputs every other benchmark receives (active under the default use_meta_skill: true). Move the delegation into EnvAdapter.reflect as one default that forwards all kwargs uniformly, and delete the six overrides. reflect is no longer abstract — adapters inherit it and override only for custom logic. Net -225 lines. Behavior change: OfficeQA/DocVQA/ALFWorld reflect now receive the kwargs they previously dropped; the three already-correct benchmarks are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Benchmark Template
This directory provides scaffold files for adding a new benchmark to SkillOpt.
Files
env_template.py— Environment adapter template (subclassesEnvAdapter; implements the 4 abstract methods so the file is instantiable out of the box —reflectis inherited).loader_template.py— Data loader template (subclassesSplitDataLoader; implementsload_split_itemsfor.json/.jsonl).config_template.yaml— Config file template.
Usage
- Copy the directory:
cp -r skillopt/envs/_template skillopt/envs/your_benchmark - Rename the files (drop the
_templatesuffix):…and inside each file rename the classes (cd skillopt/envs/your_benchmark mv env_template.py adapter.py mv loader_template.py dataloader.pyTemplateBenchmarkEnv → YourBenchmarkAdapter,TemplateBenchmarkLoader → YourBenchmarkLoader) and fix the cross-import inadapter.py. - Implement the TODO blocks inside
adapter.py:rolloutand the_normalize_itemhelper indataloader.py. (reflectis inherited fromEnvAdapter; override it only for custom reflection logic.) - Register the adapter — add a
try / except ImportErrorblock inscripts/train.py's_register_builtins()mapping the registry key to yourYourBenchmarkAdapterclass. There is noBENCHMARK_REGISTRYdict inskillopt/envs/__init__.py; the live registry is_ENV_REGISTRYinscripts/train.py. - Create the config at
configs/your_benchmark/default.yaml(start fromconfig_template.yaml)._base_is a string path, not a list.
See the Add a New Benchmark guide
for the full step-by-step with a worked docfaithful example.