Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
15db45b
AIE2P in required devices for lit
jgmelber May 7, 2025
d1fd8c9
And AIE2P for programming guide
jgmelber May 7, 2025
70a5960
Find components at runtime and fix pg/section-1 placed
jgmelber May 7, 2025
38da277
Find architectures at runtime
jgmelber May 7, 2025
6d4d691
Disable for npu-xrt to try on CI
jgmelber May 7, 2025
15c1d0b
[TEST] No Chess buildAndTestRyzenAI.yml
jgmelber May 8, 2025
4d51e58
Fix requires in packet_switch example
jgmelber May 8, 2025
ce176eb
[TEST] Try install aie runtime libs without chess
jgmelber May 8, 2025
3c2d621
Merge branch 'main' into peano-build
jgmelber May 8, 2025
729f640
[TEST] Split precompile and runtime libs
jgmelber May 8, 2025
5101d26
[TEST] split with subdirectories
jgmelber May 8, 2025
0df9881
Merge branch 'main' into peano-build
jgmelber Oct 31, 2025
c017ae7
Fix bootgen with main
jgmelber Oct 31, 2025
028e18a
Find AIE architectures in Peano
jgmelber Oct 31, 2025
f87c11e
Add dev requriements to no chess action
jgmelber Oct 31, 2025
831a410
Add more requriements to no chess action
jgmelber Oct 31, 2025
4bb8cd0
Add venv activate line back
jgmelber Oct 31, 2025
e90c38b
Find IRON_CACHE_HOME
jgmelber Oct 31, 2025
3ca4b39
Don't make xchesscc/xbridge the default if Vitis not found
jgmelber Nov 3, 2025
aab5ba5
Use found AIETools not Vitis
jgmelber Nov 3, 2025
5b44755
Merge branch 'main' into peano-build
jgmelber Nov 3, 2025
f486ed9
Fix vector scalar mul test
jgmelber Nov 3, 2025
53990a5
Merge branch 'main' into peano-build
jgmelber Nov 5, 2025
c7fdb59
Use find Peano cmake
jgmelber Nov 5, 2025
04900a7
Merge branch 'peano-build' of https://github.com/Xilinx/mlir-aie into…
jgmelber Nov 6, 2025
d958a52
Merge branch 'main' into peano-build
jgmelber Nov 6, 2025
fa50ee7
Merge branch 'main' into peano-build
jgmelber Jan 14, 2026
e3453fc
Bump cmake/modulesXilinx
jgmelber Jan 14, 2026
d19498d
Bump cmake/modulesXilinx
jgmelber Jan 14, 2026
ef1de54
Update lit cfg helpers for Halo
jgmelber Jan 15, 2026
a17a1a1
Merge branch 'main' into peano-build
jgmelber Jan 15, 2026
3d78c3a
Bump again
jgmelber Jan 16, 2026
f9ba183
Merge branch 'bump-cmakemodules' into peano-build
jgmelber Jan 16, 2026
3d17005
Merge branch 'peano-build' of https://github.com/Xilinx/mlir-aie into…
jgmelber Jan 16, 2026
4b390ec
Merge branch 'main' into peano-build
jgmelber Jan 16, 2026
f399485
Update new workflows
jgmelber Jan 16, 2026
3f37a29
Merge branch 'peano-build' of https://github.com/Xilinx/mlir-aie into…
jgmelber Jan 16, 2026
5d13337
Fix typo
jgmelber Jan 16, 2026
698ec3f
No memocy_allocator_ion in Win32 builds
jgmelber Jan 16, 2026
5eb9af0
More MSVC patches to runtime_lib
jgmelber Jan 16, 2026
f9e30ce
Revert attempts to build runtime_lib with Peano-only for Win32
jgmelber Jan 16, 2026
e44574a
Build more runtime lib features for Windows
jgmelber Jan 20, 2026
9214bbf
More CMake patches
jgmelber Jan 20, 2026
e66695f
Merge branch 'main' into peano-build
jgmelber Jan 20, 2026
096bf6c
Align no chess and chess RyzenAI workflows
jgmelber Jan 20, 2026
b6655f5
Require chess for vec_mul_event_trace test
jgmelber Jan 20, 2026
ba2fb81
Merge branch 'main' into peano-build
jgmelber Feb 4, 2026
80d1dda
Remove extras install from workflow
jgmelber Feb 4, 2026
efbeb1c
Disable peano vectorization flags
jgmelber Feb 4, 2026
61c4ac9
Try using clang rather than opt and llc
jgmelber Feb 4, 2026
cf09a7b
Enable Peano-only wheel builds without Vitis
jgmelber Feb 25, 2026
d592111
Fix Peano wheel download URL to use nightly release
jgmelber Feb 25, 2026
05702ef
Fix Peano wheel installation in peanoWheels.yml
jgmelber Feb 25, 2026
57eb348
Use manylinux_2_39 for Peano wheels on ubuntu-latest
jgmelber Feb 25, 2026
772c45f
Add REQUIRES: chess to tests that depend on xchesscc
jgmelber Feb 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 166 additions & 0 deletions .github/workflows/buildAndTestRyzenAI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,172 @@ jobs:
ninja check-reference-designs
ninja check-programming-guide
popd

