Open Neural Network Exchange
Project description
ONNX Optimizer
Introduction
ONNX provides a C++ library for performing arbitrary optimizations on ONNX models, as well as a growing list of prepackaged optimization passes.
The primary motivation is to share work between the many ONNX backend implementations. Not all possible optimizations can be directly implemented on ONNX graphs - some will need additional backend-specific information - but many can, and our aim is to provide all such passes along with ONNX so that they can be re-used with a single function call.
You may be interested in invoking the provided passes, or in implementing new ones (or both).
Installation
You can install onnxoptimizer from PyPI:
pip3 install onnxoptimizer
Note that you may need to upgrade your pip first if you have trouble:
pip3 install -U pip
If you want to build from source:
git clone --recursive https://github.com/onnx/optimizer onnxoptimizer
cd onnxoptimizer
pip3 install -e .
Note that you need to install protobuf before building from source.
Roadmap
- Command-line API (e.g.
python3 -m onnxoptimizer model.onnx output.onnx
) - More built-in pass
- Separate graph rewriting and constant folding (or a pure graph rewriting mode, see issue #9 for the details)
Relevant tools
-
onnx-simplifier: A handy and popular tool based on onnxoptimizer
-
convertmodel.com: onnx optimizer compiled as WebAssembly so that it can be used out-of-the-box
Code of Conduct
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for onnxoptimizer-0.3.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60478466737bad40a028dfe24c0cca600625386265bd08a69cdafe6850f73771 |
|
MD5 | cdebe54fb2b066dda521ca8c1e02e5e9 |
|
BLAKE2b-256 | 6174965d020081c175b9ca4ef34970ea30fd0f0d2cd2e82a528246b7bc91592e |
Hashes for onnxoptimizer-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 857f30cbe8bc46530c1aceba7c2346f40d31205a3b673240dbf786a9ad0914ac |
|
MD5 | ad7bd216ed6e63030292a916c098c4e0 |
|
BLAKE2b-256 | 9379839918a556432ec94bf234ae8d1c75f323757b97e8f5236587ff1cc8495c |
Hashes for onnxoptimizer-0.3.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df1d98639f85a8ea4ee1f56b1163daf837d925f5f865e7ff8e4d3e22d6c932ec |
|
MD5 | 6f703940b95f8094bfe678412c14b1e0 |
|
BLAKE2b-256 | 48b5dc0fae5ae6f40b3aff50a7b8ff80e2b986672e7c4e7f6cbad81f37d56e7b |
Hashes for onnxoptimizer-0.3.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4cb441e46a6088452768b22efcbe11b77ae911bfcdc0676b4f47adf21d7189f |
|
MD5 | ece727ffa18641a8a47e024920d03b46 |
|
BLAKE2b-256 | 11aa1b8babaf3e896c4f0f58fcb3d35d48affc0eb837512c2d1d7fd0eee067af |
Hashes for onnxoptimizer-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a77e309795611a2c531e5da1a5c2d0cba8a5552c04af3992b043fb8970d47d7a |
|
MD5 | 86b9a34a6ca521e211dad47581bb5a6d |
|
BLAKE2b-256 | 20a1e8c6e7f2c3585876c0981b813a3f314082e91aa5209cb393e4b726f14b07 |
Hashes for onnxoptimizer-0.3.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6c93b2703b0849cede387340e98e67f0163c40346c2e9cc83717a122a993eb9 |
|
MD5 | eac69c19758f0117d07d963242fd7717 |
|
BLAKE2b-256 | b6690b0ea4ef0f22af0cb6860a5003507cca60ba309da420a670a84b746a8065 |
Hashes for onnxoptimizer-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd618d83f7915bbe312b4a90cbf38d15fc5fd75d9cd800cd02ca9cdc71a82e34 |
|
MD5 | 7b13481e247f127f8bd55d65524ecb39 |
|
BLAKE2b-256 | 7ac8c84ba3758f936117ab360523ce62d3f22e4d5b20ecb086d18aa887dbe2bb |
Hashes for onnxoptimizer-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b791909f63fd2560d4bbf1df97850a9b2ee74627e7c22f06f2ee664c7d9bd25 |
|
MD5 | e8ea7c1a40e0bac154c06a1d97508ff5 |
|
BLAKE2b-256 | 7e971888217fd8c97b0fdc65c491acfcf1bde1ca0622f57dcdacb6288675143e |
Hashes for onnxoptimizer-0.3.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cc9eb306cb3c6a2c2efa74e2b7daacccfd779503563ecf3a4148b353290d493 |
|
MD5 | a11baff60874ece3bd7b026d38033315 |
|
BLAKE2b-256 | 470cfa2a0dcfeb61abc7983b38c0b48e69f3aec8a9fbc48b55d3d82e09e8ac4d |