{"id":13436602,"url":"https://github.com/onnx/optimizer","last_synced_at":"2025-12-30T03:34:51.742Z","repository":{"id":36964059,"uuid":"281225317","full_name":"onnx/optimizer","owner":"onnx","description":"ONNX Optimizer","archived":false,"fork":false,"pushed_at":"2025-05-01T14:59:28.000Z","size":9224,"stargazers_count":700,"open_issues_count":62,"forks_count":94,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-05T05:03:11.664Z","etag":null,"topics":["onnx","optimizations"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onnx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-07-20T21:03:52.000Z","updated_at":"2025-05-02T02:58:56.000Z","dependencies_parsed_at":"2023-01-17T09:03:44.248Z","dependency_job_id":"55b4b931-7668-49b8-856b-bcacdc08603d","html_url":"https://github.com/onnx/optimizer","commit_stats":{"total_commits":137,"total_committers":11,"mean_commits":"12.454545454545455","dds":0.291970802919708,"last_synced_commit":"92b048e4308f8e1c67c675d7dfed69e9073fb42b"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Foptimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Foptimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Foptimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onnx%2Foptimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onnx","download_url":"https://codeload.github.com/onnx/optimizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253660847,"owners_count":21943823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["onnx","optimizations"],"created_at":"2024-07-31T03:00:50.644Z","updated_at":"2025-12-30T03:34:51.697Z","avatar_url":"https://github.com/onnx.png","language":"C++","readme":"\u003c!--- SPDX-License-Identifier: Apache-2.0 --\u003e\n\n# ONNX Optimizer\n\n[![PyPI version](https://img.shields.io/pypi/v/onnxoptimizer.svg)](https://pypi.python.org/pypi/onnxoptimizer/)\n[![PyPI license](https://img.shields.io/pypi/l/onnxoptimizer.svg)](https://pypi.python.org/pypi/onnxoptimizer/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/onnx/optimizer/pulls)\n\n## Introduction\n\nONNX provides a C++ library for performing arbitrary optimizations on ONNX models, as well as a growing list of prepackaged optimization passes.\n\nThe 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.\n\nYou may be interested in invoking the provided passes, or in implementing new ones (or both).\n\n## Installation\n\nYou can install onnxoptimizer from PyPI:\n\n```bash\npip3 install onnxoptimizer\n```\n\nNote that you may need to upgrade your pip first if you have trouble:\n\n```bash\npip3 install -U pip\n```\n\nIf you want to build from source:\n\n```bash\ngit clone --recursive https://github.com/onnx/optimizer onnxoptimizer\ncd onnxoptimizer\npip3 install -e .\n```\n\nNote that you need to install protobuf before building from source.\n\n\n## Command-line API\nNow you can use command-line api in terminal instead of  python script.\n\n```\npython -m onnxoptimizer input_model.onnx output_model.onnx\n```\n\nArguments list is following:\n```\n# python3 -m onnxoptimizer -h                                 \nusage: python -m onnxoptimizer input_model.onnx output_model.onnx \n\nonnxoptimizer command-line api\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --print_all_passes    print all available passes\n  --print_fuse_elimination_passes\n                        print all fuse and elimination passes\n  -p [PASSES ...], --passes [PASSES ...]\n                        list of optimization passes name, if no set, fuse_and_elimination_passes will be used\n  --fixed_point         fixed point\n```\n## Roadmap\n\n* More built-in pass\n* Separate graph rewriting and constant folding (or a pure graph rewriting mode, see [issue #9](https://github.com/onnx/optimizer/issues/9) for the details)\n\n## Relevant tools\n\n* [onnx-simplifier](https://github.com/daquexian/onnx-simplifier): A handy and popular tool based on onnxoptimizer\n\n## Code of Conduct\n\n[ONNX Open Source Code of Conduct](https://onnx.ai/codeofconduct.html)\n","funding_links":[],"categories":["C++","Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonnx%2Foptimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonnx%2Foptimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonnx%2Foptimizer/lists"}