#70 · Primary category: MLOps & Evaluation

onnxsim

deep-learning onnx pytorch

Simplify your onnx model

Project last updated:08/30/26

GitHub Stars

4.4K

Forks

432

Contributors

27

License

Apache-2.0

Why we included this project

Anyone who has exported a PyTorch model to ONNX has probably stared at the result and wondered where all the extra ops came from. torch.onnx.export tends to leave constant shapes as Gather and Unsqueeze chains plus dead branches, and onnxsim exists to clean that up. It runs shape inference, graph optimization, and constant folding in a loop until the graph stops changing, which usually means a leaner, faster model that is far easier to read when something goes wrong. Because it works as either a command-line tool or a Python function, it slots naturally between export and deployment. The random-input correctness check is a real safeguard, and support for custom ops like TensorRT plugins and optional opset conversion means it is not just for toy models. Teams shipping ONNX to TensorRT, ONNX Runtime, or edge devices will save themselves real debugging time before the model reaches production.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category