Skip to content

Commit 16780c2

Browse files
github: workflows: Enable aarch64 CI (uxlfoundation#2142)
Signed-off-by: Hamza Butt <hamza.butt@arm.com>
1 parent 0306ffd commit 16780c2

File tree

6 files changed

+402
-44
lines changed

6 files changed

+402
-44
lines changed

.github/automation/build_aarch64.sh

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#! /bin/bash
2+
3+
# *******************************************************************************
4+
# Copyright 2024 Arm Limited and affiliates.
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
# *******************************************************************************
19+
20+
# Build oneDNN for aarch64.
21+
22+
set -o errexit -o pipefail -o noclobber
23+
24+
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
25+
26+
# Defines MP, CC, CXX and OS.
27+
source ${SCRIPT_DIR}/common_aarch64.sh
28+
29+
export ACL_ROOT_DIR=${ACL_ROOT_DIR:-"${PWD}/ComputeLibrary"}
30+
31+
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-"Release"}
32+
ONEDNN_TEST_SET=SMOKE
33+
34+
# ACL is not built with OMP on macOS.
35+
if [[ "$OS" == "Darwin" ]]; then
36+
ONEDNN_THREADING=SEQ
37+
fi
38+
39+
set -x
40+
cmake \
41+
-Bbuild -S. \
42+
-DDNNL_AARCH64_USE_ACL=ON \
43+
-DONEDNN_BUILD_GRAPH=0 \
44+
-DDNNL_CPU_RUNTIME=$ONEDNN_THREADING \
45+
-DONEDNN_WERROR=OFF \
46+
-DDNNL_BUILD_FOR_CI=ON \
47+
-DONEDNN_TEST_SET=$ONEDNN_TEST_SET \
48+
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
49+
50+
cmake --build build $MP
51+
set +x

.github/automation/build_acl.sh

+55-43
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /bin/bash
22

33
# *******************************************************************************
4-
# Copyright 2020-2023 Arm Limited and affiliates.
4+
# Copyright 2020-2024 Arm Limited and affiliates.
55
# SPDX-License-Identifier: Apache-2.0
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,45 +17,57 @@
1717
# limitations under the License.
1818
# *******************************************************************************
1919

20-
# Compute Library build defaults
21-
ACL_VERSION="v23.11"
22-
ACL_DIR="${PWD}/ComputeLibrary"
23-
ACL_ARCH="armv8a"
24-
ACL_MULTI_ISA_SUPPORT=0
25-
26-
while [[ $# -gt 0 ]]; do
27-
case $1 in
28-
--version)
29-
ACL_VERSION="v$2"
30-
shift
31-
;;
32-
--arch)
33-
ACL_ARCH="$2"
34-
shift
35-
;;
36-
--multi_isa)
37-
ACL_MULTI_ISA_SUPPORT=1
38-
;;
39-
--root-dir)
40-
ACL_DIR="$2"
41-
shift
42-
;;
43-
*)
44-
echo "Unknown option: $1"
45-
exit 1
46-
;;
47-
esac
48-
shift
49-
done
50-
51-
readonly ACL_REPO="https://github.com/ARM-software/ComputeLibrary.git"
52-
MAKE_NP="-j$(grep -c processor /proc/cpuinfo)"
53-
54-
git clone --branch $ACL_VERSION --depth 1 $ACL_REPO $ACL_DIR
55-
cd $ACL_DIR
56-
57-
scons --silent $MAKE_NP Werror=0 debug=0 neon=1 opencl=0 embed_kernels=0 \
58-
os=linux arch=$ACL_ARCH build=native multi_isa=$ACL_MULTI_ISA_SUPPORT \
59-
fixed_format_kernels=1
60-
61-
exit $?
20+
# Build ACL from github.
21+
22+
set -o errexit -o pipefail -o noclobber
23+
24+
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
25+
26+
# Defines MP, CC, CXX and OS.
27+
source ${SCRIPT_DIR}/common_aarch64.sh
28+
29+
ACL_CONFIG=${ACL_CONFIG:-"Release"}
30+
ACL_ROOT_DIR=${ACL_ROOT_DIR:-"${PWD}/ComputeLibrary"}
31+
ACL_VERSION=${ACL_VERSION:-v24.09}
32+
ACL_ARCH=${ACL_ARCH:-"armv8.2-a"}
33+
ACL_REPO="https://github.com/ARM-software/ComputeLibrary.git"
34+
35+
if [[ "$OS" == "Linux" ]]; then
36+
ACL_MULTI_ISA_SUPPORT=1
37+
if [[ "$ACL_THREADING" == "OMP" ]]; then
38+
ACL_OPENMP=1
39+
elif [[ "$ACL_THREADING" == "SEQ" ]]; then
40+
ACL_OPENMP=0
41+
fi
42+
ACL_OS="linux"
43+
elif [[ "$OS" == "Darwin" ]]; then
44+
ACL_MULTI_ISA_SUPPORT=0
45+
ACL_OPENMP=0
46+
ACL_OS="macos"
47+
else
48+
echo "Unknown OS: $OS"
49+
exit 1
50+
fi
51+
52+
if [[ "$ACL_CONFIG" == "Release" ]]; then
53+
ACL_DEBUG=0
54+
elif [[ "$ACL_CONFIG" == "Debug" ]]; then
55+
ACL_DEBUG=1
56+
else
57+
echo "Unknown build config: $ACL_CONFIG"
58+
exit 1
59+
fi
60+
61+
echo "Compiler version:"
62+
$CC --version
63+
64+
set -x
65+
git clone --branch $ACL_VERSION --depth 1 $ACL_REPO $ACL_ROOT_DIR
66+
67+
cd $ACL_ROOT_DIR
68+
69+
scons $MP Werror=0 debug=$ACL_DEBUG neon=1 opencl=0 embed_kernels=0 \
70+
os=$ACL_OS arch=$ACL_ARCH build=native multi_isa=$ACL_MULTI_ISA_SUPPORT \
71+
fixed_format_kernels=1 cppthreads=0 openmp=$ACL_OPENMP examples=0 \
72+
validation_tests=0
73+
set +x

