onnx
Routes ONNX model-format, Python API, validation, reference-evaluator, backend-test, and operator-spec maintenance workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- onnx
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Routes ONNX model-format, Python API, validation, reference-evaluator, backend-test, and operator-spec maintenance workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/build-test-troubleshooting.md4.7 KB
- 参考文档references/repo-provenance.md2.8 KB
- 参考文档references/repo-routing-metadata.json324 B
- 参考文档references/troubleshooting.md5.6 KB
- 脚本scripts/onnx_environment_smoke.py3.9 KB
03 SKILL.md 正文
ONNX
Use this repo skill when a task involves the onnx Python package, ONNX ModelProto/GraphProto/TensorProto files, ONNX model serialization, checker or shape inference failures, ONNX text syntax, ReferenceEvaluator, backend test data, or maintainer work on ONNX operator schemas and generated artifacts.
ONNX is a runtime-agnostic model interchange format. This skill focuses on the ONNX package and standard itself, not on exporter-specific framework code or hardware-runtime inference engines.
Start Here
-
Read
references/repo-provenance.mdbefore deciding whether this skill is current for a particular ONNX checkout or release. -
Install released ONNX for ordinary model work:
python -m pip install onnx # optional, only for image/reference workflows that need Pillow: python -m pip install 'onnx[reference]' -
For an ONNX source checkout, prefer the repository's reproducible build path when available:
pixi run install pixi run pytestOtherwise use an isolated Python environment and
python -m pip install -e . -v. C++ changes require rebuilding. -
Run
python scripts/onnx_environment_smoke.py --help, thenpython scripts/onnx_environment_smoke.pyto verify that the active Python can import ONNX, build a tiny model, check it, infer shapes, and run the reference evaluator. -
Read
references/troubleshooting.mdfor cross-cutting install/import, optional dependency, data-file, CLI, and workflow failures.
Route by Task
| User task | Read |
|---|---|
Create a model, build nodes/graphs/tensors, save/load *.onnx, inspect model IO, use JSON/textproto/onnxtxt/protobuf formats, compose/extract models, or manage external data and large tensors |
sub-skills/model-authoring/SKILL.md |
Validate a model or node, diagnose ValidationError, run shape/type inference, parse or print ONNX text, convert opsets, inline functions, or use check-model/check-node |
sub-skills/validation-and-conversion/SKILL.md |
Execute a model with ONNX's pure-Python ReferenceEvaluator, compare expected outputs, inspect reference op behavior, implement a backend interface, or generate bounded backend-test data |
sub-skills/reference-and-backend-tests/SKILL.md |
Add or update an ONNX operator, write a function body, add C++ shape inference, edit .in.proto sources, update reference ops/node tests/version adapters, regenerate docs/protos, or run maintainer gates |
sub-skills/operator-spec-maintenance/SKILL.md |
Common Routing Decisions
- If the user has a broken ONNX file and asks whether it is legal, start with
validation-and-conversionbefore editing the model. - If the user asks how to create or transform an ONNX file, start with
model-authoring; then callvalidation-and-conversionfor checker and shape-inference gates. - If the user asks whether an ONNX model computes the expected values without a framework runtime, start with
reference-and-backend-tests. - If the user is modifying operator definitions, shape inference, tests, generated docs, or protobuf schemas in an ONNX checkout, start with
operator-spec-maintenanceeven when Python API checks are also needed. - If a task is about PyTorch, TensorFlow, scikit-learn, ONNX Runtime, TensorRT, or OpenVINO export/execution behavior, use this ONNX skill only for the standard-format artifact and validation layer; use the exporter/runtime skill for framework-specific behavior.
Shared References
references/troubleshooting.mdcovers install/import, package extras, CLI/API misuse, external data, large-model, build, and optional backend failure surfaces.references/build-test-troubleshooting.mdexplains ONNX build/test/lint choices for future source-checkout tasks.references/repo-provenance.mdrecords the source snapshot and refresh baseline.references/repo-routing-metadata.jsonis structured router metadata for managed repo-skill import.
Shared Script
scripts/onnx_environment_smoke.pyperforms a source-free ONNX import/API smoke in the active Python environment. Use it after installing ONNX or before relying on this skill in a new environment.
Safety and Scope Boundaries
- Do not treat a successful ONNX checker run as proof that a hardware runtime such as ONNX Runtime, TensorRT, OpenVINO, or a framework exporter will execute the model; ONNX validation proves format/schema consistency, not backend kernel support.
- Do not run large model downloads, backend real-model tests, fuzzers, release scripts, or long C++ builds unless the user explicitly needs that workflow.
- For models larger than the single-protobuf size limit, prefer path-based checker and shape-inference APIs and external data; do not load huge models into memory just to validate them.
- Treat optional dependencies such as Pillow for image-reference workflows as conditional, not baseline ONNX requirements.
- When editing ONNX itself, edit source-of-truth files and regenerate generated artifacts; do not hand-edit generated proto or generated operator documentation as the primary change.
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).