Skip to content

Commit f0b9b9a

Browse files
authored
Add CI testing for ArmPL backend (#668)
1 parent 88bbd80 commit f0b9b9a

File tree

3 files changed

+132
-19
lines changed

3 files changed

+132
-19
lines changed

.github/workflows/pr-arm.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: "PR Tests (aarch64)"
2+
permissions: read-all
3+
4+
# Trigger for PR and merge to develop branch
5+
on:
6+
push:
7+
branches: develop
8+
pull_request:
9+
workflow_dispatch:
10+
11+
env:
12+
CTEST_OUTPUT_ON_FAILURE: 1
13+
LAPACK_VERSION: 3.12.0
14+
ARMPL_VERSION: 25.04.1
15+
DPCPP_VERSION: nightly-2025-04-01
16+
17+
jobs:
18+
unit-tests:
19+
runs-on: ubuntu-24.04-arm
20+
# One runner for each domain
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- config: ArmPL BLAS
26+
domain: blas
27+
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install
28+
- config: ArmPL LAPACK
29+
domain: lapack
30+
build_options: -DREF_LAPACK_ROOT=${PWD}/lapack/install
31+
- config: ArmPL RNG
32+
domain: rng
33+
test_options: -E 'Device|DEVICE'
34+
name: unit tests ${{ matrix.config }} CPU
35+
steps:
36+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37+
- name: Check if the changes affect this domain
38+
id: domain_check
39+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
40+
with:
41+
script: |
42+
const domainCheck = require('.github/scripts/domain-check.js')
43+
return domainCheck({github, context, domain: "${{ matrix.domain }}"})
44+
- name: Restore netlib from cache
45+
id: cache-lapack
46+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
47+
with:
48+
path: lapack/install
49+
key: lapack-${{ env.LAPACK_VERSION }}-arm
50+
- name: Install netlib
51+
if: steps.domain_check.outputs.result == 'true' && steps.cache-lapack.outputs.cache-hit != 'true'
52+
run: |
53+
curl -sL https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v${LAPACK_VERSION}.tar.gz | tar zx
54+
SHARED_OPT="lapack-${LAPACK_VERSION} -DBUILD_SHARED_LIBS=on -DCBLAS=on -DLAPACKE=on -DCMAKE_INSTALL_PREFIX=${PWD}/lapack/install -G Ninja"
55+
# 32 bit int
56+
cmake ${SHARED_OPT} -B lapack/build32
57+
cmake --build lapack/build32 --target install
58+
# 64 bit int
59+
cmake ${SHARED_OPT} -DBUILD_INDEX64=on -B lapack/build64
60+
cmake --build lapack/build64 --target install
61+
- name: Restore DPC++ from cache
62+
id: cache-dpcpp
63+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
64+
with:
65+
path: dpcpp/install
66+
key: dpcpp-${{ env.DPCPP_VERSION }}-arm
67+
- name: Build DPC++
68+
if: steps.domain_check.outputs.result == 'true' && steps.cache-dpcpp.outputs.cache-hit != 'true'
69+
run: |
70+
wget --progress=dot:giga -P dpcpp https://github.com/intel/llvm/archive/refs/tags/${{ env.DPCPP_VERSION }}.tar.gz
71+
cd dpcpp
72+
tar -xzf ${{ env.DPCPP_VERSION }}.tar.gz
73+
python llvm-${{ env.DPCPP_VERSION }}/buildbot/configure.py -o build -t Release --cmake-gen Ninja --native_cpu --cmake-opt="-DSYCL_ENABLE_BACKENDS=native_cpu" --cmake-opt="-DCMAKE_INSTALL_PREFIX=$PWD/install" --llvm-external-projects=openmp
74+
cd build
75+
ninja deploy-sycl-toolchain omp install
76+
- name: Install ArmPL
77+
if: steps.domain_check.outputs.result == 'true'
78+
run: |
79+
mkdir armpl
80+
cd armpl
81+
wget --progress=dot:giga https://developer.arm.com/-/cdn-downloads/permalink/Arm-Performance-Libraries/Version_${{ env.ARMPL_VERSION }}/arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb_gcc.tar
82+
tar -xf arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb_gcc.tar
83+
./arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb/arm-performance-libraries_${{ env.ARMPL_VERSION }}_deb.sh -a -i $PWD/install
84+
- name: Configure/Build for a domain
85+
if: steps.domain_check.outputs.result == 'true'
86+
run: |
87+
export PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/bin:${PWD}/dpcpp/install/bin:${PATH}
88+
export CPATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/include:${PWD}/dpcpp/install/include:${CPATH}
89+
export LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LIBRARY_PATH}
90+
export LD_LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LD_LIBRARY_PATH}
91+
sycl-ls
92+
cmake -DTARGET_DOMAINS=${{ matrix.domain }} -DENABLE_MKLCPU_BACKEND=off -DENABLE_MKLGPU_BACKEND=off -DENABLE_ARMPL_BACKEND=on -DARMPL_ROOT=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc -DCMAKE_CXX_FLAGS='-fopenmp' -DCMAKE_VERBOSE_MAKEFILE=on ${{ matrix.build_options }} -B build -G Ninja
93+
cmake --build build
94+
- name: Run tests
95+
if: steps.domain_check.outputs.result == 'true'
96+
run: |
97+
export PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/bin:${PWD}/dpcpp/install/bin:${PATH}
98+
export CPATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/include:${PWD}/dpcpp/install/include:${CPATH}
99+
export LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LIBRARY_PATH}
100+
export LD_LIBRARY_PATH=${PWD}/armpl/install/armpl_${{ env.ARMPL_VERSION }}_gcc/lib:${PWD}/dpcpp/install/lib:${PWD}/dpcpp/install/lib/aarch64-unknown-linux-gnu:${LD_LIBRARY_PATH}
101+
sycl-ls
102+
ctest --test-dir build ${{ matrix.test_options }}

