AGENT SKILL

mmgeneration

Routes MMGeneration tasks across sampling, training, evaluation, configuration, and latent-editing workflows.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
mmgeneration
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Routes MMGeneration tasks across sampling, training, evaluation, configuration, and latent-editing workflows.
disable-model-invocation
true

02 资源文件 9

03 SKILL.md 正文

MMGeneration

MMGeneration is OpenMMLab's generative-model toolkit for GANs, translation models, SinGAN, and diffusion workflows.

Use this repo skill when the task mentions mmgen, MMGeneration, one of the model families below, or the repo's train/eval/demo/application scripts.

Start here

  1. Read references/installation-and-compatibility.md if the environment is not already verified.
  2. Read references/repo-provenance.md when you need to check whether this skill still matches the current checkout.
  3. Use the route map below to choose the right sub-skill.
  4. Use scripts/check_install.py for a fast import and backend smoke check.

Installation and verification

MMGeneration depends on a compatible PyTorch wheel, mmcv-full in the 1.x line, and mmcls in the 0.x line. A practical install order is:

  1. Install PyTorch and torchvision.
  2. Install a matching mmcv-full wheel for that torch/CUDA combination.
  3. Install mmcls<1.0.0 and the runtime requirements used by this repo.
  4. Install the repo itself in editable mode when working from a checkout.
  5. Run python scripts/check_install.py.

For detailed compatibility notes, backend guidance, and common failure modes, read references/installation-and-compatibility.md and references/troubleshooting.md.

Route map

Sub-skill Use it for Typical signals
sub-skills/inference-and-sampling/ Load a generator and sample unconditional, conditional, translation, or DDPM outputs init_model, sample_unconditional_model, sample_img2img_model, demo scripts, sample shapes, device selection
sub-skills/training-and-distribution/ Train or resume configs, choose launcher mode, or debug distributed training tools/train.py, dist_train.sh, slurm_train.sh, DynamicIterBasedRunner, EMA, CPU training, DDP wrapper
sub-skills/evaluation-and-metrics/ Run evaluation, precompute inception stats, or reason about FID/IS/PPL/SWD/PR/MS-SSIM tools/evaluation.py, inception_stat.py, translation_eval.py, metrics, online/offline evaluation
sub-skills/configuration-and-extension/ Edit configs, define datasets/pipelines, register new models/losses/hooks, or inspect config expansion _base_, _delete_, custom_imports, cfg-options, registries, dataset layouts, print_config.py
sub-skills/applications-and-deployment/ Latent interpolation, projection, SeFa, StyleCLIP, or TorchServe packaging apps/, mmgen2torchserver.py, projector.py, modified_sefa.py, styleclip.py

Public model families

MMGeneration's supported workflows cluster around these families:

  • Unconditional GANs: DCGAN, LSGAN, WGAN-GP, PGGAN, StyleGANv1/v2/v3, MS-PIE StyleGAN2, ADA.
  • Conditional GANs: SNGAN/Projection GAN, SAGAN, BigGAN, BigGAN-Deep.
  • Image translation: Pix2Pix and CycleGAN.
  • Internal learning: SinGAN and PESinGAN.
  • Diffusion: Improved DDPM.

See references/model-overview.md for the repo-facing model map and where each family lives.

Key public APIs

The installed package exposes mmgen.apis helpers for model loading and sampling, mmgen.models builders and registries, mmgen.datasets builders and dataset classes, and mmgen.core evaluation, hook, optimizer, and runner utilities. Read references/api-reference.md for verified signatures and references/data-formats.md for dataset layouts and pipeline keys.

CLI and command references

The repo does not define a console entry point; use the repository scripts directly. Read references/cli-reference.md for the main command families and flag meanings.

Shared helpers

  • scripts/check_install.py — verify that the installed package imports, the public modules are visible, and the expected backend is usable.
  • sub-skills/configuration-and-extension/scripts/print_config.py — print a fully resolved config with optional overrides.
  • sub-skills/inference-and-sampling/scripts/sample_mmgen.py — run a safe sampling helper across the common inference modes.

Troubleshooting

If a workflow fails, start with references/troubleshooting.md. The most common issues are:

  • mmcv.runner import failures from an incompatible MMCV version.
  • mmcv.ops/CUDA extension problems from the wrong wheel or missing GPU runtime.
  • styleclip.py requiring the optional clip package.
  • Dataset layout mismatches for paired or unpaired translation data.
  • Metric/extraction commands that need cached inception or VGG assets.

Provenance

When the repo changes, compare it with references/repo-provenance.md before reusing this skill.

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