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.6-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddc079eaeb83e851773f7c4ae71cedeae6edd89a8ab5877b8450cf8f31c8d3b2 |
|
MD5 | c86fbd374d8980f2285d04b3766512bc |
|
BLAKE2b-256 | a97529cce7e5b50f59c44a815db7594064df697062819f0b2e5c1dcab60609a1 |
Hashes for onnxoptimizer-0.3.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6227c555ee09e753a62d230287ef1aa812f009cbced9c83670003cf85f3a21de |
|
MD5 | 9dedd6f365d44b289135b118dd6429a1 |
|
BLAKE2b-256 | fee556680d1c078d419707e49ec70dc9ec51ec6f9be89362d20612dee3fc408f |
Hashes for onnxoptimizer-0.3.6-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 184fdf5081b500d6c229e87da586e810231f2aadece00ebe878cea13789f03c9 |
|
MD5 | 82d2c4439c47077aa0042408b07b90fe |
|
BLAKE2b-256 | a53a3dbf8c502785634aeeb03d46a92c9ea89d455d67c4c9874d2597f0c6bcda |
Hashes for onnxoptimizer-0.3.6-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bc682d0c9234f11beab25bd6d0214e692368b18d66d297278ebe3175fdb87db |
|
MD5 | 20a43e8bcc11f748232477c3bf7f9724 |
|
BLAKE2b-256 | e0091abb2007047eaee1148b166d69b33f5cd4a45692c7710c7e493d3e9b0c10 |
Hashes for onnxoptimizer-0.3.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc94858c7a2df3e5623abd5c72d0b6e808727ae0c484955ada53f6f2f53ea51f |
|
MD5 | 56bc02d9a3971e198728585a2131234a |
|
BLAKE2b-256 | 95fe3281e7c78871f15caa32666cb641b0f13a365e607a5c745267cfff66277a |
Hashes for onnxoptimizer-0.3.6-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c1c8ebafa5cdd90449f1dd517ce3ad4f0b7ec17631dce3b6b9e36e49dc3167d |
|
MD5 | fa23e040f7e337bd9a06b355c1448361 |
|
BLAKE2b-256 | 7fa7dbb652fb1802617c21ed0a395217a320fbd2867012cf91ed50f0255f363e |
Hashes for onnxoptimizer-0.3.6-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c26b939116f1230290e9c6e9e0dd40abed2087cb0cc9dfae51c6a826fee2353a |
|
MD5 | b0d29379cd84e4625fda0549d99a923c |
|
BLAKE2b-256 | 67a7a2c1c0f904800c66ca174639205d2d32766f22bcd4db3e0a5f54b9590def |
Hashes for onnxoptimizer-0.3.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6084c1d18e175ae2cb392091ab4defbcc2809c47cb570f68e1b5c7d92d347e1c |
|
MD5 | 747db37f6a927bfef6b2ba33be5a359d |
|
BLAKE2b-256 | d5e7541b5e95303c8c377aa5453320e1e7127f430541b726a300a863a753879f |
Hashes for onnxoptimizer-0.3.6-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11531fcf39e32ee365001cd09dc88379cedfa1131a2cbd82df98d012ebc04561 |
|
MD5 | b47f3047fc0468fb6cafc7dad8e08840 |
|
BLAKE2b-256 | cc8dc5441836044a15a27d2475d7ad72e0627d3ed8a072deb152afcb4df8c000 |
Hashes for onnxoptimizer-0.3.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e65f6d9cab8a433de673fe938a0e309aa1b82b041c5f9b6282700411be7bc473 |
|
MD5 | eef38a245ed768743132e6256d76f635 |
|
BLAKE2b-256 | e4e0e04b7d104eb9a1022e53ba62ddc80c8abcf4b6fc30b60826fb873a521998 |
Hashes for onnxoptimizer-0.3.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95926720b8817ef13b9355179e126ac473d5024f69d2b91f21a38c7c5ad56561 |
|
MD5 | 240ea50b1fd8f6efd9f17dc8da1ec050 |
|
BLAKE2b-256 | 80624831d6a635e10180613a1f755bb8701b790ca47923c8059397d530080a80 |
Hashes for onnxoptimizer-0.3.6-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b22b4923f92ccbaafc9580c5f6753368efc30d5394c07560ab62bcc260b8c3fd |
|
MD5 | 60a94f92feb3e8c55500a10a1a6dc7de |
|
BLAKE2b-256 | 0eb0d6aae07ae140e51dbc1ee524b62608c3dce697450f497737f75325f5d901 |
Hashes for onnxoptimizer-0.3.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bb9b09b21c03f01073a1d505b57dc992b26113fc36186d86df32f80b848223c |
|
MD5 | 2f285b06222c52fc6d7d8fdbc499453a |
|
BLAKE2b-256 | a6059b2a86e203e7addc4775925f9006bb08100d4881eeb9bdd9d0d93dfa6a3e |
Hashes for onnxoptimizer-0.3.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ee4f837088c03d29e83c88359455c1c39bcedffc4abbfba8832209307fab2eb |
|
MD5 | 646dff96ed68fc063ccd190cf0251643 |
|
BLAKE2b-256 | 590440175c90ea4998e334f18fc88f513dfe0afddc7ca648891180dc4a4b194d |
Hashes for onnxoptimizer-0.3.6-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c37827f43e1a5de9535bda845736d9781297a017d4c89a1b2e499d137c7e50b3 |
|
MD5 | 0bc895d0813bd696465c35cca2d8ec07 |
|
BLAKE2b-256 | e4caa40174115495c0211ab64bd5b998320ef4133d1d4514f8d5b4fcdf957024 |