Skip to content

Getting Started

erwei-xilinx edited this page Dec 15, 2023 · 7 revisions

Contents

  1. Build IREE with IREE-AMD-AIE patch
  2. Build MLIR-AIE

Build IREE with IREE-AMD-AIE patch

Use Git to clone the IREE repository and initialize its submodules:

git clone https://github.com/openxla/iree.git
cd iree
git submodule update --init
cd ..

Also clone the IREE-AMD-AIE patch and initialize its submodules:

git clone https://github.com/nod-ai/iree-amd-aie.git
cd iree-amd-aie
git submodule update --init
cd ..

A recommended CMake workflow is:

cd iree
cmake -G Ninja -B ../iree-build/ -S . \
   -DCMAKE_C_COMPILER=clang \
   -DCMAKE_CXX_COMPILER=clang++ \
   -DCMAKE_BUILD_TYPE=Debug \
   -DIREE_HAL_DRIVER_METAL=OFF \
   -DIREE_TARGET_BACKEND_ROCM=OFF \
   -DIREE_CMAKE_PLUGIN_PATHS="../iree-amd-aie" \
   -DCMAKE_C_COMPILER_LAUNCHER=ccache \
   -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
   -DCMAKE_INSTALL_PREFIX="../iree-install" \
   -DIREE_ENABLE_LLD=ON

Build MLIR-AIE

clone the MLIR-AIE repository and initialize its submodules:

git clone https://github.com/Xilinx/mlir-aie.git
cd mlir-aie
git submodule update --init

Load the Vitis 2023.2 installation into your environment PATH:

export PATH=$PATH:<Vitis_install_path>/Vitis/2023.2/aietools/bin:<Vitis_install_path>/Vitis/2023.2/bin

The cmake and python packages prerequisites can be satisfied by sourcing the utils/setup_python_packages.sh script under a virtual environment created using the virtualenv tool.

The standalone installation of MLIR-AIE requires its own compiled LLVM:

./utils/clone-llvm.sh
./utils/build--llvm-local.sh

Build the MLIR-AIE tool using the recommended CMake workflow:

./utils/build-mlir-aie.sh <llvm dir>/<build dir>
Clone this wiki locally