Skip to content

Commit 5e7f5d8

Browse files
committed
cpu: aarch64: support ci with TP
Signed-off-by: Ye Tao <ye.tao@arm.com>
1 parent cfe12d8 commit 5e7f5d8

File tree

3 files changed

+78
-19
lines changed

3 files changed

+78
-19
lines changed

.github/automation/build_aarch64.sh

+60-7
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,48 @@
1818
# *******************************************************************************
1919

2020
# Build oneDNN for aarch64.
21-
2221
set -o errexit -o pipefail -o noclobber
2322

2423
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
2524

25+
26+
# Function to clone and install Eigen
27+
install_eigen() {
28+
local eigen_repo="https://gitlab.com/libeigen/eigen.git"
29+
local eigen_commit="aa6964bf3a34fd607837dd8123bc42465185c4f8"
30+
31+
echo "Cloning Eigen repository..."
32+
if ! git clone "$eigen_repo" --depth 1; then
33+
echo "Error: Failed to clone Eigen repository."
34+
return 1
35+
fi
36+
37+
cd eigen
38+
39+
if ! git fetch --depth 1 origin "$eigen_commit" || ! git checkout "$eigen_commit"; then
40+
echo "Error: Failed to fetch or checkout commit."
41+
return 1
42+
fi
43+
44+
cd ..
45+
46+
mkdir -p eigen-build && cd eigen-build
47+
48+
if ! cmake -DCMAKE_INSTALL_PREFIX="${EIGEN_INSTALL_PATH}" "$EIGEN_PATH"; then
49+
echo "Error: CMake configuration failed."
50+
return 1
51+
fi
52+
53+
# Build and install Eigen
54+
echo "Building and installing Eigen..."
55+
if ! make -s -j install; then
56+
echo "Error: Build or installation failed."
57+
return 1
58+
fi
59+
60+
echo "Eigen installed successfully!"
61+
}
62+
2663
# Defines MP, CC, CXX and OS.
2764
source ${SCRIPT_DIR}/common_aarch64.sh
2865

@@ -36,16 +73,32 @@ if [[ "$OS" == "Darwin" ]]; then
3673
ONEDNN_THREADING=SEQ
3774
fi
3875

39-
set -x
40-
cmake \
41-
-Bbuild -S. \
76+
CMAKE_OPTIONS="-Bbuild -S. \
4277
-DDNNL_AARCH64_USE_ACL=ON \
4378
-DONEDNN_BUILD_GRAPH=0 \
44-
-DDNNL_CPU_RUNTIME=$ONEDNN_THREADING \
4579
-DONEDNN_WERROR=ON \
4680
-DDNNL_BUILD_FOR_CI=ON \
47-
-DONEDNN_TEST_SET=$ONEDNN_TEST_SET \
48-
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
81+
-DONEDNN_TEST_SET=${ONEDNN_TEST_SET} \
82+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
83+
"
84+
85+
if [[ "$SCHEDULER" == 'TP' ]]; then
86+
# install eigen
87+
export EIGEN_INSTALL_PATH=${EIGEN_INSTALL_PATH:-"$PWD"}
88+
export EIGEN_PATH=${EIGEN_PATH:-"$PWD/eigen"}
89+
install_eigen
90+
91+
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DDNNL_CPU_RUNTIME=THREADPOOL \
92+
-D_DNNL_TEST_THREADPOOL_IMPL=EIGEN -DEigen3_DIR=${EIGEN_INSTALL_PATH}/share/eigen3/cmake"
93+
elif [[ "$SCHEDULER" == "OMP" ] || [ "$SCHEDULER" == "SEQ" ]]; then
94+
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DDNNL_CPU_RUNTIME=OMP"
95+
else
96+
echo "Only OMP, TP, SEQ schedulers supported, $SCHEDULER requested"
97+
exit 1
98+
fi
99+
100+
set -x
101+
cmake ${CMAKE_OPTIONS}
49102

50103
cmake --build build $MP
51104
set +x

.github/automation/build_acl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if [[ "$OS" == "Linux" ]]; then
3636
ACL_MULTI_ISA_SUPPORT=1
3737
if [[ "$ACL_THREADING" == "OMP" ]]; then
3838
ACL_OPENMP=1
39-
elif [[ "$ACL_THREADING" == "SEQ" ]]; then
39+
elif [[ "$ACL_THREADING" == "SEQ" || "$ACL_THREADING" == "TP" ]]; then
4040
ACL_OPENMP=0
4141
fi
4242
ACL_OS="linux"

.github/workflows/ci-aarch64.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -70,27 +70,31 @@ jobs:
7070
CMAKE_BUILD_TYPE: ${{ matrix.config }}
7171
GCC_VERSION: 14
7272

73-
- if: matrix.toolset == 'clang'
74-
name: Run oneDNN smoke tests
73+
- name: Run oneDNN smoke tests
7574
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
7675
working-directory: ${{ github.workspace }}/oneDNN/build
7776
env:
7877
CMAKE_BUILD_TYPE: ${{ matrix.config }}
7978
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build
80-
81-
# We only run the linux aarch64 runners if macos smoke tests pass.
79+
80+
# We only run the linux aarch64 runners if macOS smoke tests pass.
8281
linux:
8382
needs: macos
8483
strategy:
8584
matrix:
86-
threading: [OMP]
8785
toolset: [clang, gcc]
8886
config: [Debug, Release]
89-
host: [
90-
{ name: c6g, label: ah-ubuntu_22_04-c6g_2x-50 },
91-
{ name: c7g, label: ah-ubuntu_22_04-c7g_2x-50 }
92-
]
93-
87+
threading: [ OMP ]
88+
host: [ { name: c6g, label: ah-ubuntu_22_04-c6g_2x-50 }, { name: c7g, label: ah-ubuntu_22_04-c7g_2x-50 }]
89+
include:
90+
- toolset: clang
91+
config: Release
92+
threading: TP
93+
host: { name: c6g, label: ah-ubuntu_22_04-c6g_2x-50 }
94+
- toolset: clang
95+
config: Release
96+
threading: TP
97+
host: { name: c7g, label: ah-ubuntu_22_04-c7g_2x-50 }
9498
name: ${{ matrix.host.name }}, ${{ matrix.toolset }}, ${{ matrix.threading }}, ${{ matrix.config }}
9599
runs-on: ${{ matrix.host.label }}
96100
steps:
@@ -140,6 +144,8 @@ jobs:
140144
CMAKE_BUILD_TYPE: ${{ matrix.config }}
141145
GCC_VERSION: 13
142146
ONEDNN_THREADING: ${{ matrix.threading }}
147+
EIGEN_INSTALL_PATH: ${{ github.workspace }}
148+
SCHEDULER: ${{ matrix.threading }}
143149

144150
- name: Run oneDNN tests
145151
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
@@ -148,4 +154,4 @@ jobs:
148154
BUILD_TOOLSET: ${{ matrix.toolset }}
149155
CMAKE_BUILD_TYPE: ${{ matrix.config }}
150156
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build
151-
ONEDNN_THREADING: ${{ matrix.threading }}
157+
ONEDNN_THREADING: ${{ matrix.threading }}

0 commit comments

Comments
 (0)