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

Commit c664d92

Browse files
committed
AIE CI tests (#10)
1 parent f505444 commit c664d92

8 files changed

+1903
-0
lines changed

.github/workflows/ci-linux.yml

+193
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: CI Linux
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
force_debug_with_tmate:
7+
type: boolean
8+
description: 'Run the build with tmate session'
9+
required: false
10+
default: false
11+
debug_with_tmate:
12+
type: boolean
13+
description: 'Run the build with a tmate session ONLY in case of failure'
14+
required: false
15+
default: false
16+
release:
17+
type: boolean
18+
description: 'Release to latest'
19+
required: false
20+
default: false
21+
pull_request:
22+
merge_group:
23+
push:
24+
branches:
25+
- amd-staging
26+
27+
concurrency:
28+
group: ci-build-test-cpp-linux-${{ github.event.number || github.sha }}
29+
cancel-in-progress: true
30+
31+
jobs:
32+
build:
33+
name: Build (linux)
34+
runs-on: ubuntu-22.04
35+
container:
36+
image: quay.io/pypa/manylinux_2_28_x86_64
37+
env:
38+
GITHUB_SHA: ${{ github.sha }}
39+
steps:
40+
- name: Install tmate
41+
run: dnf install -y epel-release && dnf install -y tmate
42+
43+
- name: Install deps
44+
run: |
45+
dnf install -y almalinux-release-devel
46+
yum install -y elfutils-libelf-devel p7zip p7zip-plugins \
47+
sudo ncurses-compat-libs openssh vim-common
48+
49+
- name: Setup Cpp
50+
uses: aminya/setup-cpp@v1
51+
with:
52+
compiler: llvm-18
53+
cmake: true
54+
ninja: true
55+
56+
- name: "Checking out repository"
57+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
58+
with:
59+
submodules: recursive
60+
61+
- name: Build and install libnuma
62+
run: |
63+
curl --silent -L \
64+
https://github.com/numactl/numactl/releases/download/v2.0.18/numactl-2.0.18.tar.gz \
65+
-o numactl-2.0.18.tar.gz
66+
tar -xf numactl-2.0.18.tar.gz
67+
pushd numactl-2.0.18
68+
./configure
69+
# i have no idea why this is necessary
70+
# but without it you get something about "can't cd into dir"
71+
sed -i '7563s/`cd "$dir" && pwd`/$dir/g' libtool
72+
make install
73+
popd
74+
75+
- name: Hack ROCR
76+
run: |
77+
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/blit_shaders/CMakeLists.txt
78+
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/core/runtime/trap_handler/CMakeLists.txt
79+
sed -i 's/amdgcn-amd-amdhsa/amdgcn-amd-amdhsa -nogpulib/g' runtime/hsa-runtime/image/blit_src/CMakeLists.txt
80+
81+
- name: Build ROCR distro
82+
run: |
83+
rocr_dir="$(cd $GITHUB_WORKSPACE && pwd)"
84+
build_rocr_dir="$GITHUB_WORKSPACE/rocr-build"
85+
mkdir -p "$build_rocr_dir"
86+
build_rocr_dir="$(cd $build_rocr_dir && pwd)"
87+
rocr_install_dir="$GITHUB_WORKSPACE/rocr-install"
88+
89+
cmake -GNinja \
90+
-DCMAKE_BUILD_TYPE=Release \
91+
-DCMAKE_INSTALL_PREFIX="$rocr_install_dir" \
92+
-DClang_DIR=$HOME/llvm/lib/cmake/clang \
93+
-DLLVM_DIR=$HOME/llvm/lib/cmake/llvm \
94+
-DIMAGE_SUPPORT=OFF \
95+
-S "$rocr_dir" -B "$build_rocr_dir"
96+
97+
cmake --build "$build_rocr_dir" --target install
98+
tar -cf rocr-${GITHUB_SHA::8}.tar rocr-install
99+
100+
- name: Upload artifacts
101+
uses: actions/upload-artifact@v4
102+
if: ${{ !cancelled() }}
103+
with:
104+
name: linux_x86_64_distro
105+
path: rocr-*.tar
106+
if-no-files-found: warn
107+
108+
- name: Setup tmate session
109+
if: ${{ (failure() && inputs.debug_with_tmate) || inputs.force_debug_with_tmate }}
110+
uses: mxschmitt/[email protected]
111+
with:
112+
limit-access-to-actor: true
113+
install-dependencies: false
114+
115+
test_aie:
116+
name: AIE tests
117+
needs: build
118+
strategy:
119+
fail-fast: false
120+
matrix:
121+
runs-on: [linux-phoenix]
122+
runs-on: ${{ matrix.runs-on }}
123+
steps:
124+
- name: "Checking out repository"
125+
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3
126+
127+
- name: Download artifacts
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: linux_x86_64_distro
131+
132+
- name: Extract artifact
133+
run: |
134+
tar -xf rocr-*.tar
135+
echo hsa_runtime64_ROOT="$PWD/rocr-install" >> $GITHUB_ENV
136+
137+
- name: Build and run AIE smoke test
138+
run: |
139+
pushd rocrtst/suites/aie
140+
141+
build_dir="$PWD/build"
142+
mkdir -p $build_dir
143+
cmake -GNinja \
144+
-DCMAKE_BUILD_TYPE=Release \
145+
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib64/cmake/hsa-runtime64" \
146+
-S "$PWD" -B "$build_dir"
147+
cmake --build "$build_dir" --target aie_hsa_bare_add_one
148+
149+
"$build_dir"/aie_hsa_bare_add_one $PWD
150+
151+
popd
152+
153+
- name: Build AIE test suite
154+
run: |
155+
pushd rocrtst/suites/aie
156+
157+
build_dir="$PWD/build"
158+
mkdir -p $build_dir
159+
cmake -GNinja \
160+
-DCMAKE_BUILD_TYPE=Release \
161+
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib64/cmake/hsa-runtime64" \
162+
-S "$PWD" -B "$build_dir"
163+
164+
! cmake --build "$build_dir" --target aie_hsa_dispatch_test
165+
166+
popd
167+
168+
release:
169+
name: Release
170+
if: ${{ inputs.release }}
171+
needs: [build, test_aie]
172+
runs-on: ubuntu-22.04
173+
permissions:
174+
id-token: write
175+
contents: write
176+
steps:
177+
- name: Download artifacts
178+
uses: actions/download-artifact@v4
179+
with:
180+
name: linux_x86_64_distro
181+
182+
- name: Release current commit
183+
uses: ncipollo/[email protected]
184+
with:
185+
artifacts: rocr-*.tar
186+
token: "${{ secrets.GITHUB_TOKEN }}"
187+
tag: "latest"
188+
name: "latest"
189+
removeArtifacts: false
190+
allowUpdates: true
191+
replacesArtifacts: true
192+
makeLatest: true
193+
artifactErrorsFailBuild: true

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)