Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 1 | # IREE: Intermediate Representation Execution Environment |
Ben Vanik | 363fa07 | 2019-09-19 10:26:25 -0700 | [diff] [blame] | 2 | |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 3 | IREE (**I**ntermediate **R**epresentation **E**xecution **E**nvironment, |
| 4 | pronounced as "eerie") is an MLIR-based end-to-end compiler that lowers ML |
| 5 | models to a unified IR optimized for real-time mobile/edge inference against |
| 6 | heterogeneous hardware accelerators. IREE also provides flexible deployment |
| 7 | solutions for the compiled ML models. |
Ben Vanik | 363fa07 | 2019-09-19 10:26:25 -0700 | [diff] [blame] | 8 | |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 9 | #### Project Status |
Ben Vanik | 363fa07 | 2019-09-19 10:26:25 -0700 | [diff] [blame] | 10 | |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 11 | IREE is still in its early phase. We have settled down on the overarching |
| 12 | infrastructure and are actively improving various software components as well as |
phoenix-meadowlark | f81eef3 | 2020-06-10 11:02:21 -0700 | [diff] [blame] | 13 | project logistics. It is still quite far from ready for everyday use and is made |
| 14 | available without any support at the moment. With that said, we welcome any kind |
| 15 | of feedback on any [communication channels](#communication-channels)! |
Ben Vanik | 363fa07 | 2019-09-19 10:26:25 -0700 | [diff] [blame] | 16 | |
Stella Laurenzo | 1121c5f | 2020-03-18 15:01:20 -0700 | [diff] [blame] | 17 | ## Communication Channels |
Geoffrey Martin-Noble | ec3c4a6 | 2019-12-18 14:47:42 -0800 | [diff] [blame] | 18 | |
Scott Todd | fa4e373 | 2020-03-24 10:40:51 -0700 | [diff] [blame] | 19 | * [GitHub Issues](https://github.com/google/iree/issues): Preferred for |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 20 | specific technical issues and coordination on upcoming features. |
Scott Todd | fa4e373 | 2020-03-24 10:40:51 -0700 | [diff] [blame] | 21 | * [Google IREE Discord Server](https://discord.gg/26P4xW4): The core team and |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 22 | collaborators coordinate daily development here; good for low-latency |
| 23 | communication. |
Stella Laurenzo | 1121c5f | 2020-03-18 15:01:20 -0700 | [diff] [blame] | 24 | * [Google Groups Email List](https://groups.google.com/forum/#!forum/iree-discuss): |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 25 | Good for general and low-priority discussion. |
Stella Laurenzo | 1121c5f | 2020-03-18 15:01:20 -0700 | [diff] [blame] | 26 | |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 27 | #### Related Project Channels |
Stella Laurenzo | 1121c5f | 2020-03-18 15:01:20 -0700 | [diff] [blame] | 28 | |
| 29 | * [MLIR topic within LLVM Discourse](https://llvm.discourse.group/c/llvm-project/mlir/31): |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 30 | IREE is enabled by and heavily relies on [MLIR](https://mlir.llvm.org). IREE |
| 31 | sometimes is referred to in certain MLIR discussions. Useful if you are also |
| 32 | interested in MLIR evolution. |
| 33 | |
| 34 | ## Getting Started |
| 35 | |
| 36 | For development, IREE supports both Bazel and CMake on Windows and Linux. We are |
| 37 | working on enabling macOS support. For deployment, IREE aims to additionally |
| 38 | cover Android and iOS. |
| 39 | |
Phoenix Meadowlark | 84f52e1 | 2020-07-24 15:25:53 -0700 | [diff] [blame] | 40 | Please see the [Getting Started](https://google.github.io/iree/get-started) |
Copybara-Service | 9580b5f | 2020-07-23 12:56:17 -0700 | [diff] [blame] | 41 | pages on IREE's [documentation hub](https://google.github.io/iree) to configure, |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 42 | compile, and run IREE in your favorite development environment! |
| 43 | |
| 44 | ## Documentation and Talks |
| 45 | |
| 46 | IREE hosts all its documentation and project status dashboards on |
| 47 | [GitHub Pages](https://google.github.io/iree). We are still building up the |
| 48 | website; please feel free to |
| 49 | [create issues](https://github.com/google/iree/issues) for the documentation |
| 50 | you'd like to see! |
| 51 | |
| 52 | We also have some public talks that explain IREE's concepts and architecture: |
| 53 | |
| 54 | * 2020-03-18: Interactive HAL IR Walkthrough (Ben Vanik and core team) |
Stella Laurenzo | 054c757 | 2020-05-29 08:26:24 -0700 | [diff] [blame] | 55 | ([recording](https://drive.google.com/file/d/1_sWDgAPDfrGQZdxAapSA90AD1jVfhp-f/view?usp=sharing)) |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 56 | * 2020-01-31: End-to-end MLIR Workflow in IREE |
| 57 | ([recording](https://drive.google.com/open?id=1os9FaPodPI59uj7JJI3aXnTzkuttuVkR) |
| 58 | and |
| 59 | [slides](https://drive.google.com/open?id=1RCQ4ZPQFK9cVgu3IH1e5xbrBcqy7d_cEZ578j84OvYI)) |
| 60 | |
| 61 | ## Architecture and Goals |
| 62 | |
| 63 | IREE adopts a _holistic_ approach towards ML model compilation: the IR produced |
| 64 | contains both the _scheduling_ logic, required to communicate data dependencies |
| 65 | to low-level parallel pipelined hardware/API like Vulkan, and the _execution_ |
| 66 | logic, encoding dense computation on the hardware in the form of |
| 67 | hardware/API-specific binaries like SPIR-V. |
| 68 | |
| 69 | The architecture of IREE is best illustrated by the following picture: |
| 70 | |
Lei Zhang | c12c0cd | 2020-07-23 08:21:45 -0400 | [diff] [blame] | 71 |  |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 72 | |
| 73 | Being compilation-based means IREE does not have a traditional runtime that |
phoenix-meadowlark | f81eef3 | 2020-06-10 11:02:21 -0700 | [diff] [blame] | 74 | dispatches "ops" to their fat kernel implementations. What IREE provides is a |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 75 | toolbox for different deployment scenarios. It scales from running generated |
| 76 | code on a particular API (such as emitting C code calling external DSP kernels), |
| 77 | to a HAL (**H**ardware **A**bstraction **L**ayer) that allows the same generated |
| 78 | code to target multiple APIs (like Vulkan and Direct3D 12), to a full VM |
| 79 | allowing runtime model loading for flexible deployment options and heterogeneous |
| 80 | execution. |
| 81 | |
| 82 | IREE aims to |
| 83 | |
| 84 | * Support advanced models on mobile/edge devices. Dynamic shapes, dynamic flow |
| 85 | control, dynamic multi-model dispatch, streaming models, tree-based search |
| 86 | algorithms, and other are all good examples of exciting ML evolution. We are |
| 87 | trying to build IREE from the ground-up to enable these models and run them |
| 88 | efficiently on modern hardware, especially on mobile/edge devices. |
| 89 | * Demonstrate MLIR's ability to develop non-traditional ML compiler backends |
| 90 | and runtimes. MLIR enables IREE's holistic approach of focusing on the math |
| 91 | being performed and how that math is scheduled rather than graphs of "ops". |
| 92 | * Embrace standard-based ML via Vulkan. The graphics world is shifting towards |
phoenix-meadowlark | f81eef3 | 2020-06-10 11:02:21 -0700 | [diff] [blame] | 93 | favoring modern explicit APIs for performance and predictability and Vulkan |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 94 | is emerging as the "compatibility" layer. We would love to allow hardware |
| 95 | vendors to be able to make ML efficient on their hardware without the need |
| 96 | for bespoke runtimes and special access. We also would love to let |
| 97 | developers and users utilize all the hardware available on as many platforms |
| 98 | as possible. |
| 99 | |
| 100 | ## Roadmap and Milestones |
| 101 | |
| 102 | IREE is still at its early stage; we have lots of exciting future plans. Please |
Lei Zhang | c12c0cd | 2020-07-23 08:21:45 -0400 | [diff] [blame] | 103 | check out the [long-term design roadmap](./docs/design_roadmap.md) and |
| 104 | [short-term focus areas](./docs/milestones.md). |
Lei Zhang | c4cfa79 | 2020-04-08 14:55:41 -0700 | [diff] [blame] | 105 | |
| 106 | We use [GitHub Projects](https://github.com/google/iree/projects) to track |
| 107 | various IREE components and |
| 108 | [GitHub Milestones](https://github.com/google/iree/milestones) for major |
| 109 | features and quarterly plans. Please check out for updated information. |
Geoffrey Martin-Noble | ec3c4a6 | 2019-12-18 14:47:42 -0800 | [diff] [blame] | 110 | |
Geoffrey Martin-Noble | 65e115b | 2019-12-27 18:03:15 -0800 | [diff] [blame] | 111 | ## Build Status |
| 112 | |
Geoffrey Martin-Noble | 75f91f3 | 2020-08-21 09:52:10 -0700 | [diff] [blame] | 113 | CI System | Build System | Platform | Architecture | Component | Status |
| 114 | :-------: | :----------: | :------: | :-------------: | :------------------: | :----: |
Geoffrey Martin-Noble | dbb222f | 2020-09-18 09:23:40 -0700 | [diff] [blame] | 115 | Kokoro | Bazel | Linux | x86 | Core | [](https://storage.googleapis.com/iree-oss-build-badges/bazel/linux/x86-swiftshader/core/main_result.html) |
| 116 | Kokoro | Bazel | Linux | x86 | Bindings | [](https://storage.googleapis.com/iree-oss-build-badges/bazel/linux/x86-swiftshader/bindings/main_result.html) |
Geoffrey Martin-Noble | 75f91f3 | 2020-08-21 09:52:10 -0700 | [diff] [blame] | 117 | Kokoro | Bazel | Linux | x86-swiftshader | Integrations | [](https://storage.googleapis.com/iree-oss-build-badges/bazel/linux/x86-swiftshader/integrations/main_result.html) |
| 118 | Kokoro | Bazel | Linux | x86-turing | Integrations | [](https://storage.googleapis.com/iree-oss-build-badges/bazel/linux/x86-turing/integrations/main_result.html) |
Geoffrey Martin-Noble | 75f91f3 | 2020-08-21 09:52:10 -0700 | [diff] [blame] | 119 | Kokoro | CMake | Linux | x86-swiftshader | Core + Bindings | [](https://storage.googleapis.com/iree-oss-build-badges/cmake/linux/x86-swiftshader/main_result.html) |
| 120 | Kokoro | CMake | Linux | x86-turing | Core + Bindings | [](https://storage.googleapis.com/iree-oss-build-badges/cmake/linux/x86-turing/main_result.html) |
| 121 | Kokoro | CMake | Android | arm64-v8a | Runtime (build only) | [](https://storage.googleapis.com/iree-oss-build-badges/cmake/android/arm64-v8a/main_result.html) |
| 122 | BuildKite | CMake | Android | arm64-v8a | Runtime | [](https://buildkite.com/iree/iree-android-arm64-v8a/builds?branch=main) |
Geoffrey Martin-Noble | 65e115b | 2019-12-27 18:03:15 -0800 | [diff] [blame] | 123 | |
Ben Vanik | 363fa07 | 2019-09-19 10:26:25 -0700 | [diff] [blame] | 124 | ## License |
| 125 | |
| 126 | IREE is licensed under the terms of the Apache license. See [LICENSE](LICENSE) |
| 127 | for more information. |