๐Ÿš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more โ†’
Socket
DemoInstallSign in
Socket

onnx-checker

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onnx-checker

CLI utility to verify operator support before converting ONNX models to Kneron NEF format

0.1.6
PyPI
Maintainers
1

ONNX Checker

PyPI version License

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)

FeatureDescription
Operator scanFast, dependencyโ€‘free static analysis of .onnx files
Hardware profilesBuiltโ€‘in JSON compatibility tables for common NPUs (Currently only KL520, 530, 630, 720, 730 โ€ฆ) with an easy override mechanism
Clear reportCLI table plus optional JSON / Markdown export; highlights unsupported ops and optionalโ€‘feature gaps
Actionable hintsSuggestions and links to official docs for each unsupported operator
Roadmap
MilestonePlannedNotes
0.2Markdown/JSON report templatesNice for CI bots
0.3Model slimming (--prune, --quantize)Reduce model size before flashing
0.4Automatic op replacement (--replace)Swap unsupported ops for functionallyโ€‘equivalent kernels
0.5Interactive web viewer (onnx-op-view)Dragโ€‘andโ€‘drop visualiser

๐Ÿš€ Quickย start

CommandDescription
pip install onnx-checkerInstall latest package from PyPI
onnxcheck my_model.onnx -p KL720Inspect my_model.onnx for the KL720 hardware profile
onnxcheck my_model.onnxInspect my_model.onnx for all built-in profiles
onnxcheck -V, onnxcheck --versionShow 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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts