deployment-export
Export, inspect, and benchmark Detectron2 models with TorchScript, optional Caffe2/ONNX paths, and safe command construction.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- deployment-export
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Export, inspect, and benchmark Detectron2 models with TorchScript, optional Caffe2/ONNX paths, and safe command construction.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/analysis-and-benchmarking.md4.6 KB
- 参考文档references/export-workflows.md7.0 KB
- 参考文档references/model-conversion.md4.3 KB
- 参考文档references/troubleshooting.md4.9 KB
- 脚本scripts/analyze_command_builder.py5.3 KB
- 脚本scripts/export_command_builder.py6.6 KB
03 SKILL.md 正文
Detectron2 Deployment Export
Use this sub-skill when a task involves exporting a Detectron2 model for deployment, choosing between tracing/scripting/Caffe2 tracing, inspecting TorchScript IR, preparing ONNX/Caffe2 attempts, building export commands, analyzing FLOPs/parameters/activations, or planning benchmark runs.
Fast Routing
- Read references/export-workflows.md to choose
tracing,scripting, or optionalcaffe2_tracing, and to understand format/runtime limits. - Use scripts/export_command_builder.py to print a validated export command without importing Detectron2, loading weights, building a model, or writing output files.
- Read references/analysis-and-benchmarking.md before FLOP, activation, parameter, structure, data-loader, train, or eval benchmark work.
- Use scripts/analyze_command_builder.py to print a validated model-analysis command without building a model.
- Read references/model-conversion.md for TorchScript input schema, Caffe2/ONNX caveats, and torchvision checkpoint conversion guidance.
- Read references/troubleshooting.md when export fails, optional dependencies are missing, model families are unsupported, sample inputs are absent, or benchmark results are hardware-sensitive.
Safe Defaults
- Prefer
--export-method tracing --format torchscriptfor a first deployable artifact when a valid sample image or dataset sample is available. - Prefer
--export-method scripting --format torchscriptwhen dynamic batch size is required and the model family is scriptable. - Treat
caffe2_tracing, Caffe2 protobuf, and ONNX as optional paths that require extra dependency and runtime checks. - Keep export and analysis dry-run planning separate from actual execution; the bundled scripts print commands only.
- Ask before running export, evaluation, benchmark, or analysis commands that load weights, touch datasets, write large output directories, or use GPU/accelerator resources.
Boundary Notes
This sub-skill owns deployment export method/format selection, TracingAdapter, scripting_with_instances, dump_torchscript_IR, optional Caffe2/ONNX planning, command construction, model analysis, and benchmark safety. Route config discovery and model-zoo checkpoint selection to ../configuration-model-zoo/. Route dataset registration and loaders to ../data-datasets/. Route training and evaluator semantics to ../training-evaluation/. Route custom trace/script compatibility design for new architectures or project extensions to ../extension-projects/.
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).