ONNX Checker

onnx-check
is a lightweight CLI that inspects ONNX models before you convert or deploy them. It tells you exactly which operators the graph uses and whether they are supported on your target hardware.
"Catch unsupported operators early โ before they derail your model."
โ Mason Huang
โจ Features (v0.1)
Operator scan | Fast, dependencyโfree static analysis of .onnx files |
Hardware profiles | Builtโin JSON compatibility tables for common NPUs (Currently only KL520, 530, 630, 720, 730 โฆ) with an easy override mechanism |
Clear report | CLI table plus optional JSON / Markdown export; highlights unsupported ops and optionalโfeature gaps |
Actionable hints | Suggestions and links to official docs for each unsupported operator |
Roadmap
0.2 | Markdown/JSON report templates | Nice for CI bots |
0.3 | Model slimming (--prune , --quantize ) | Reduce model size before flashing |
0.4 | Automatic op replacement (--replace ) | Swap unsupported ops for functionallyโequivalent kernels |
0.5 | Interactive web viewer (onnx-op-view ) | Dragโandโdrop visualiser |
๐ Quickย start
pip install onnx-checker | Install latest package from PyPI |
onnxcheck my_model.onnx -p KL720 | Inspect my_model.onnx for the KL720 hardware profile |
onnxcheck my_model.onnx | Inspect my_model.onnx for all built-in profiles |
onnxcheck -V , onnxcheck --version | Show onnx-checker version |
Sample output
Model summary โ my_model.onnx
IR version : 6 Opset : 11
Inputs : input float32 [1, 3, 112, 112]
Outputs : output float32 [1, 512]
Dynamic axes : None detected โ
my_model.onnx ยท IR 6 ยท KL520
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Status Operator Count Notes โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ Conv 27 โ
โ โ Relu 27 โ
โ โ Elu 5 Not supported on KL520 โ
โ โ MaxPool 5 โ
โ โ Resize 2 Only linear/nearest modes OK โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ 2 unsupported operator(s) detected.
๐งโ๐ป APIย usage
from onnx_op_check import Checker, load_profile
checker = Checker("my_model.onnx", profile=load_profile("kl720"))
report = checker.run()
print(report.to_markdown())
๐ Hardwareย profiles
Profiles live under onnx_op_check/profiles/*.json
.
Each profile declares the operators, attributes, and constraints supported by a particular accelerator.
See docs/PROFILE_SCHEMA.md
for the JSON schema.
Contributions for new hardware are very welcome!
๐ค Contributing
We love pull requests! Please read CONTRIBUTING.md
and open an issue before you start a large refactor so we can align on design.
Coding conventions follow PEPย 8 with the Black formatter.
๐ License
Released under the MIT License ยฉย 2025ย Mason &ย contributors.
A note on language
The primary language of this README is English for wider community reach. A Traditional Chinese translation will be added soon in docs/README_zh-TW.md
.