- name: Cleanup NPU_CACHE_HOME
if: always()
run: |
rm -rf $NPU_CACHE_HOME
rm -rf $PIP_CACHE_DIR

build-tests-no-chess:
name: Run Tests on Ryzen AI No Chess
runs-on: ${{ matrix.runner_type }}
strategy:
fail-fast: false
matrix:
runner_type: [ amd7940hs, amdhx370 ]
env:
NPU_CACHE_HOME: ${{ github.workspace }}/iron-cache-${{ matrix.runner_type }}-${{ github.run_id }}
PIP_CACHE_DIR: ${{ github.workspace }}/.pip-cache-${{ matrix.runner_type }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"

# Launch an ssh session via a proxy server if there is a need
# for debug. This seems to live for 35 min max
# https://github.com/mxschmitt/action-tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
# To run this, launch it manually on the default branch and
# click on "launch_tmate_terminal_for_debug"
if: github.event_name == 'workflow_dispatch'
&& inputs.launch_tmate_terminal_for_debug

- name: Run commands
run: |
sudo prlimit -lunlimited --pid $$
pip cache purge
source /opt/xilinx/xrt/setup.sh
python -m venv aie-venv
source aie-venv/bin/activate
pip install --upgrade pip
pip install -r python/requirements.txt
pip install -r python/requirements_notebook.txt
pip install -r python/requirements_ml.txt
pip install -r python/requirements_dev.txt

# Install llvm-aie (Peano) which is needed for unittests requiring compiling NPU code
pip install -I llvm-aie -f https://github.com/Xilinx/llvm-aie/releases/expanded_assets/nightly
export PEANO_INSTALL_DIR="$(pip show llvm-aie | grep ^Location: | awk '{print $2}')/llvm-aie"

sed -i.bak 's/OUTPUT_TIMEOUT = 10/OUTPUT_TIMEOUT = 100/g' \
$(python -c 'import site; print(site.getsitepackages()[0])')/jupyter_client/runapp.py

VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
unzip -q mlir-*.whl
# I have no clue why but the system clock on GHA containers is like 12 hours ahead.
# That means wheels have file with time stamps in the future which makes ninja loop
# forever when configuring. Set the time to some arbitrary stamp in the past just to be safe.
find mlir -exec touch -a -m -t 201108231405.14 {} \;

mkdir build
pushd build

# -j here to reduce the number of parallel chess jobs.
# -j4 for 32GB RAM, -j12 for 64GB RAM
if [ x"${{ matrix.runner_type }}" == x"amdhx370" ]; then
LIT_OPTS="-j4 $LIT_OPTS"
else
LIT_OPTS="-j12 $LIT_OPTS"
fi

cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DPython3_EXECUTABLE=$(which python) \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DCMAKE_INSTALL_PREFIX=$PWD/../mlir_aie \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
$CMAKE_ARGS

# Create runner-specific cache directory
rm -rf $NPU_CACHE_HOME
mkdir -p $NPU_CACHE_HOME

# Set number of contexts to maintain in cache per process
export XRT_CONTEXT_CACHE_SIZE=3

ninja install
ninja check-aie
ninja check-aie-concurrency
popd

- name: Cleanup NPU_CACHE_HOME
if: always()
run: |
rm -rf $NPU_CACHE_HOME
rm -rf $PIP_CACHE_DIR

build-quick-setup-no-chess:
name: Run Examples on Ryzen AI No Chess
runs-on: ${{ matrix.runner_type }}
strategy:
fail-fast: false
matrix:
runner_type: [ amd7940hs, amdhx370 ]
env:
NPU_CACHE_HOME: ${{ github.workspace }}/iron-cache-${{ matrix.runner_type }}-${{ github.run_id }}
PIP_CACHE_DIR: ${{ github.workspace }}/.pip-cache-${{ matrix.runner_type }}-${{ github.run_id }}
steps:
- uses: actions/checkout@v4
with:
submodules: "true"

# Launch an ssh session via a proxy server if there is a need
# for debug. This seems to live for 35 min max
# https://github.com/mxschmitt/action-tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
# To run this, launch it manually on the default branch and
# click on "launch_tmate_terminal_for_debug"
if: github.event_name == 'workflow_dispatch'
&& inputs.launch_tmate_terminal_for_debug

- name: Run commands
run: |
sudo prlimit -lunlimited --pid $$
pip cache purge
source /opt/xilinx/xrt/setup.sh
source utils/quick_setup.sh
# quick_setup changes directory to programming_examples, so we need to return to mlir-aie
cd ..
pip install --upgrade pip
pip install -r python/requirements_dev.txt

./utils/build-mlir-aie-from-wheels.sh

# I have no clue why but the system clock on GHA containers is like 12 hours ahead.
# That means wheels have file with time stamps in the future which makes ninja loop
# forever when configuring. Set the time to some arbitrary stamp in the past just to be safe.
pushd my_install
find mlir -exec touch -a -m -t 201108231405.14 {} \;
popd

# build is created by the build-mlir-aie-from-wheels.sh script
pushd build

# -j here to reduce the number of parallel chess jobs.
# -j4 for 32GB RAM, -j12 for 64GB RAM
if [ x"${{ matrix.runner_type }}" == x"amdhx370" ]; then
LIT_OPTS="-j4 $LIT_OPTS"
else
LIT_OPTS="-j12 $LIT_OPTS"
fi

# Set number of contexts to maintain in cache per process
export XRT_CONTEXT_CACHE_SIZE=3

# Create runner-specific cache directory
rm -rf $NPU_CACHE_HOME
mkdir $NPU_CACHE_HOME

ninja install
ninja check-reference-designs
ninja check-programming-guide
popd

- name: Cleanup NPU_CACHE_HOME
if: always()
Expand Down
174 changes: 174 additions & 0 deletions .github/workflows/peanoWheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
name: Build Peano-only wheels

on:
pull_request:
workflow_dispatch:
inputs:
AIE_COMMIT:
description: 'AIE commit to build'
type: string
required: false
default: ''
push:
tags:
- 'v*.*.*'
merge_group:

schedule:
# At 05:00, one hour after the Vitis wheel build. (see https://crontab.guru)
- cron: '0 5 * * *'

defaults:
run:
shell: bash

concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit).
group: ci-build-peano-wheels-${{ github.event.number || github.sha }}
cancel-in-progress: true

