Skip to content

Commit 77ffd81

Browse files
committed
Merge remote-tracking branch 'origin/main' into clangir
Resolve conflicts on: - README.md - python/compiler/aiecc/main.py
2 parents 822cb03 + 3ed58a6 commit 77ffd81

File tree

312 files changed

+9942
-3862
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

312 files changed

+9942
-3862
lines changed

.github/workflows/buildAndTestMulti.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@ jobs:
4545
ENABLE_RTTI: [ ON, OFF ]
4646

4747
include:
48-
- OS: ubuntu-20.04
49-
COMPILER: gcc-11
50-
ENABLE_ASSERTIONS: ON
51-
ENABLE_RTTI: OFF
52-
- OS: ubuntu-20.04
53-
COMPILER: gcc-11
54-
ENABLE_ASSERTIONS: OFF
55-
ENABLE_RTTI: OFF
56-
- OS: ubuntu-20.04
57-
COMPILER: gcc-11
58-
ENABLE_ASSERTIONS: ON
59-
ENABLE_RTTI: ON
60-
- OS: ubuntu-20.04
61-
COMPILER: gcc-11
62-
ENABLE_ASSERTIONS: OFF
63-
ENABLE_RTTI: ON
6448
- OS: windows-2019
6549
COMPILER: msvc
6650
ENABLE_ASSERTIONS: ON
@@ -97,7 +81,7 @@ jobs:
9781
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
9882
9983
- name: Setup Cpp
100-
uses: aminya/setup-cpp@v1
84+
uses: aminya/setup-cpp@1fd813945e55021261b381c59275db442da4082f
10185
with:
10286
compiler: ${{ matrix.COMPILER }}
10387
vcvarsall: ${{ contains(matrix.OS, 'windows') }}

.github/workflows/buildAndTestPythons.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
# Run the tests on the Cartesian product of the following
3535
matrix:
3636
build_type: [ Assert, Release ]
37-
ubuntu_version: [ 20.04, 22.04, 24.04 ]
37+
ubuntu_version: [ 22.04, 24.04 ]
3838
python_version: [ "3.10", "3.11", "3.12" ]
3939

4040
steps:
@@ -59,26 +59,6 @@ jobs:
5959
run: |
6060
sudo apt-get install -y ninja-build clang lld
6161
62-
- name: Upgrade gcc
63-
if: matrix.ubuntu_version == '20.04'
64-
run: |
65-
sudo apt-get install -y ninja-build clang lld
66-
67-
sudo apt install build-essential manpages-dev software-properties-common
68-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
69-
GCC_VERSION=11
70-
sudo apt update && sudo apt install gcc-$GCC_VERSION g++-$GCC_VERSION
71-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 \
72-
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
73-
--slave /usr/bin/gcov gcov /usr/bin/gcov-9 \
74-
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-9 \
75-
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-9
76-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-$GCC_VERSION 110 \
77-
--slave /usr/bin/g++ g++ /usr/bin/g++-$GCC_VERSION \
78-
--slave /usr/bin/gcov gcov /usr/bin/gcov-$GCC_VERSION \
79-
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-$GCC_VERSION \
80-
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-$GCC_VERSION
81-
8262
- name: Get MLIR
8363
id: mlir-wheels
8464
run: |

.github/workflows/buildAndTestRyzenAI.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,14 @@ jobs:
155155
# quick_setup changes directory to programming_examples, so we need to return to mlir-aie
156156
cd ..
157157
158+
./utils/build-mlir-aie-from-wheels.sh
159+
158160
# I have no clue why but the system clock on GHA containers is like 12 hours ahead.
159161
# That means wheels have file with time stamps in the future which makes ninja loop
160162
# forever when configuring. Set the time to some arbitrary stamp in the past just to be safe.
161-
find my_install/mlir -exec touch -a -m -t 201108231405.14 {} \;
162-
163-
./utils/build-mlir-aie-from-wheels.sh ./my_install/mlir build install ./my_install/llvm-aie
163+
pushd my_install
164+
find mlir -exec touch -a -m -t 201108231405.14 {} \;
165+
popd
164166
165167
# build is created by the build-mlir-aie-from-wheels.sh script
166168
pushd build

.github/workflows/buildRyzenWheels.yml

Lines changed: 11 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ jobs:
3636
contents: write
3737
packages: read
3838