.github/workflows/pr-lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "PR Linters"
2+
permissions: read-all
3+
4+
# Trigger for PR and merge to develop branch
5+
on:
6+
push:
7+
branches: develop
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
format-checks:
13+
runs-on: ubuntu-latest
14+
name: clang-format check
15+
steps:
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
18+
with:
19+
python-version: '3.10'
20+
cache: 'pip'
21+
- name: Install pre-commit
22+
run: pip install pre-commit
23+
- name: Run clang-format check
24+
run: pre-commit run --all-files --show-diff-on-failure --color always

.github/workflows/pr.yml renamed to .github/workflows/pr-x86.yml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "PR Tests"
1+
name: "PR Tests (x86_64)"
22
permissions: read-all
33

44
# Trigger for PR and merge to develop branch
@@ -14,19 +14,6 @@ env:
1414
PARALLEL: -j 2
1515

1616
jobs:
17-
format-checks:
18-
runs-on: ubuntu-latest
19-
name: clang-format check
20-
steps:
21-
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
22-
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
23-
with:
24-
python-version: '3.10'
25-
cache: 'pip'
26-
- name: Install pre-commit
27-
run: pip install pre-commit
28-
- name: Run clang-format check
29-
run: pre-commit run --all-files --show-diff-on-failure --color always
3017
unit-tests:
3118
runs-on: ubuntu-latest
3219
# One runner for each domain
@@ -41,19 +28,19 @@ jobs:
4128
domain: dft
4229
build_options: -DENABLE_PORTFFT_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF
4330
test_options: -R 'DFT/CT/.*ComputeTests_in_place_COMPLEX.COMPLEX_SINGLE_in_place_buffer.sizes_8_batches_1*'
44-
- config: oneMath BLAS
31+
- config: oneMKL BLAS
4532
domain: blas
4633
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install
47-
- config: oneMath DFT
34+
- config: oneMKL DFT
4835
domain: dft
49-
- config: oneMath LAPACK
36+
- config: oneMKL LAPACK
5037
domain: lapack
5138
build_options: -DREF_LAPACK_ROOT=${PWD}/lapack/install
52-
- config: oneMath RNG
39+
- config: oneMKL RNG
5340
domain: rng
5441
name: unit tests ${{ matrix.config }} CPU
5542
steps:
56-
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
43+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5744
- name: Check if the changes affect this domain
5845
id: domain_check
5946
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1

0 commit comments

Comments
 (0)