env:
DEBIAN_FRONTEND: noninteractive

jobs:
build-repo:
name: Build and upload Peano-only mlir_aie wheels

runs-on: ubuntu-latest

permissions:
id-token: write
contents: write
packages: read

strategy:
fail-fast: false
matrix:
include:
- python_version: "3.10"
ENABLE_RTTI: ON

- python_version: "3.11"
ENABLE_RTTI: ON

- python_version: "3.12"
ENABLE_RTTI: ON

- python_version: "3.13"
ENABLE_RTTI: ON

steps:
- name: Free disk space
uses: descriptinc/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: false

- uses: actions/checkout@v4
with:
submodules: "true"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install -r python/requirements.txt
pip install -r python/requirements_dev.txt
pip install wheel auditwheel patchelf importlib_metadata

- name: Download MLIR wheel
run: |
NO_RTTI=""
NO_RTTI_UNDERSCORE=""
if [ x"${{ matrix.ENABLE_RTTI }}" == x"OFF" ]; then
NO_RTTI="-no-rtti"
NO_RTTI_UNDERSCORE="_no_rtti"
fi
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
pip -q download mlir$NO_RTTI==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
unzip -q mlir*.whl
# Fix timestamps to avoid ninja configuration issues
find mlir$NO_RTTI_UNDERSCORE -exec touch -a -m -t 201108231405.14 {} \;

- name: Install Peano (llvm-aie)
run: |
pip install -I llvm-aie \
-f https://github.com/Xilinx/llvm-aie/releases/expanded_assets/nightly

- name: Build mlir-aie wheel (Peano-only)
run: |
MLIR_VERSION=$(git rev-parse --short HEAD)
echo "Building mlir-aie version $MLIR_VERSION (Peano-only)"

NO_RTTI_UNDERSCORE=""
if [ x"${{ matrix.ENABLE_RTTI }}" == x"OFF" ]; then
NO_RTTI_UNDERSCORE="_no_rtti"
fi

export ENABLE_RTTI=${{ matrix.ENABLE_RTTI }}
export MLIR_INSTALL_ABS_PATH=$PWD/mlir$NO_RTTI_UNDERSCORE
export MLIR_AIE_SOURCE_DIR=$PWD
export WHEELHOUSE_DIR=$PWD/wheelhouse
export CMAKE_MODULE_PATH=$PWD/cmake/modulesXilinx

