runner-and-training
Build, adapt, and troubleshoot MMEngine Runner and FlexibleRunner training workflows, hooks, optimizers, schedulers, checkpoints, resume, distributed launch, and optional strategies.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- runner-and-training
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Build, adapt, and troubleshoot MMEngine Runner and FlexibleRunner training workflows, hooks, optimizers, schedulers, checkpoints, resume, distributed launch, and optional strategies.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/hooks-optim-schedulers.md7.1 KB
- 参考文档references/large-model-and-distributed.md6.4 KB
- 参考文档references/runner-workflows.md7.8 KB
- 参考文档references/troubleshooting.md8.7 KB
03 SKILL.md 正文
Runner and Training
Use this sub-skill when a task mentions Runner.from_cfg, Runner, FlexibleRunner, train_cfg, val_cfg, test_cfg, hooks, checkpoints, resume, AMP, gradient accumulation, parameter schedulers, distributed launch, or large-model strategies.
Read Order
- references/runner-workflows.md: Assemble
RunnerandFlexibleRunnerconfigs, choose train/val/test loops, handle checkpoint/resume semantics, and understand runtime outputs. - references/hooks-optim-schedulers.md: Configure default/custom hooks, checkpoint best metrics,
OptimWrapper/AmpOptimWrapper, gradient accumulation, clipping, and parameter schedulers. - references/large-model-and-distributed.md: Choose launchers, distributed backends,
FlexibleRunnerstrategies, AMP/compile/checkpointing, and dependency-gated DeepSpeed/FSDP/ColossalAI paths. - references/troubleshooting.md: Diagnose common Runner, hook, optimizer, scheduler, checkpoint, resume, launcher, and strategy failures by symptom.
- scripts/runner_config_smoke.py: Safely validate Runner-like JSON config shape without importing project code, downloading data, launching distributed jobs, or training.
Scope
This sub-skill owns MMEngine training orchestration: mmengine.runner, mmengine.hooks, mmengine.optim, mmengine._strategy, training/validation/testing loops, checkpointing, resume/load behavior, randomness, log processors, distributed launch recipes, and optional strategy configs.
Route adjacent issues to sibling skills:
- Use
../configuration-and-registry/SKILL.mdfor Python/YAML config syntax,_base_, custom imports, registry scopes, andbuild_from_cfgfailures. - Use
../models-metrics-and-inference/SKILL.mdforBaseModel.forward,train_step,val_step, evaluator, metric, TTA, and prediction contracts. - Use
../data-structures-and-io/SKILL.mdfor dataset, sampler, collate, data element, annotation, and file IO details. - Use
../runtime-utilities-and-visualization/SKILL.mdfor visualizer backends, logger internals, message hubs, device utilities, and general distributed helpers outside Runner orchestration.
Fast Workflow
- Identify the entry point:
Runner.from_cfg(cfg)for config-driven projects, directRunner(...)for small experiments, orFlexibleRunner(...)whenstrategy,compile, or large-model training is central. - Check loop completeness: training needs
model,work_dir,train_dataloader,train_cfg, andoptim_wrapper; validation/testing additionally need matching dataloaders, loop cfgs, and evaluators. - Align time units: if
train_cfg.by_epoch=False, also aligndefault_hooks.checkpoint.by_epoch,default_hooks.logger.log_metric_by_epoch,log_processor.by_epoch, and schedulerby_epochorconvert_to_iter_basedsettings. - Decide checkpoint semantics:
load_fromwithoutresume=Trueloads weights only;resume=Truerestores optimizer and scheduler state from the latest or specified checkpoint. - Validate risky edits from this sub-skill directory with
python scripts/runner_config_smoke.py --config-json config.jsonafter converting the relevant config shape to JSON.
Output Expectations
Runner.train() returns the trained model, while Runner.val() and Runner.test() return metric dictionaries. Runtime outputs normally include checkpoints, logs, and visualizer files under the configured work_dir or log directory; this sub-skill treats those as user project outputs, not managed skill files.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.