39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
python_version: [
43+
"3.10", "3.12", "3.13",
44+
]
45+
3946
steps:
4047
- name: Free disk space
4148
uses: descriptinc/free-disk-space@main
@@ -69,7 +76,7 @@ jobs:
6976
MLIR_VERSION=$(git rev-parse --short HEAD)
7077
echo "Building mlir-aie version $MLIR_VERSION"
7178
72-
python -m venv ${{ github.workspace }}/aie-venv
79+
python${{ matrix.python_version }} -m venv ${{ github.workspace }}/aie-venv
7380
source ${{ github.workspace }}/aie-venv/bin/activate
7481
7582
echo "Installing vitis_aie_essentials ..."
@@ -108,14 +115,14 @@ jobs:
108115
popd
109116
110117
auditwheel repair -w $WHEELHOUSE_DIR/repaired_wheel $WHEELHOUSE_DIR/mlir_aie-*.whl --plat manylinux_2_35_x86_64 --exclude libcdo_driver.so --exclude libmlir_float16_utils.so
111-
WHL_FN=$(ls $WHEELHOUSE_DIR/repaired_wheel/mlir_aie*whl)
112-
mv "$WHL_FN" "`echo $WHL_FN | sed "s/cp310-cp310/py3-none/"`"
118+
# WHL_FN=$(ls $WHEELHOUSE_DIR/repaired_wheel/mlir_aie*whl)
119+
# mv "$WHL_FN" "`echo $WHL_FN | sed "s/cp310-cp310/py3-none/"`"
113120
114121
- name: Upload mlir_aie
115122
uses: actions/upload-artifact@v4
116123
with:
117124
path: wheelhouse/repaired_wheel/mlir_aie*whl
118-
name: mlir_aie
125+
name: mlir_aie-${{ matrix.python_version }}
119126

