writing-skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment
extensibilityExtend MMDeploy with rewriters, backend/codebase support, custom ops, partition marks, and focused developer tests.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this sub-skill when the task is to modify or extend MMDeploy internals rather than run routine model conversion. It covers developer work for:
| User need | Go to |
|---|---|
| Make a PyTorch/MMCV/OpenMMLab function exportable, replace a module during export, or emit backend-specific ONNX nodes | references/rewriters.md |
| Add a backend, make a backend wrapper discoverable, extend backend/codebase/task enums, or add a codebase task processor | references/backend-and-codebase-support.md |
| Add or debug backend custom ops, write a backend op unit test, mark partition boundaries, or connect marks to extraction | references/custom-ops-and-partitioning.md |
| Write focused tests for rewrites, custom ops, or wrappers; choose pytest targets and interpret backend skips | references/testing.md |
| Diagnose import, checker, backend, config, ABI, symbolic-domain, dynamic-axis, or partition failures | references/troubleshooting.md |
RewriterContext or patch_model tests for Python behavior, and use backend-aware export tests only when the backend/plugin is available.RewriterContext; module rewrites should be intentionally permanent because patch_model mutates the model.RewriterContext activates function and symbolic rewriters for the selected backend/IR and restores them on exit.patch_model activates module rewriters and mutates the model by replacing matching submodules.Backend, Codebase, and Task enum values must match backend_config.type and codebase_config values.mmdeploy.backend.<backend_name>; the backend package __init__ must import/register the manager.@mark partition nodes must be inside a rewrite path and require partition_config.apply_marks=True to appear in exported ONNX.