{"data":{"slug":"onnx-onnx-mlir","name":"onnx-mlir","tagline":"ONNX model compiler technology lowering ONNX graphs to MLIR and LLVM bytecodes","github_url":"https://github.com/onnx/onnx-mlir","owner":"onnx","repo":"onnx-mlir","owner_avatar_url":"https://avatars.githubusercontent.com/u/31675368?v=4","primary_language":"C++","stars":1039,"forks":447,"topics":[],"archived":false,"github_pushed_at":"2026-07-31T03:15:39+00:00","maintenance_label":"Very active","url":"https://www.graphcanon.com/tools/onnx-onnx-mlir","markdown_url":"https://www.graphcanon.com/tools/onnx-onnx-mlir.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/onnx-onnx-mlir","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=onnx-onnx-mlir","description":"Representation and Reference Lowering of ONNX Models in MLIR Compiler Infrastructure","homepage_url":null,"license":"Apache-2.0","open_issues":352,"watchers":35,"ai_summary":"Provides ONNX Dialect integration, compilers for transforming ONNX models into code using the underlying LLVM/MLIR infrastructure, with support for C++, Java runtime environments, cross-platform compatibility","readme_excerpt":"<p align=\"center\"><img width=\"50%\" src=\"docs/logo/onnx-mlir-1280x640.png\" /></p>\n\n# ONNX-MLIR\n\nThis project (https://onnx.ai/onnx-mlir/) provides compiler technology to transform a valid Open Neural Network Exchange (ONNX) graph into code that implements the graph with minimum runtime support.\nIt implements the [ONNX standard](https://github.com/onnx/onnx#readme) and is based on the underlying [LLVM/MLIR](https://mlir.llvm.org) compiler technology.\n\n| System        | Build Status | Model Zoo Status |\n|---------------|--------------|------------------|\n| s390x-Linux   |  |  |\n| amd64-Linux   |  |  |\n| amd64-Windows |  | |\n| amd64-macOS   |  |\n| |  |\n\nThis project contributes:\n* an ONNX Dialect that can be integrated in other projects,\n* a compiler interfaces that lower ONNX graphs into MLIR files/LLVM bytecodes/C & Java libraries,\n* an `onnx-mlir` driver to perform these lowering,\n* and a python/C/C++/Java runtime environment.\n\nCurrent levels of support for the code generation of ONNX operations are listed here for\n[a generic CPU](docs/SupportedONNXOps-cpu.md) and\n[IBM's Telum integrated AI accelerator](docs/SupportedONNXOps-NNPA.md).\n\n## Interacting with the community.\n\nFor ongoing discussions, we use an [`#onnx-mlir-discussion`](https://lfaifoundation.slack.com/archives/C01J4NAL4A2) slack channel established under the Linux Foundation AI and Data Workspace.\nJoin this workspace using this [link](https://join.slack.com/t/lfaifoundation/shared_invite/zt-o65errpw-gMTbwNr7FnNbVXNVFkmyNA).\n\nWe use GitHub Issues for request for comments, questions, or bug reports.\nSecurity-related issues are reported using the channels listed in the [SECURITY](SECURITY.md) page.\n\nWe hold informal weekly meetings on Tuesdays where we discuss  current issues and progress. Meeting agenda, notes, and links (to participate) are found [here](https://github.com/onnx/onnx-mlir/wiki/Informal-meeting-agenda-and-notes). Please email alexe@us.ibm.com to request a 15-30 min time slot to discuss a specific topic of interest.\n\n## Setting up ONNX-MLIR using Prebuilt Containers\n\nThe preferred approach to using and developing ONNX-MLIR is to use Docker Images and Containers, as getting the proper code dependences may be tricky on some systems. Our instructions on using ONNX-MLIR with Dockers are [here](docs/Docker.md).\n\nIf you intend to develop code, you should look at our [workflow](docs/Workflow.md) document which help you setup your Docker environment in a way that let you contribute code easily.\n\n## Setting up ONNX-MLIR directly\n\nONNX-MLIR runs natively on Linux, OSX, and Windows.\nDetailed instructions are provided below.\n\n### Prerequisites\n\n\n```\npython >= 3.11\nclang >= 18.1.3\nprotobuf >= 33.5\ncmake >= 3.26.0\nmake >= 4.3 or ninja >= 1.10.2\njava >= 21 (optional)\n```\n\nAll the `PyPi` package dependencies and their appropriate versions are captured in [requirements.txt](requirements.txt).\n\nLook [here](docs/Prerequisite.md) for help to set up the prerequisite software.\n\nAt any point in time, ONNX-MLIR depends on a specific commit of the LLVM project that has been shown to work with the project.\nPeriodically the maintainers need to move to a more recent LLVM level.\nAmong other things, this requires to update the LLVM commit string in [clone-mlir.sh](utils/clone-mlir.sh).\nWhen updating ONNX-MLIR, it is good practice to check that the commit string of the MLIR/LLVM is the same as the one listed in that file. See instructions [here](docs/BuildONNX.md) when third-party ONNX also need to be updated.\n\n### Build\n\nDirections to install MLIR and ONNX-MLIR are dependent on your OS.\n* [Linux or OSX](docs/BuildOnLinuxOSX.md).\n* [Windows](docs/BuildOnWindows.md).\n\nAfter installation, an `onnx-mlir` executable should appear in the `build/Debug/bin` or `build/Release/bin` directory.\n\nIf you have difficulties building, rebuilding, or testing `onnx-mlir`, check this [page](docs/TestingHighLevel.md) for helpful hints.\n\n\n## Using ONNX-MLIR\n\nThe usage of `onnx-mlir` is as such:\n\n```\nOVERV","github_created_at":"2020-02-18T15:43:43+00:00","created_at":"2026-07-11T23:31:53.149118+00:00","updated_at":"2026-08-04T00:01:46.238657+00:00","categories":[{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"},{"slug":"model-training","name":"Model Training","url":"https://www.graphcanon.com/categories/model-training","markdown_url":"https://www.graphcanon.com/categories/model-training.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/model-training"}],"tags":[{"slug":"compiler","name":"compiler"},{"slug":"llvm","name":"llvm"},{"slug":"mlir","name":"mlir"},{"slug":"onnx","name":"onnx"},{"slug":"runtime-environments","name":"runtime environments"}],"trust":{"provenance":{"is_fork":false,"github_id":241400276,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-04T00:01:45.496Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":3,"days_since_push":3,"last_release_at":"2026-07-28T04:11:36Z"},"security_summary":{"status":"findings","scanner":"osv@v1","low_count":3,"high_count":0,"last_scan_at":"2026-07-11T23:31:57.597Z","medium_count":0,"scan_profile":"deps","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-04T00:01:45.955Z"},"languages":{"value":["c++","python"],"source":"github.language+pyproject.toml","observed_at":"2026-08-04T00:01:45.955Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-08-04T00:01:45.955Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["For users needing compile-time optimization of ONNX models to improve inference performance in a variety of language runtimes such as C++, Java, and Python","If the target system is Linux, macOS, or Windows and benefits from an LLVM-based backend for deployment flexibility"],"when_not_to_use":["When quick setup and environment management are desired without using prebuilt containers, as setting up prerequisites manually may be challenging","For teams primarily focused on real-time inference serving with dedicated AI hardware that requires specialized frameworks not covered by ONNX-MLIR's support matrix"],"source":"enrich:decision_facts","observed_at":"2026-07-16T20:36:25.584Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"ONNX-MLIR is optimised for compiling ONNX models to MLIR and LLVM bytecodes, offering cross-platform support and multiple runtime environments."},{"label":"License detail","value":"Available under the Apache License Version 2.0 (Apache-2.0). Permissions granted for reproduction, distribution, etc., as per license terms."}]}}