forked from Xilinx/mlir-air
-
Notifications
You must be signed in to change notification settings - Fork 1
146 lines (122 loc) · 4.8 KB
/
buildAndTestRyzenAI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build and Test with AIE tools on Ryzen AI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
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-test-ryzenai-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
DEBIAN_FRONTEND: noninteractive
XILINXD_LICENSE_FILE: /opt/xilinx/Xilinx.lic
jobs:
build-repo:
name: Build and Test with AIE tools on Ryzen AI
runs-on: ryzenai
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- name: Setup environment
run: |
python3.12 -m venv air-venv
source air-venv/bin/activate
pip cache purge
pip install --upgrade pip
pip install lit cmake joblib
- name: Get mlir-aie
id: clone-mlir-aie
run: |
utils/clone-mlir-aie.sh
source air-venv/bin/activate
pushd mlir-aie
pip install -r python/requirements.txt
pip install -r python/requirements_ml.txt
HOST_MLIR_PYTHON_PACKAGE_PREFIX=aie pip install -r python/requirements_extras.txt
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
find mlir -exec touch -a -m -t 201108231405.14 {} \;
popd
- name: Build and Install mlir-aie
run: |
source air-venv/bin/activate
pushd mlir-aie
mkdir build
pushd build
export PATH=$PATH:/opt/Xilinx/Vitis/2023.2/bin:/opt/Xilinx/Vitis/2023.2/aietools/bin
cmake .. \
-GNinja \
-DPython3_EXECUTABLE=$(which python) \
-DCMAKE_INSTALL_PREFIX=$PWD/../install \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=clang-15 \
-DCMAKE_CXX_COMPILER=clang++-15 \
-DCMAKE_ASM_COMPILER=clang-15 \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_PATH=$PWD/../cmake/modulesXilinx \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DMLIR_DIR=$PWD/../mlir/lib/cmake/mlir \
-DXRT_ROOT=/opt/xilinx/xrt \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DAIE_ENABLE_XRT_PYTHON_BINDINGS=ON \
-DAIE_VITIS_COMPONENTS='AIE;AIE2' \
-DAIE_INCLUDE_INTEGRATION_TESTS=OFF
ninja install
popd
rm -rf build
popd
# Build the repo test target in debug mode to build and test.
- name: Build and test mlir-air (Assert)
run: |
source air-venv/bin/activate
mkdir build_assert
pushd build_assert
sudo prlimit -lunlimited --pid $$
export PATH=$PATH:/opt/Xilinx/Vitis/2023.2/bin:/opt/Xilinx/Vitis/2023.2/aietools/bin
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DPython3_EXECUTABLE=$(which python) \
-DCMAKE_INSTALL_PREFIX=$PWD/../install \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=clang-15 \
-DCMAKE_CXX_COMPILER=clang++-15 \
-DCMAKE_ASM_COMPILER=clang-15 \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_PATH=$PWD/../mlir-aie/cmake/modulesXilinx \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DMLIR_DIR=`pwd`/../mlir-aie/mlir/lib/cmake/mlir \
-DLLVM_DIR=`pwd`/../mlir-aie/mlir/lib/cmake/llvm \
-DAIE_DIR=$PWD/../mlir-aie/install/lib/cmake/aie/ \
-Dx86_64_TOOLCHAIN_FILE=$PWD/../cmake/modules/toolchain_x86_64.cmake \
-DLibXAIE_ROOT=$PWD/../mlir-aie/install/runtime_lib/x86_64/xaiengine \
-DAIR_RUNTIME_TARGETS:STRING="x86_64" \
-DXRT_ROOT=/opt/xilinx/xrt \
-DENABLE_RUN_XRT_TESTS=ON
ninja install
export LIT_OPTS="-sv --time-tests --show-unsupported --show-excluded --order random"
ninja check-air-cpp
ninja check-air-mlir
ninja check-air-python
export LIT_OPTS="${LIT_OPS} --timeout 600 -j5"
ninja check-air-e2e
ninja check-programming-examples
popd
rm -rf build_assert