-
Notifications
You must be signed in to change notification settings - Fork 94
129 lines (108 loc) · 3.88 KB
/
buildAndTestRyzenAISw.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
name: Build and Test with Ryzen AI Sofware
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
AIE_COMMIT:
description: 'which aie commit to build'
type: string
required: false
default: ''
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-tools-linux-${{ github.event.number || github.sha }}
cancel-in-progress: true
env:
DEBIAN_FRONTEND: noninteractive
jobs:
build-repo:
name: Build and Test with Ryzen AI Software
runs-on: ubuntu-latest
strategy:
matrix:
ubuntu_version: [ "ubuntu22", "ubuntu24" ]
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
- name: Docker prune
shell: bash
run: |
docker system prune -a -f
- uses: actions/checkout@v4
with:
submodules: "true"
- uses: uraimo/[email protected]
name: Build and Test
id: runcmd
with:
distro: none
base_image: ghcr.io/xilinx/mlir-aie/${{ matrix.ubuntu_version }}-ryzenai-1.3.0ea:1.0
githubToken: ${{ github.token }}
dockerRunArgs: |
--mac-address 02:42:ac:11:00:02
env: |
XILINXD_LICENSE_FILE: /opt/xilinx/Xilinx.lic
run: |
MLIR_DIR=$PWD
pushd /workspace
tar xvf /workspace/ryzen_ai-1.3.0ea1.tgz
pushd /workspace/ryzen_ai-1.3.0
# The ryzen_ai-1.3 wheels are built for python3.10
sed -i 's/python -/python3.10 -/g' install_ryzen_ai_1_3.sh
./install_ryzen_ai_1_3.sh -a yes -p /workspace/venv -l
popd
export LD_LIBRARY_PATH=
export PYTHONPATH=
source /workspace/venv/bin/activate
export LD_LIBRARY_PATH=
source /opt/xilinx/xrt/setup.sh
popd
if [ x"${{ inputs.AIE_COMMIT }}" != x"" ]; then
git reset --hard ${{ inputs.AIE_COMMIT }}
fi
pip install onnxruntime==1.17.0
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)
cd /workspace
pip -q download mlir==$VERSION \
-f https://github.com/Xilinx/mlir-aie/releases/expanded_assets/mlir-distro
unzip -q mlir-*.whl
mkdir -p /workspace/install
mkdir -p /workspace/build
pushd /workspace/build
cmake $MLIR_DIR -G Ninja \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DXRT_ROOT=/opt/xilinx/xrt \
-DAIE_ENABLE_PYTHON_PASSES=OFF \
-DAIE_ENABLE_XRT_PYTHON_BINDINGS=ON \
-DAIE_INCLUDE_INTEGRATION_TESTS=OFF \
-DAIE_VITIS_COMPONENTS='AIE2;AIE2P' \
-DPython3_EXECUTABLE=$(which python) \
-DLLVM_EXTERNAL_LIT=$(which lit) \
-DCMAKE_INSTALL_PREFIX=/workspace/install \
-DCMAKE_MODULE_PATH=$MLIR_DIR/cmake/modulesXilinx \
-DMLIR_DIR=/workspace/mlir/lib/cmake/mlir
ninja install
ninja check-aie
popd