This document provides an overview of IREE‘s systems, including entry points to get started exploring IREE’s capabilities.
For information on how to set up a development environment, see Getting Started on Windows and Getting Started on Linux.
IREE ingests MLIR in a high-level dialect like XLA/HLO, after which it can perform its own compiler passes to eventually translate the IR into an ‘IREE module’, which can be executed via IREE's runtime. IREE contains programs for running each step in that pipeline under various configurations (e.g. for tests, with a debugger attached, etc.).
The iree-opt
program invokes MlirOptMain to run some set of IREE's optimization passes on a provided .mlir input file. Test .mlir files that are checked in typically include a RUN
block at the top of the file that specifies which passes should be performed and if FileCheck
should be used to test the generated output.
For example, to run some passes on the reshape.mlir test file with Bazel on Linux, use this command:
$ bazel run //iree/tools:iree-opt -- \ -split-input-file \ -iree-index-computation \ -simplify-spirv-affine-exprs=false \ -convert-iree-to-spirv \ -verify-diagnostics \ $PWD/iree/compiler/Translation/SPIRV/XLAToSPIRV/test/reshape.mlir
The iree-translate
program translates from a .mlir input file into an IREE module.
For example, to translate gather.mlir
to an IREE module with Bazel on Linux, use this command:
$ bazel run //iree/tools:iree-translate -- \ -iree-mlir-to-vm-bytecode-module \ $PWD/test/e2e/xla/gather.mlir \ -o /tmp/module.fb
Custom translations may also be layered on top of iree-translate
- see iree/samples/custom_modules/dialect for a sample.
The iree-run-mlir
program takes a .mlir file as input, translates it to an IREE bytecode module, and executes the module.
For example, to execute the contents of a test .mlir file, use this command:
$ bazel run //iree/tools:iree-run-mlir -- $PWD/test/e2e/xla/reverse.mlir
The iree-dump-module
program prints the contents of an IREE module FlatBuffer file.
For example:
$ bazel run //iree/tools:iree-dump-module -- /tmp/module.fb