Skip to content
This repository was archived by the owner on Dec 24, 2024. It is now read-only.

Commit 0a42b0a

Browse files
committed
[WIP] AIE CI tests
1 parent f505444 commit 0a42b0a

8 files changed

+1885
-0
lines changed

.github/workflows/ci-linux.yml

+175
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: CI Linux
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
pull_request:
7+
merge_group:
8+
push:
9+
branches:
10+
- main
11+
12+
concurrency:
13+
# A PR number if a pull request and otherwise the commit hash. This cancels
14+
# queued and in-progress runs for the same PR (presubmit) or commit
15+
# (postsubmit).
16+
group: ci-build-test-cpp-linux-${{ github.event.number || github.sha }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
build:
21+
name: Build (linux)
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
runs-on:
26+
- ubuntu-22.04
27+
# - nod-ai-shared-cpubuilder-manylinux-x86_64
28+
runs-on: ${{ matrix.runs-on }}
29+
steps:
30+
- name: Install tmate
31+
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
32+
run: dnf install -y epel-release && dnf install -y tmate
33+
34+
- name: Configure local git mirrors
35+
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
36+
run: |
37+
/gitmirror/scripts/trigger_update_mirrors.sh
38+
/gitmirror/scripts/git_config.sh
39+
40+
- name: Install deps
41+
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
42+
run: |
43+
dnf install -y almalinux-release-devel
44+
yum install -y elfutils-libelf-devel p7zip p7zip-plugins
45+
46+
- name: Install deps
47+
if: ${{ matrix.runs-on == 'ubuntu-22.04' }}
48+
run: |
49+
sudo apt install -y libelf-dev libnuma-dev libdrm-dev
50+
51+
- name: Setup Cpp
52+
if: ${{ matrix.runs-on == 'ubuntu-22.04' }}
53+
uses: aminya/setup-cpp@v1
54+
with:
55+
compiler: llvm-18
56+
cmake: true
57+
ninja: true
58+
ccache: true
59+
60+
- name: "Checking out repository"
61+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
62+
with:
63+
submodules: recursive
64+
65+
- name: Build and install libnuma
66+
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
67+
run: |
68+
curl --silent -L \
69+
https://github.com/numactl/numactl/releases/download/v2.0.18/numactl-2.0.18.tar.gz \
70+
-o numactl-2.0.18.tar.gz
71+
tar -xf numactl-2.0.18.tar.gz
72+
pushd numactl-2.0.18
73+
./configure
74+
make install
75+
popd
76+
77+
- name: Hack ROCR
78+
run: |
79+
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/blit_shaders/CMakeLists.txt
80+
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/trap_handler/CMakeLists.txt
81+
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/image/blit_src/CMakeLists.txt
82+
83+
- name: Build ROCR distro
84+
run: |
85+
rocr_dir="$(cd ${{ github.workspace }} && pwd)"
86+
build_rocr_dir="${{ github.workspace }}/rocr-build"
87+
mkdir -p "$build_rocr_dir"
88+
build_rocr_dir="$(cd $build_rocr_dir && pwd)"
89+
rocr_install_dir="${{ github.workspace }}/rocr-install"
90+
91+
cmake -GNinja \
92+
-DCMAKE_BUILD_TYPE=Release \
93+
-DCMAKE_INSTALL_PREFIX="$rocr_install_dir" \
94+
-DClang_DIR=/usr/lib/llvm-18/lib/cmake/clang \
95+
-DLLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm \
96+
-DIMAGE_SUPPORT=OFF \
97+
-S "$rocr_dir" -B "$build_rocr_dir"
98+
99+
cmake --build "$build_rocr_dir" --target install
100+
tar -cf rocr-$(git rev-parse --short HEAD).tar rocr-install
101+
102+
- name: Upload artifacts
103+
uses: actions/upload-artifact@v4
104+
if: ${{ !cancelled() }}
105+
with:
106+
name: linux_x86_64_distro
107+
path: rocr-*.tar
108+
if-no-files-found: warn
109+
110+
- name: Setup tmate session
111+
if: ${{ failure() }}
112+
uses: mxschmitt/[email protected]
113+
with:
114+
limit-access-to-actor: true
115+
install-dependencies: ${{ matrix.runs-on == 'ubuntu-22.04' }}
116+
117+
test_aie:
118+
name: AIE tests
119+
needs: build
120+
strategy:
121+
fail-fast: false
122+
matrix:
123+
runs-on: [linux-phoenix]
124+
runs-on: ${{ matrix.runs-on }}
125+
steps:
126+
- name: "Checking out repository"
127+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
128+
129+
- name: Download artifacts
130+
uses: actions/download-artifact@v4
131+
with:
132+
name: linux_x86_64_distro
133+
134+
- name: Extract artifact
135+
run: |
136+
tar -xf rocr-*.tar
137+
echo hsa_runtime64_ROOT="$PWD/rocr-install" >> $GITHUB_ENV
138+
139+
- name: Build and run AIE smoke test
140+
run: |
141+
pushd rocrtst/suites/aie
142+
143+
build_dir="$PWD/build"
144+
mkdir -p $build_dir
145+
cmake -GNinja \
146+
-DCMAKE_BUILD_TYPE=Release \
147+
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib/cmake/hsa-runtime64" \
148+
-S "$PWD" -B "$build_dir"
149+
cmake --build "$build_dir" --target aie_hsa_bare_add_one
150+
151+
"$build_dir"/aie_hsa_bare_add_one $PWD
152+
153+
popd
154+
155+
- name: Build AIE test suite
156+
continue-on-error: true
157+
run: |
158+
pushd rocrtst/suites/aie
159+
160+
build_dir="$PWD/build"
161+
mkdir -p $build_dir
162+
cmake -GNinja \
163+
-DCMAKE_BUILD_TYPE=Release \
164+
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib/cmake/hsa-runtime64" \
165+
-S "$PWD" -B "$build_dir"
166+
cmake --build "$build_dir" --target aie_hsa_dispatch_test
167+
168+
popd
169+
170+
- name: Run AIE test suite
171+
if: ${{ !failure() }}
172+
run: |
173+
pushd rocrtst/suites/aie
174+
build_dir="$PWD/build"
175+
"$build_dir"/aie_hsa_dispatch_test $PWD

rocrtst/suites/aie/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
find_package(hsa-runtime64 CONFIG REQUIRED NAMES hsa_runtime64 hsa-runtime64)
2+
3+
# smoke test
4+
add_executable(aie_hsa_bare_add_one aie_hsa_bare_add_one.cc)
5+
6+
# hsa test
7+
add_executable(aie_hsa_dispatch_test aie_hsa_dispatch_test.cc)
8+
target_link_libraries(aie_hsa_dispatch_test PUBLIC hsa-runtime64::hsa-runtime64)

rocrtst/suites/aie/add_one.pdi

3.47 KB
Binary file not shown.

rocrtst/suites/aie/add_one_insts.txt

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
06030100
2+
00000105
3+
00000007
4+
00000110
5+
00000001
6+
00000000
7+
0001D000
8+
00000030
9+
00000400
10+
00000000
11+
00000000
12+
00000000
13+
80000000
14+
00000000
15+
00000000
16+
02000000
17+
00000081
18+
00000030
19+
00000000
20+
00000000
21+
00000000
22+
00000000
23+
0001D004
24+
00000000
25+
00000001
26+
00000000
27+
00000000
28+
00000000
29+
00000000
30+
00000000
31+
0001D204
32+
00000000
33+
80000000
34+
00000018
35+
00000001
36+
00000000
37+
0001D020
38+
00000030
39+
00000400
40+
00000000
41+
00000000
42+
00000000
43+
80000000
44+
00000000
45+
00000000
46+
02000000
47+
00000081
48+
00000030
49+
00000000
50+
00000000
51+
00000000
52+
00000000
53+
0001D024
54+
00000000
55+
00000000
56+
00000000
57+
00000000
58+
00000000
59+
00000000
60+
00000000
61+
0001D214
62+
00000000
63+
00000001
64+
00000018
65+
00000080
66+
00000010
67+
00000000
68+
00010100

0 commit comments

Comments
 (0)