AGENT SKILL

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-09-03
Stars
★ 351
Forks
27

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 资源文件 5

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 Runner and FlexibleRunner configs, 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, FlexibleRunner strategies, 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.md for Python/YAML config syntax, _base_, custom imports, registry scopes, and build_from_cfg failures.
  • Use ../models-metrics-and-inference/SKILL.md for BaseModel.forward, train_step, val_step, evaluator, metric, TTA, and prediction contracts.
  • Use ../data-structures-and-io/SKILL.md for dataset, sampler, collate, data element, annotation, and file IO details.
  • Use ../runtime-utilities-and-visualization/SKILL.md for visualizer backends, logger internals, message hubs, device utilities, and general distributed helpers outside Runner orchestration.

Fast Workflow

  1. Identify the entry point: Runner.from_cfg(cfg) for config-driven projects, direct Runner(...) for small experiments, or FlexibleRunner(...) when strategy, compile, or large-model training is central.
  2. Check loop completeness: training needs model, work_dir, train_dataloader, train_cfg, and optim_wrapper; validation/testing additionally need matching dataloaders, loop cfgs, and evaluators.
  3. Align time units: if train_cfg.by_epoch=False, also align default_hooks.checkpoint.by_epoch, default_hooks.logger.log_metric_by_epoch, log_processor.by_epoch, and scheduler by_epoch or convert_to_iter_based settings.
  4. Decide checkpoint semantics: load_from without resume=True loads weights only; resume=True restores optimizer and scheduler state from the latest or specified checkpoint.
  5. Validate risky edits from this sub-skill directory with python scripts/runner_config_smoke.py --config-json config.json after 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351