brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
onnxsimRepo skill for ONNX Simplifier: ONNX model simplification, graph rewriting, metrics, profiling, packaging, and bindings.
Independent GitHub snapshot · Automated classification · Original documentation governs
onnxsim)Use this repo skill when a task involves ONNX Simplifier / onnxsim: simplifying
exported ONNX graphs, validating simplified models, controlling optimizer and
constant-folding behavior, using custom rewrite rules, inspecting model metrics
or profile traces, or maintaining the package's Python/C++/Rust/WASM bindings.
references/repo-routing-metadata.json is structured metadata for managed
repo-skill import; do not hand-edit router Markdown.python -m pip install -U onnxsim
python -c "import onnxsim; print(onnxsim.__version__)"
onnxsim --help
onnxsim --list-default-optimizers
If an environment may be broken, run the bundled checker from this skill root:
python scripts/check_onnxsim_env.py --help
python scripts/check_onnxsim_env.py --smoke --json
python scripts/check_onnxsim_env.py --providers CPUExecutionProvider --json
The checker imports onnxsim, verifies the compiled extension, reports optional
ONNX Runtime providers, probes the CLI optimizer list, and can run a tiny
in-memory simplification smoke.
| User task | Read |
|---|---|
| Simplify an ONNX file with the CLI, set input shapes, run correctness checks, choose CPU/CUDA providers, save external data, convert target opset, or use custom operator schemas | sub-skills/python-simplification/SKILL.md |
Call onnxsim.simplify from Python with ModelProto objects, inspect the full API signature, map CLI flags to parameters, or recover from model/check/provider errors | sub-skills/python-simplification/SKILL.md |
Author Python custom_rewriter callbacks, pure-data FunctionProto rewrite rules, or custom schema import logic | sub-skills/advanced-graph-control/SKILL.md |
Use ModelInfo, MACs/FLOPs/memory metrics, annotate_metadata, diff_graphs, --graph-diff, profile, ort_profile, or merged ONNX Runtime traces | sub-skills/advanced-graph-control/SKILL.md |
| Install/build from source, diagnose missing submodules/nanobind/protobuf/CMake, build the C API, use Rust crates, build WASM/npm/web demo, or check release versions | sub-skills/bindings-and-packaging/SKILL.md |
onnxsim.simplify(model, ...) accepts an ONNX file path or an in-memory
onnx.ModelProto and returns (simplified_model, check_ok).onnxruntime is optional for the Python
package; without it, onnxsim can use ONNX's reference evaluator.--cuda means --providers CUDAExecutionProvider CPUExecutionProvider.--skip-schema-import.custom_rewriter callbacks and pure-data function_rewrite_rules are
mutually exclusive in one simplify() call.ModelInfo and annotate_metadata are static inspection tools; unknown shapes
or missing optional sympy can make metrics best-effort or symbolic.-DONNXSIM_BUILTIN_ORT=OFF; it does not
compile vendored ONNX Runtime C++. ONNX Runtime C++ builds belong to standalone
CMake/C API/Rust native-library/default-WASM paths.scripts/check_onnxsim_env.py: installed
package, provider, CLI, and tiny simplification smoke checker.sub-skills/python-simplification/scripts/simplify_tiny_model.py: safe tiny model simplification helper.sub-skills/advanced-graph-control/scripts/function_rule_smoke.py: pure-data FunctionProto rewrite smoke.sub-skills/advanced-graph-control/scripts/model_metrics_smoke.py: metrics, metadata, and graph-diff smoke.sub-skills/bindings-and-packaging/scripts/check_version_sync.py: read-only version metadata checker for a user-supplied source tree.onnxsim --help / --list-default-optimizers for
ordinary use.check_n, deterministic input_fill, and explicit test_input_shapes
when correctness matters.check_ok=False, provider validation errors, and schema validation
errors as blockers for deployment-style tasks until the user accepts the risk
or the issue is fixed.