.github/automation/common_aarch64.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#! /bin/bash
2+
3+
# *******************************************************************************
4+
# Copyright 2024 Arm Limited and affiliates.
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
# *******************************************************************************
19+
20+
# Common variables for aarch64 ci. Exports:
21+
# CC, CXX, OS, MP
22+
23+
set -o errexit -o pipefail -o noclobber
24+
25+
export OS=$(uname)
26+
27+
# Num threads on system.
28+
if [[ "$OS" == "Darwin" ]]; then
29+
export MP="-j$(sysctl -n hw.ncpu)"
30+
elif [[ "$OS" == "Linux" ]]; then
31+
export MP="-j$(nproc)"
32+
fi
33+
34+
if [[ "$BUILD_TOOLSET" == "gcc" ]]; then
35+
export CC=gcc-${GCC_VERSION}
36+
export CXX=g++-${GCC_VERSION}
37+
elif [[ "$BUILD_TOOLSET" == "clang" ]]; then
38+
export CC=clang
39+
export CXX=clang++
40+
fi
41+
42+
# Print every exported variable.
43+
echo "OS: $OS"
44+
echo "Toolset: $BUILD_TOOLSET"
45+
echo "CC: $CC"
46+
echo "CXX: $CXX"
47+
echo "MP: $MP"

.github/automation/test_aarch64.sh

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#! /bin/bash
2+
3+
# *******************************************************************************
4+
# Copyright 2024 Arm Limited and affiliates.
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
# Licensed under the Apache License, Version 2.0 (the "License");
8+
# you may not use this file except in compliance with the License.
9+
# You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
# *******************************************************************************
19+
20+
# Test oneDNN for aarch64.
21+
22+
set -o errexit -o pipefail -o noclobber
23+
24+
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
25+
26+
# Defines MP, CC, CXX and OS.
27+
source ${SCRIPT_DIR}/common_aarch64.sh
28+
29+
# Skip tests for certain config to preserve resources, while maintaining
30+
# coverage. Skip:
31+
# (SEQ,CLANG)
32+
# (OMP,CLANG,DEBUG)
33+
SKIP_TESTS=0
34+
if [[ "$OS" == "Linux" ]]; then
35+
if [[ "$ONEDNN_THREADING" == "SEQ" ]]; then
36+
if [[ "$BUILD_TOOLSET" == "clang" ]]; then
37+
SKIP_TESTS=1
38+
fi
39+
elif [[ "$ONEDNN_THREADING" == "OMP" ]]; then
40+
if [[ "$BUILD_TOOLSET" == "clang" ]]; then
41+
if [[ "$CMAKE_BUILD_TYPE" == "Debug" ]]; then
42+
SKIP_TESTS=1
43+
fi
44+
fi
45+
fi
46+
fi
47+
48+
if [[ $SKIP_TESTS == 1 ]]; then
49+
echo "Skipping tests for this configuration: $OS $ONEDNN_THREADING $BUILD_TOOLSET".
50+
exit 0
51+
fi
52+
53+
# We currently have some OS and config specific test failures.
54+
if [[ "$OS" == "Linux" ]]; then
55+
if [[ "$CMAKE_BUILD_TYPE" == "Debug" ]]; then
56+
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp"
57+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu"
58+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_smoke_cpu"
59+
SKIPPED_TEST_FAILURES+="|cpu-primitives-matmul-cpp"
60+
SKIPPED_TEST_FAILURES+="|test_convolution_backward_weights_f32"
61+
SKIPPED_TEST_FAILURES+="|test_matmul"
62+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_conv_smoke_cpu"
63+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_deconv_smoke_cpu"
64+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_matmul_smoke_cpu"
65+
elif [[ "$CMAKE_BUILD_TYPE" == "Release" ]]; then
66+
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp"
67+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu"
68+
fi
69+
elif [[ "$OS" == "Darwin" ]]; then
70+
if [[ "$CMAKE_BUILD_TYPE" == "Debug" ]]; then
71+
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp"
72+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu"
73+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_smoke_cpu"
74+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_brgemm_ci_cpu"
75+
elif [[ "$CMAKE_BUILD_TYPE" == "Release" ]]; then
76+
SKIPPED_TEST_FAILURES="cpu-primitives-deconvolution-cpp"
77+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_smoke_cpu"
78+
SKIPPED_TEST_FAILURES+="|test_benchdnn_modeC_lnorm_ci_cpu"
79+
fi
80+
fi
81+
82+
if [[ "$OS" == "Darwin" ]]; then
83+
# Since macos does not build with OMP, we can use multiple ctest threads.
84+
CTEST_MP=$MP
85+
elif [[ "$OS" == "Linux" ]]; then
86+
if [[ "$ONEDNN_THREADING" == "OMP" ]]; then
87+
# OMP is already multi-threaded. Let's not oversubscribe.
88+
CTEST_MP=-j2
89+
elif [[ "$ONEDNN_THREADING" == "SEQ" ]]; then
90+
CTEST_MP=$MP
91+
fi
92+
fi
93+
94+
set -x
95+
ctest $CTEST_MP --no-tests=error --verbose --output-on-failure -E "$SKIPPED_TEST_FAILURES"
96+
set +x

0 commit comments

Comments
 (0)