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.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7d08518a080cd9863cdbb72b58480b7769880ca37c343df26d40973611df796 |
|
MD5 | 2b779f457ec0afae6ae8c0d5a0deb792 |
|
BLAKE2b-256 | 72c719bd2d234b08624d93f2f11cfc7274a6c7ba4c086fa0eb81488dd7efb46c |
Hashes for onnxoptimizer-0.3.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8d819290d16b65ce9dee7d498784ddb14153ee280bbd8771284f2d220d3a84d |
|
MD5 | 53f0457c507a4813d63c9c76e66649c1 |
|
BLAKE2b-256 | 22c96ba8bed7d948b8abf2aef5730deb561bcafb4862e2f081c3fbd3617f7a0d |
Hashes for onnxoptimizer-0.3.5-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ef8aadb1da9c9d7441021bed465bd05b82192651324e615efbbec6f1cc7699 |
|
MD5 | 6d3cdfc2d9a6e227538fddbab16398ef |
|
BLAKE2b-256 | f6e3f738f32c48c462278dd91d82825021e8c36757b2fbddc268f3fbf9691554 |
Hashes for onnxoptimizer-0.3.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec52498fe5bf7a0c128834abffa1cd8f8172bf75850f7a3df44151985c1098ba |
|
MD5 | d9afe9f0276eb258ee482a81c96f9945 |
|
BLAKE2b-256 | 2ac41f57e64cd581816429b3d0164a8cc1265b440e4c5fe26e8db87364611f1c |
Hashes for onnxoptimizer-0.3.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d71989a5ee63b1567976ef7e44013a91c71acb9436486b947466520b035544a |
|
MD5 | 972b9c8bfcb43518b567223f83876e9f |
|
BLAKE2b-256 | 41b3b20e786bd7d628230b4dbd3d5baf89cddab5f1ff3c53bea2efdbfdd9a46a |
Hashes for onnxoptimizer-0.3.5-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 593972fc6411c557665c094506cf732fffb2633dfee27f4ddacb1fde6ae419e8 |
|
MD5 | 8764f25c60041920a103efdfcb3af456 |
|
BLAKE2b-256 | b31f763f26530ffdec5ae70771a56208a484c3cf2913fd53d76b67abe22e10ca |
Hashes for onnxoptimizer-0.3.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71957b3f4c274582dc9d875a3ef32ea1cb23fa51e764f665f8c239be45c3dae5 |
|
MD5 | 98888145667466429b817af4b5557448 |
|
BLAKE2b-256 | 9d4da053f9ac62be4c2be1d6ab6d713e4e41aa7f48bbcd56ac5f973717d74b70 |
Hashes for onnxoptimizer-0.3.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7732c160a071c3fac7f0a74cf537752c17a997b462801f22568ea80bf5b967f |
|
MD5 | 6888b60f6c6b5e1366b21a7927c70c21 |
|
BLAKE2b-256 | 1e5add3b70eb168ee1d0e04c005f20a82b433980bb9289d550c570ba745455bb |
Hashes for onnxoptimizer-0.3.5-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f805d7847fd1852ce9590a1ce6c53f5144823e945fc0b4fc066f495b52a8e2d2 |
|
MD5 | c80a44b2be59b411ce1c9a683cd002e6 |
|
BLAKE2b-256 | 383e91a6a152ead44d38683d3ef4eec5c4cccd42d172fb4cd2de9fde533506e2 |