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.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aac4d5c4c5f4c471346dfb28356355b0c54c074a1f2fe1fe122b197f68c08a92 |
|
MD5 | d41b66a15fb8eabfc0bac220508c9952 |
|
BLAKE2b-256 | 525767aa3f912cf7ab5e005c29e0db25dc8c5e6ab6df120cc380fa4fd841a2e6 |
Hashes for onnxoptimizer-0.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c773b03313e253a60c7d8fe56ea5bba38fb3442ab84a825468a35a739e8fb20b |
|
MD5 | 874095cbfbd1cb39f9dad56f260fa30f |
|
BLAKE2b-256 | 88b9c51a73f69ca060f3408d7e42da0bc3a987b66e6d68d6c3648e1f806b465e |
Hashes for onnxoptimizer-0.3.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5547203ee3392e3dabcea68a3a4d316ee0269ad3cf8a3504d1f68d467f60a06a |
|
MD5 | 89e5b3aef8568f630a9f0f68ee1af9cf |
|
BLAKE2b-256 | 79d75899703f11067e1b49d0b11593b2804bf8a183ae7bba4451db808cb306bb |
Hashes for onnxoptimizer-0.3.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15da6a036df388c3f08c3fc638b4d313ee6a1b96aaaa1c602fd1b424dd7bbc23 |
|
MD5 | c7a6ee4dabd0096679dc434a6e1e171a |
|
BLAKE2b-256 | 61e5aa6e53ce7fadc6a0bc883d76f21767d947067f1162189193a986328583cf |
Hashes for onnxoptimizer-0.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 056a765593d197b2b643bfb35520a66eacebfc682583d9ac0389a56c2a259e6f |
|
MD5 | a2fb3edc46830e341956962479f491ea |
|
BLAKE2b-256 | 060e05977334e2ef2847b45398048373c5f14d63460ec7dcd2ff7076f9e77313 |
Hashes for onnxoptimizer-0.3.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60f1d3600f03466a451c05e3d12ce97565bae016e46f70396ba22208cfeae6f6 |
|
MD5 | 7034e1973031345fe8653c6d7adc6a3f |
|
BLAKE2b-256 | 9474e5107e1f6daf65103ba50731b1c42647f43897b575a193edeb9dfdb67b4d |
Hashes for onnxoptimizer-0.3.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9a815bba418abfb23f319838370cfd9450305a2da7d970a2261046889a70730 |
|
MD5 | c6df3700754c2961e27f02c975ea385a |
|
BLAKE2b-256 | 7c5d34bdc02d18f0eeebbc46a2a36870aadde4796e7920957391903300ab9f2c |
Hashes for onnxoptimizer-0.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8bf2bfe0dc43f0776867688e1759122dec049ff4f45f7221931b687fe7e139e |
|
MD5 | 0cf5f9909b4f75823b86a90364d25b3a |
|
BLAKE2b-256 | cfe576d76e063b4b79a7761924f525f7895ab146dc1a9f4c1379342151a349b4 |
Hashes for onnxoptimizer-0.3.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e73a5e2e3ca4db9bff54f7131768749c861677b97ee811a136fcf1a52783cf6e |
|
MD5 | 74029f6ea5ba5fb22797a3023f61bc05 |
|
BLAKE2b-256 | fc8dc3079f89b9f844ea8037d6442e2bbd74aff784dc8c8e5bf300187eaaf2f4 |