mmengine
Use MMEngine to configure, train, evaluate, inspect, visualize, and troubleshoot PyTorch/OpenMMLab workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- mmengine
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use MMEngine to configure, train, evaluate, inspect, visualize, and troubleshoot PyTorch/OpenMMLab workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/package-overview.md3.4 KB
- 参考文档references/repo-provenance.md1.4 KB
- 参考文档references/repo-routing-metadata.json530 B
- 参考文档references/troubleshooting.md3.8 KB
- 脚本scripts/mmengine_import_check.py2.1 KB
03 SKILL.md 正文
MMEngine Repo Skill
Use this skill when a task mentions MMEngine, OpenMMLab engine utilities, Config, Registry, Runner, FlexibleRunner, hooks, optim wrappers, schedulers, BaseDataset, BaseModel, BaseMetric, Visualizer, or MMEngine distributed/runtime helpers.
Start Here
references/package-overview.md: Understand MMEngine's package layout, dependency model, public API families, and how the sub-skills fit together.references/troubleshooting.md: Diagnose cross-cutting install/import, optional dependency, config, runner, data, model, visualization, and distributed issues.scripts/mmengine_import_check.py: Run a safe import/API smoke check for the installedmmenginepackage before deeper debugging.references/repo-provenance.md: Check the source version and evidence baseline used to create this skill.references/repo-routing-metadata.json: Structured routing metadata consumed by DisCo's managed repo-skills router.
Route by Task
| User task signal | Read this sub-skill | Why |
|---|---|---|
Config files, _base_, CLI overrides, lazy imports, custom_imports, Registry, build_from_cfg, _scope_, default scope |
sub-skills/configuration-and-registry/SKILL.md |
Owns MMEngine config parsing, merge/dump, registry scopes, object-build diagnostics, and a safe config inspection helper. |
Runner, FlexibleRunner, training/validation/testing loops, hooks, checkpoint/resume, AMP, optimizers, schedulers, distributed launch, large-model strategies |
sub-skills/runner-and-training/SKILL.md |
Owns training orchestration, Runner config shape, hook/optimizer/scheduler interactions, checkpoint semantics, and dependency-gated distributed/strategy guidance. |
BaseDataset, transforms, samplers, collate functions, InstanceData, PixelData, LabelData, mmengine.fileio, backend_args |
sub-skills/data-structures-and-io/SKILL.md |
Owns data contracts, dataset initialization, transform pipelines, data elements, and backend-agnostic file IO. |
BaseModel, BaseModule, preprocessors, model step modes, BaseMetric, Evaluator, DumpResults, inferencers, TTA, complexity analysis |
sub-skills/models-metrics-and-inference/SKILL.md |
Owns model/evaluator contracts, prediction/result shapes, TTA wrappers, inferencer patterns, and analysis limits. |
MMLogger, MessageHub, Visualizer, visual backends, init_dist, collect_results, master_only, devices, collect_env, timers, testing helpers |
sub-skills/runtime-utilities-and-visualization/SKILL.md |
Owns logging, visualization, optional tracking backends, distributed/device utilities, environment reports, and runtime diagnostics. |
Common Workflows
- For a full training project, read in this order:
configuration-and-registry,data-structures-and-io,models-metrics-and-inference,runner-and-training, thenruntime-utilities-and-visualizationfor logging/visual output. - For a config-only edit, stay in
configuration-and-registryunless the edit changes runner loop placement, model/metric contracts, or dataset schemas. - For a failed training run, identify the failing layer first: config build, dataset/collate, model/metric contract, runner/hook/optimizer scheduling, or runtime backend.
- For optional services or large-model/distributed workflows, keep the safe local path working first, then add TensorBoard/WandB/MLflow/DeepSpeed/FSDP/ColossalAI only when dependencies, credentials, launchers, and hardware are available.
Safe Checks
From this skill directory, these helpers are safe and self-contained:
python scripts/mmengine_import_check.py --json
python sub-skills/configuration-and-registry/scripts/inspect_config.py --help
python sub-skills/runner-and-training/scripts/runner_config_smoke.py --demo
python sub-skills/data-structures-and-io/scripts/data_contract_smoke.py --help
python sub-skills/models-metrics-and-inference/scripts/model_metric_smoke.py --help
python sub-skills/runtime-utilities-and-visualization/scripts/runtime_env_check.py --help
The helpers do not download data, start distributed jobs, require credentials, or run long training. Full examples and native repository tests remain verification evidence, not runtime dependencies for this skill.
Boundaries
- This skill is for using MMEngine as a package in user projects, not for maintaining MMEngine release infrastructure.
- Do not assume optional services such as WandB, MLflow, ClearML, Aim, DVCLive, Neptune, DeepSpeed, ColossalAI, or FSDP extras are installed unless the user's environment proves it.
- Do not route downstream task-library behavior, such as MMDetection-specific datasets or MMSegmentation models, into this skill except where generic MMEngine contracts apply.
- Prefer small import/config/smoke checks before running training, distributed launchers, or service-backed visualization.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).