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.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43c21c7fff6016c11f1e2d9e0ec544e8888d81b5190f5594753497d5f4af84a3 |
|
MD5 | bd499dbc8b5e6d0b7091c6aaae39e57c |
|
BLAKE2b-256 | fc75777e5d5e488c7224362dc3ceefc4570c780a9ac026562e4f3ac85d1ce77a |
Hashes for onnxoptimizer-0.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f8bf25678e110f96b4bbc5a00f2a590ed74e8e23ee9a885eb0003ca7c8c2049 |
|
MD5 | 73dff6ac37936ea70b1fa640c9e95b02 |
|
BLAKE2b-256 | 49f4a4f920036f9ec819fee1332f685a95d6bcd2cc910eb0457e0df6a67b2493 |
Hashes for onnxoptimizer-0.3.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2db73d8f55a1c1593a6843cef1af0a2a430edf1dfa87abc1634b79c604f6a4f1 |
|
MD5 | f1f6a136dbd39e750647b85b0506ca77 |
|
BLAKE2b-256 | fc1904459a9cdaba55a44dc01ef5ee03ff7ae9c553dba8d7bd47477d8a5f30d4 |
Hashes for onnxoptimizer-0.3.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f7cb4f7c94374a32a762a3a06d573b22088f375cb67de338b5e9fff877a63cc |
|
MD5 | cc221773de7c3f0278a3f9a226d6f7fd |
|
BLAKE2b-256 | 958061e185afe2351dc90ff4c81687622d64a49eeddaa1a8d5da16b8c73f89a5 |
Hashes for onnxoptimizer-0.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30c7dcd59e2bdc641b22b569345cc72fa1e697614aba1ad8a59a5b6e62a7d80b |
|
MD5 | fea846ee553bb155b912e22838f81378 |
|
BLAKE2b-256 | 923873e27f5ac27acd545ab43a0e48ba2f3d4f109f6ebd5fb466db0b33f67dce |
Hashes for onnxoptimizer-0.3.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 561a0c2238e335b5dfdba0307c87955cd2aebfe7863f0f0b207d9d4785c28c13 |
|
MD5 | 25523462d344943de310a6a0f83016fa |
|
BLAKE2b-256 | a3c69b6032901bb27a38edfc7d87cb0bba7a0561c9ab25dfd7a5ee5007056a80 |
Hashes for onnxoptimizer-0.3.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b309dc818c903397655394cff9680fa537186223ff5c6478e29264d60155f9ee |
|
MD5 | e0f65684c75e0f50153433ef78b829a7 |
|
BLAKE2b-256 | 9b6dc4d60c9a76dde29150d53f4041b1d477f0e94ca23b81085fc48800c38d4f |
Hashes for onnxoptimizer-0.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64d2f6ec648e2cead98bd6a53dcf428b551f919ab7cae8cf673d8b521be4349a |
|
MD5 | 084afd20633944bb35b64edc310e1eba |
|
BLAKE2b-256 | 40d7975e229bad035d9502f3f4fd851198d311b8392f21470eb511d8d2f7b0ff |
Hashes for onnxoptimizer-0.3.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d35a5e9381ddfb1ad924659c804de0b99cdf73c657d22374b9a08265e0eddc21 |
|
MD5 | 6f8dccf27f4da95a97ccfc1eb7f7d757 |
|
BLAKE2b-256 | a6b83f10b4f144532b0f8330ddcbef89170f649dae10be0107c893a891dc7e07 |