# Configure Peano-only build
export AIE_PEANO_ONLY_BUILD=1
export PEANO_INSTALL_DIR="$(pip show llvm-aie | grep ^Location: | awk '{print $2}')/llvm-aie"

if [ x"${{ inputs.AIE_COMMIT }}" == x"" ]; then
export AIE_PROJECT_COMMIT=$MLIR_VERSION
else
MLIR_VERSION="${{ inputs.AIE_COMMIT }}"
export AIE_PROJECT_COMMIT=${MLIR_VERSION:0:7}
fi
export DATETIME=$(date +"%Y%m%d%H")

pushd utils/mlir_aie_wheels

CIBW_ARCHS=x86_64 pip wheel . -v -w $WHEELHOUSE_DIR --no-build-isolation

popd

- name: Repair wheel
run: |
mkdir -p wheelhouse/repaired_wheel
auditwheel repair -w wheelhouse/repaired_wheel wheelhouse/mlir_aie*.whl \
--plat manylinux_2_39_x86_64 \
--exclude libcdo_driver.so \
--exclude libmlir_async_runtime.so \
--exclude libmlir_c_runner_utils.so \
--exclude libmlir_float16_utils.so \
--exclude libmlir_runner_utils.so \
--exclude libmlir_apfloat_wrappers.so

- name: Upload mlir_aie (Peano-only)
uses: actions/upload-artifact@v4
with:
path: wheelhouse/repaired_wheel/mlir_aie*whl
name: mlir_aie_peano_only-${{ matrix.python_version }}

- name: Release
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'schedule' ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
uses: ncipollo/release-action@v1.12.0
with:
artifacts: wheelhouse/repaired_wheel/mlir_aie*whl
token: "${{ secrets.GITHUB_TOKEN }}"
tag: ${{ github.event_name == 'push' && github.ref_name || 'latest-peano-wheels' }}
name: ${{ github.event_name == 'push' && github.ref_name || 'latest-peano-wheels' }}
allowUpdates: true
replacesArtifacts: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
makeLatest: false
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,26 @@ set(AIE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Vitis 2023.2 COMPONENTS ${AIE_VITIS_COMPONENTS})
configure_file(./utils/vitisVariables.config.in
${CMAKE_BINARY_DIR}/utils/vitisVariables.config @ONLY)

# Find Peano (llvm-aie) compiler for AIE kernel compilation
# Peano is an open-source alternative to xchesscc
find_package(Peano COMPONENTS AIE2 AIE2P)

# Option to build without Vitis (Peano only)
# When enabled, only Peano-supported architectures (AIE2, AIE2P) are available
option(AIE_PEANO_ONLY_BUILD "Build without Vitis (Peano only)" OFF)

if(AIE_PEANO_ONLY_BUILD)
if(NOT Peano_FOUND)
message(FATAL_ERROR "AIE_PEANO_ONLY_BUILD=ON requires Peano to be found. Set PEANO_INSTALL_DIR.")
endif()
# Force Peano as compiler/linker for Peano-only builds
set(AIE_COMPILER "PEANO" CACHE STRING "Backend compiler" FORCE)
set(AIE_LINKER "PEANO" CACHE STRING "Backend linker" FORCE)
message(STATUS "Peano-only build enabled: AIE_COMPILER=PEANO, AIE_LINKER=PEANO")
message(STATUS "Note: Only AIE2 and AIE2P targets are supported in Peano-only builds")
endif()

find_package(XRT)
find_package(hsa-runtime64)

Expand Down
3 changes: 3 additions & 0 deletions aie_runtime_lib/AIE/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@

add_aie_runtime_libs(AIE)

if(AIETools_AIE_FOUND)
compile_aie_runtime_libs(AIE)
endif()
4 changes: 4 additions & 0 deletions aie_runtime_lib/AIE2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
# (c) Copyright 2021 Xilinx Inc.

add_aie_runtime_libs(AIE2)

if(AIETools_AIE2_FOUND OR Peano_AIE2_FOUND)
compile_aie_runtime_libs(AIE2)
endif()
4 changes: 4 additions & 0 deletions aie_runtime_lib/AIE2P/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@
# (c) Copyright 2024 Xilinx Inc.

add_aie_runtime_libs(AIE2P)

if(AIETools_AIE2P_FOUND OR Peano_AIE2P_FOUND)
compile_aie_runtime_libs(AIE2P)
endif()
Loading
Loading