120127
- name: Release current commit
121128
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
@@ -129,119 +136,3 @@ jobs:
129136
allowUpdates: true
130137
replacesArtifacts: true
131138
makeLatest: true
132-
133-
build-wheel:
134-
name: Build wheel
135-
runs-on: ubuntu-latest
136-
needs: build-repo
137-
138-
permissions:
139-
id-token: write
140-
contents: write
141-
packages: read
142-
143-
strategy:
144-
fail-fast: false
145-
matrix:
146-
python_version: [
147-
"3.10", "3.12",
148-
]
149-
150-
steps:
151-
- name: Get the project repository
152-
uses: actions/checkout@v4
153-
with:
154-
fetch-depth: 2
155-
submodules: "true"
156-
157-
- uses: actions/download-artifact@v4
158-
with:
159-
# unpacks default artifact into dist/
160-
# if `name: artifact` is omitted, the action will create extra parent dir
161-
name: mlir_aie
162-
path: .
163-
164-
- uses: uraimo/[email protected]
165-
name: Build mlir-aie python bindings
166-
id: runcmd
167-
with:
168-
distro: none
169-
arch: none
170-
base_image: ghcr.io/xilinx/mlir-aie/ubuntu22-ryzenai-1.3.0ea:1.1
171-
githubToken: ${{ github.token }}
172-
dockerRunArgs: |
173-
--mac-address 02:42:ac:11:00:02
174-
env: |
175-
VITIS: ${{ env.VITIS }}
176-
XILINXD_LICENSE_FILE: ${{ env.XILINXD_LICENSE_FILE }}
177-
run: |
178-
git config --global --add safe.directory $PWD
179-
MLIR_VERSION=$(git rev-parse --short HEAD)
180-
echo "Building mlir-aie version $MLIR_VERSION ..."
181-
182-
# faster to do this twice instead of upload the directory with ~4000 files in it...
183-
VERSION=$(utils/clone-llvm.sh --get-wheel-version)
184-
pip -q download mlir==$VERSION \
185-
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
186-
unzip -q mlir-*.whl
187-
# I have no clue why but the system clock on GHA containers is like 12 hours ahead.
188-
# That means wheels have file with time stamps in the future which makes ninja loop
189-
# forever when configuring. Set the time to some arbitrary stamp in the past just to be safe.
190-
find mlir -exec touch -a -m -t 201108231405.14 {} \;
191-
192-
unzip -q mlir_aie-*.whl
193-
find mlir_aie -exec touch -a -m -t 201108231405.14 {} \;
194-
195-
python${{ matrix.python_version }} -m venv aie-venv
196-
source aie-venv/bin/activate
197-
198-
pip install -r python/requirements.txt
199-
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
200-
source aie-venv/bin/activate
201-
202-
export MLIR_INSTALL_ABS_PATH=$PWD/mlir
203-
export MLIR_AIE_INSTALL_ABS_PATH=$PWD/mlir_aie
204-
export WHEELHOUSE_DIR=$PWD/wheelhouse
205-
export CMAKE_MODULE_PATH=$PWD/cmake/modulesXilinx
206-
207-
export PATH=$VITIS/bin:$VITIS/aietools/bin:$PATH
208-
export XRT_ROOT=/opt/xilinx/xrt
209-
export AIE_PROJECT_COMMIT=$MLIR_VERSION
210-
export DATETIME=$(date +"%Y%m%d%H")
211-
212-
cp python/requirements.txt utils/mlir_aie_wheels/python_bindings
213-
214-
pushd utils/mlir_aie_wheels/python_bindings
215-
216-
pip install wheel auditwheel patchelf
217-
CIBW_ARCHS=x86_64 pip wheel . -v -w $WHEELHOUSE_DIR --no-build-isolation
218-
DEBUG=1 CIBW_ARCHS=x86_64 pip wheel . -v -w $WHEELHOUSE_DIR --no-build-isolation
219-
220-
popd
221-
222-
auditwheel repair -w $WHEELHOUSE_DIR/repaired_wheel $WHEELHOUSE_DIR/aie_python_bindings*whl --plat manylinux_2_35_x86_64
223-
224-
- uses: geekyeggo/delete-artifact@v5
225-
if: github.event_name == 'pull_request'
226-
with:
227-
name: mlir_aie
228-
229-
- name: Upload wheels
230-
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
231-
uses: actions/upload-artifact@v4
232-
with:
233-
path: wheelhouse/repaired_wheel/aie_python_bindings*.whl
234-
name: ryzen_ai_wheel-python-${{ matrix.python_version }}
235-
236-
- name: Release current commit
237-
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
238-
uses: ncipollo/[email protected]
239-
with:
240-
artifacts: wheelhouse/repaired_wheel/aie_python_bindings*.whl
241-
token: "${{ secrets.GITHUB_TOKEN }}"
242-
tag: 'latest-wheels'
243-
name: 'latest-wheels'
244-
removeArtifacts: false
245-
allowUpdates: true
246-
replacesArtifacts: true
247-
makeLatest: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ lib/**/Makefile
2525
/platforms/vck190_bare/vivado/vck190_bare_proj
2626
utils/vitisVariables.config
2727
runtime_lib/xaiengine/src
28+
/ironenv
29+
/.cache

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ cmake_dependent_option(AIE_ENABLE_AIRBIN
201201
# If we need runtime libs, then statically link them.
202202
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
203203

204-
# add_flag_if_supported("-Werror=sign-compare" WERROR_SIGN_COMPARE)
204+
add_flag_if_supported("-Werror=sign-compare" WERROR_SIGN_COMPARE)
205205
add_flag_if_supported("-Werror=unused" WERROR_USED)
206206

207207
# What happens when you have a non-void function with no return?

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Turn off SecureBoot (Allows for unsigned drivers to be installed):
3939

4040
## Prerequisites
4141

42-
### Install AIETools
42+
### Install the XDNA™ Driver
4343

4444
#### Supporting AMD Ryzen™ AI with AMD XDNA™/AIE-ML (AIE2) and AMD XDNA™ 2 (AIE2P): Install AMD Vitis™ AIE Essentials
4545

aie_kernels/aie2/bf16_softmax.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
void softmax_simple_bf16(bfloat16 *restrict input_vector,
55
bfloat16 *restrict output_vector,
66
const int32_t vector_size) {
7+
event0();
78
// Find maximum for numerical stability
89
float max_val = (float)input_vector[0];
910
for (uint32_t i = 1; i < vector_size; i++) {
@@ -47,6 +48,7 @@ void softmax_simple_bf16(bfloat16 *restrict input_vector,
4748
float val = (float)output_vector[i] * inv_sum;
4849
output_vector[i] = (bfloat16)val;
4950
}
51+
event1();
5052
return;
5153
}
5254

0 commit comments

Comments
 (0)