back to home

Xilinx / mlir-aie

An MLIR-based toolchain for AMD AI Engine-enabled devices.

593 stars
173 forks
165 issues
CMLIRC++

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing Xilinx/mlir-aie in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/Xilinx/mlir-aie)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

IRON API and MLIR-based AI Engine Toolchain _Note: Badge values are cached for up to 24 hours ( ) to reduce load on Shields.io and GitHub, so counts may lag behind real-time activity._ This project emphasizes fast, open-source toolchains for NPU devices including LLVM-based code generation. IRON contains a close-to-metal toolkit that empowers performance engineers to create fast and efficient designs for Ryzen™ AI NPUs powered by AI Engines. It provides Python APIs that enable developers to harness the unique architectural capabilities of AMD’s NPUs. However, this project is not intended to represent an end-to-end compilation flow for all application designs---it is designed to complement, not replace, mainstream NPU tooling for inference like the AMD Ryzen™ AI Software Platform. Targeting researchers and enthusiasts, IRON is designed to unlock the full potential of NPUs for a wide range of workloads, from machine learning to digital signal processing and beyond. This repository includes programming guides and examples demonstrating the APIs. Additionally, the Peano component extends the LLVM framework by adding support for the AI Engine processor as a target architecture, enabling integration with popular compiler frontends such as . Developers can leverage the AIE API header library to implement efficient vectorized AIE core code in C++ that can be compiled by Peano. This repository contains an MLIR-based toolchain for AI Engine-enabled devices, such as AMD Ryzen™ AI and Versal™. This repository can be used to generate low-level configurations for the AI Engine portion of these devices. AI Engines are organized as a spatial array of tiles, where each tile contains AI Engine cores and/or memories. The spatial array is connected by stream switches that can be configured to route data between AI Engine tiles scheduled by their programmable Data Movement Accelerators (DMAs). This repository contains MLIR representations, with multiple levels of abstraction, to target AI Engine devices. This enables compilers and developers to program AI Engine cores, as well as describe data movements and array connectivity. The IRON Python API for Ryzen™ AI NPUs is described in the following paper: > E. Hunhoff, J. Melber, K. Denolf, A. Bisca, S. Bayliss, S. Neuendorffer, J. Fifield, J. Lo, P. Vasireddy, P. James-Roxby, E. Keller. "Efficiency, Expressivity, and Extensibility in a Close-to-Metal NPU Programming Interface". In 33rd IEEE International Symposium On Field-Programmable Custom Computing Machines, May 2025. Getting Started for AMD Ryzen™ AI on Linux These instructions will guide you through everything required for building and executing a program on the Ryzen™ AI NPU, starting from a fresh bare-bones **Ubuntu 24.04** or **Ubuntu 24.10** install. Initial Setup > Be sure you have the latest BIOS on your laptop or mini-PC that enables the NPU. See here. If starting from you may need to update the Linux kernel to 6.11+ by installing the Hardware Enablement (HWE) stack: Prerequisites BIOS Settings: Turn off SecureBoot (Allows for unsigned drivers to be installed): Install the XDNA™ Driver and XRT Install from upstream packages (Ubuntu 24.04 with Linux 6.17+) > Ensure your system is running Linux kernel **6.17 or newer** before installing these packages. On Ubuntu 24.04 you can verify this with: > > > > If your kernel is older than 6.17, upgrade it using your distribution's kernel update mechanism or the kernel upgrade steps described in the Initial Setup section above. Install the XDNA driver and XRT from the AMD PPA: > The packaged XRT only supports Python 3.12 for > Make sure you are in the group to access the NPU: > > > > You may need to logout and log back in after modifying user groups. > If you are on a different Linux distribution or kernel not supported by the upstream packages, see Build from source below. Verify the NPU device is present: > At the bottom of the output you should see: > Install IRON and MLIR-AIE Prerequisites • Install the following packages needed for MLIR-AIE: • (Optional) Install opencv which is needed for vision programming examples: Install IRON for AMD Ryzen™ AI AIE Application Development • Clone the mlir-aie repository: • Setup a virtual environment: • Install IRON library by installing the wheels: For installing the wheels, there are 3 options. Note that for whichever path you take, it is important to sync the wheels version, the github repo commit, and the requirements versions. If you install from something other than the latest wheels, make sure you use the repo commit -- and installation instructions -- from that point in time. • **Latest:** For the latest wheels (not necessarily a release): • **Latest Release:** Alternatively, you can install the latest released version of . • **Any Release:** You can install a specific version of from the release wheels. To see available versions, check out the release page. • Install the Peano compiler (the wheels) and dependencies: • (Optional) Install Python packages required for development and testing: • Setup environment • (Optional) Install ML Python packages for ml programming examples: • (Optional) Install Jupyter Notebook Python packages: Build an IRON Design for AIEs in the AMD Ryzen™ AI NPU For your design of interest, for instance from programming_examples, 2 steps are needed: (i) build the AIE design and then (ii) build the host code. Build Device AIE Part • Goto the design of interest and run: • Build host code and execute the design: Learn more about NPU programming with IRON • Continue to the IRON AIE Application Programming Guide • Additional MLIR-AIE documentation is available on the website • AIE API header library documentation for single-core AIE programming in C++ is avaiable here • If you are a university researcher or student and interested in trying these tools on our Ryzen™ AI AUP Cloud systems, please contact the AMD University Program Optional: Install AIETools >…