Skip to main content

ONNX Optimizer

Reason this release was yanked:

Missing wheels

Project description

ONNX Optimizer

PyPI version PyPI license PRs Welcome

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.

Command-line API

Now you can use command-line api in terminal instead of python script.

python -m onnxoptimizer input_model.onnx output_model.onnx

Arguments list is following:

# python3 -m onnxoptimizer -h                                 
usage: python -m onnxoptimizer input_model.onnx output_model.onnx 

onnxoptimizer command-line api

optional arguments:
  -h, --help            show this help message and exit
  --print_all_passes    print all available passes
  --print_fuse_elimination_passes
                        print all fuse and elimination passes
  -p [PASSES ...], --passes [PASSES ...]
                        list of optimization passes name, if no set, fuse_and_elimination_passes will be used
  --fixed_point         fixed point

Roadmap

  • More built-in pass
  • Separate graph rewriting and constant folding (or a pure graph rewriting mode, see issue #9 for the details)

Relevant tools

Code of Conduct

ONNX Open Source Code of Conduct

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onnxoptimizer-0.4.1.tar.gz (12.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

onnxoptimizer-0.4.1-cp311-cp311-win_amd64.whl (487.6 kB view details)

Uploaded CPython 3.11Windows x86-64

onnxoptimizer-0.4.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_x86_64.whl (679.0 kB view details)

Uploaded CPython 3.11macOS 10.15+ x86-64

onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_universal2.whl (1.2 MB view details)

Uploaded CPython 3.11macOS 10.15+ universal2 (ARM64, x86-64)

onnxoptimizer-0.4.1-cp310-cp310-win_amd64.whl (487.5 kB view details)

Uploaded CPython 3.10Windows x86-64

onnxoptimizer-0.4.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_x86_64.whl (679.0 kB view details)

Uploaded CPython 3.10macOS 10.15+ x86-64

onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_universal2.whl (1.2 MB view details)

Uploaded CPython 3.10macOS 10.15+ universal2 (ARM64, x86-64)

File details

Details for the file onnxoptimizer-0.4.1.tar.gz.

File metadata

  • Download URL: onnxoptimizer-0.4.1.tar.gz
  • Upload date:
  • Size: 12.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for onnxoptimizer-0.4.1.tar.gz
Algorithm Hash digest
SHA256 c912f96847450e869b179a7b460b8aeda7fd3cdf7da4dda7f011bf7f923f3128
MD5 3ac9268d601237cd17798877f640ae5b
BLAKE2b-256 4c234139b10529702a5d9e9698481a963e49b7cb939169c10d6b3c2b096b882c

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1.tar.gz:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ca9294c06501754158ac80b03f25ecd22e700c411e1bee6b41f0bc8cae0ab5da
MD5 05dde5dbce6c6f9e31e3897bdb1a77ee
BLAKE2b-256 e7ee6947cec2ddfa3774c685d74d4470a9d27da3445f6ebf950e77e627ff5733

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp311-cp311-win_amd64.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ef67f382b35e3762f2896c47696d1b9744db82d3846ad6d2085bcc15cdb04ab
MD5 2fde32fdc756998c112adcee77286be3
BLAKE2b-256 82214483b0a589f9e4c5e710ec18d7da6f8d765eb4d5a1291212668678e345e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e8678939adfbe6e0b636319fad7a07b8b35738552ba6c2f1389d24db2bd2c283
MD5 f73516b5f467690acb2a195c5402a400
BLAKE2b-256 d739bbe4c1254bb76d83e3d44ac6d9ead59f514240f83a3eb859bc76185190bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_x86_64.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 9da4b66417cea4ffc33a37d171178de4889c24365acfd6ad1d6344cb80650753
MD5 e358dfa3cd16eafd43d442ad00e569db
BLAKE2b-256 659984ffaace3fb5345d8c8fe558f2d76102ece55a3062cde00a8351da26a777

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp311-cp311-macosx_10_15_universal2.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 200602951217dfab03e76bbcb0a01d4324353c5763aba224fbba08dc0bced303
MD5 17e21f5d647b6db3b93828bcd6269fe2
BLAKE2b-256 4d926d2b1713172b95cbee04db49a354042ef32d112b561ac3b368d3442e80e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp310-cp310-win_amd64.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e509bb96d21b9404eda79106fcad6148d525073bb02c8c3bed48d6cb40e8d6cf
MD5 1f2411c89ab24eb238b032b164910fab
BLAKE2b-256 e53baae7eb4af75ef12f41ac41635c5d92a0ef17cfdc5f963c25e5bc1d3f986a

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 badb0aa08e56d42bb559bf4fae0b81d4619e241f8ccfac251530bd0579aff567
MD5 e28d3785dcb28d67f3afb12a571e41cd
BLAKE2b-256 a028246ff010c670c8d0424cdb28defeeba5a3dce245d8ea36ca976281c1a1de

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_x86_64.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_universal2.whl.

File metadata

File hashes

Hashes for onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_universal2.whl
Algorithm Hash digest
SHA256 d7e2e8fcf57b91014751370c06e770f97149e3f51ee2bd9c14ac72841a1451a2
MD5 f2a8c7ee52fe7d968a3a058124cc03bf
BLAKE2b-256 9a75b18546dfbc2159132bc19892dd9d5ac8518dde989085622ed106f6259177

See more details on using hashes here.

Provenance

The following attestation bundles were made for onnxoptimizer-0.4.1-cp310-cp310-macosx_10_15_universal2.whl:

Publisher: build-and-test.yml on onnx/optimizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page