| commit | d43294521aa2af71910d2a8a8fef56a7e5d36c91 | [log] [tgz] |
|---|---|---|
| author | Scott Todd <scotttodd@google.com> | Wed Aug 19 12:23:32 2020 -0700 |
| committer | GitHub <noreply@github.com> | Wed Aug 19 12:23:32 2020 -0700 |
| tree | 7b56ac24c2ebe4061fff2945471fe3ae0b19ff4d | |
| parent | 403635de58217376fc43874b2e2f29f110f582b0 [diff] |
Move hal.executable.entry_point ops into hal.executable.target. (#2893) The HAL transformation pass pipeline "materializes interfaces" then "translates executables" for each configured target ([source](https://github.com/google/iree/blob/d7f61a1510aeee066e34ebfadf13f7651aea4de4/iree/compiler/Dialect/HAL/Transforms/Passes.cpp#L46-L58)). As part of its executable translation, the VulkanSPIRV target "splits" dispatch functions using [SplitDispatchFunctionPass](https://github.com/google/iree/blob/d7f61a1510aeee066e34ebfadf13f7651aea4de4/iree/compiler/Conversion/LinalgToSPIRV/SplitDispatchFunctionPass.cpp), creating a schedule of `spv.EntryPoint` ops to dispatch in sequence when `recordDispatch()` is called ([source](https://github.com/google/iree/blob/d7f61a1510aeee066e34ebfadf13f7651aea4de4/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/VulkanSPIRVTarget.cpp#L321-L370)). For https://github.com/google/iree/issues/1890, we want to change dispatch ops from using loose ordinals for entry points: ``` hal.command_buffer.dispatch %arg0, %arg1, entry_point = 0, workgroup_xyz = ... ``` to using nested references: ``` hal.command_buffer.dispatch %arg0, %arg1, entry_point = @MyExecutable::EntryPoint, workgroup_xyz = ... ``` To use references in that format, the VulkanSPIRV target should create new `hal.executable.entry_point` ops which can be referenced whenever it splits dispatch functions. However, entry points are currently placed on `hal.executable` ops, which can contain multiple `hal.executable.target` ops (e.g. several for "vulkan" and one for "vmla"). Thus, this PR moves entry points down into `hal.executable.target` ops so that each target can have more control over how it sets up its entry points. --- I explored a few different ways to structure the passes involved as part of this work, each with some tradeoffs. Happy to make changes now that I have a better handle on how this all fits together.
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler that lowers ML models to a unified IR optimized for real-time mobile/edge inference against heterogeneous hardware accelerators. IREE also provides flexible deployment solutions for the compiled ML models.
IREE is still in its early phase. We have settled down on the overarching infrastructure and are actively improving various software components as well as project logistics. It is still quite far from ready for everyday use and is made available without any support at the moment. With that said, we welcome any kind of feedback on any communication channels!
For development, IREE supports both Bazel and CMake on Windows and Linux. We are working on enabling macOS support. For deployment, IREE aims to additionally cover Android and iOS.
Please see the Getting Started pages on IREE's documentation hub to configure, compile, and run IREE in your favorite development environment!
IREE hosts all its documentation and project status dashboards on GitHub Pages. We are still building up the website; please feel free to create issues for the documentation you'd like to see!
We also have some public talks that explain IREE's concepts and architecture:
IREE adopts a holistic approach towards ML model compilation: the IR produced contains both the scheduling logic, required to communicate data dependencies to low-level parallel pipelined hardware/API like Vulkan, and the execution logic, encoding dense computation on the hardware in the form of hardware/API-specific binaries like SPIR-V.
The architecture of IREE is best illustrated by the following picture:
Being compilation-based means IREE does not have a traditional runtime that dispatches “ops” to their fat kernel implementations. What IREE provides is a toolbox for different deployment scenarios. It scales from running generated code on a particular API (such as emitting C code calling external DSP kernels), to a HAL (Hardware Abstraction Layer) that allows the same generated code to target multiple APIs (like Vulkan and Direct3D 12), to a full VM allowing runtime model loading for flexible deployment options and heterogeneous execution.
IREE aims to
IREE is still at its early stage; we have lots of exciting future plans. Please check out the long-term design roadmap and short-term focus areas.
We use GitHub Projects to track various IREE components and GitHub Milestones for major features and quarterly plans. Please check out for updated information.
| CI System | Platform | Build System | Component | Status |
|---|---|---|---|---|
| Kokoro | Linux | Bazel | Core | |
| Kokoro | Linux | Bazel | Bindings | |
| Kokoro | Linux | Bazel | Integrations | |
| Kokoro | Linux | CMake | Core + Bindings | |
| Kokoro | Android | CMake | Runtime (build only) |
IREE is licensed under the terms of the Apache license. See LICENSE for more information.