Skip to content

Commit 6b22724

Browse files
committed
ci: Build acl cache sequentially
1 parent db7bb91 commit 6b22724

File tree

5 files changed

+199
-52
lines changed

5 files changed

+199
-52
lines changed

.github/automation/build_acl.sh

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

33
# *******************************************************************************
4-
# Copyright 2020-2024 Arm Limited and affiliates.
4+
# Copyright 2020-2025 Arm Limited and affiliates.
55
# SPDX-License-Identifier: Apache-2.0
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,7 @@ SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
2626
# Defines MP, CC, CXX and OS.
2727
source ${SCRIPT_DIR}/common_aarch64.sh
2828

29-
CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-"Release"}
29+
ACL_BUILD_TYPE=${ACL_BUILD_TYPE:-"Release"}
3030
ACL_ROOT_DIR=${ACL_ROOT_DIR:-"${PWD}/ComputeLibrary"}
3131
ACL_REPO="https://github.com/ARM-software/ComputeLibrary.git"
3232

@@ -36,24 +36,45 @@ elif [[ "$ACL_THREADING" == "SEQ" ]]; then
3636
ACL_OPENMP=0
3737
fi
3838

39+
if [[ "$OS" == "Linux" ]]; then
40+
ACL_MULTI_ISA_SUPPORT=1
41+
if [[ "$ACL_THREADING" == "OMP" ]]; then
42+
ACL_OPENMP=1
43+
elif [[ "$ACL_THREADING" == "SEQ" ]]; then
44+
ACL_OPENMP=0
45+
fi
46+
ACL_OS="linux"
47+
elif [[ "$OS" == "Darwin" ]]; then
48+
ACL_MULTI_ISA_SUPPORT=0
49+
ACL_OPENMP=0
50+
ACL_OS="macos"
51+
else
52+
echo "Unknown OS: $OS"
53+
exit 1
54+
fi
55+
56+
if [[ "$ACL_BUILD_TYPE" == "Release" ]]; then
57+
ACL_DEBUG=0
58+
elif [[ "$ACL_BUILD_TYPE" == "Debug" ]]; then
59+
ACL_DEBUG=1
60+
else
61+
echo "Unknown build config: $ACL_BUILD_TYPE"
62+
exit 1
63+
fi
64+
3965
if [[ "$ACL_ACTION" == "clone" ]]; then
4066
set -x
4167
git clone --branch $ACL_VERSION --depth 1 $ACL_REPO $ACL_ROOT_DIR
4268
set +x
43-
elif [[ "$ACL_ACTION" == "configure" ]]; then
44-
set -x
45-
cmake \
46-
-S$ACL_ROOT_DIR -B$ACL_ROOT_DIR/build \
47-
-DARM_COMPUTE_OPENMP=$ACL_OPENMP \
48-
-DARM_COMPUTE_CPPTHREADS=0 \
49-
-DARM_COMPUTE_WERROR=0 \
50-
-DARM_COMPUTE_BUILD_EXAMPLES=1 \
51-
-DARM_COMPUTE_BUILD_TESTING=1 \
52-
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
53-
set +x
5469
elif [[ "$ACL_ACTION" == "build" ]]; then
5570
set -x
56-
cmake --build $ACL_ROOT_DIR/build
71+
cd $ACL_ROOT_DIR
72+
set -x
73+
scons $MP Werror=0 debug=$ACL_DEBUG neon=1 opencl=0 embed_kernels=0 \
74+
os=$ACL_OS arch=armv8.2-a build=native multi_isa=$ACL_MULTI_ISA_SUPPORT \
75+
fixed_format_kernels=1 cppthreads=0 openmp=$ACL_OPENMP examples=0 \
76+
validation_tests=0
77+
set +x
5778
set +x
5879
else
5980
echo "Unknown action: $ACL_ACTION"

.github/ci-aarch64.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"dependencies": {
3+
"acl": "v24.11.1",
4+
"gcc": "13",
5+
"clang": "17"
6+
}
7+
}

.github/workflows/aarch64-acl.yml

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# *******************************************************************************
2+
# Copyright 2025 Arm Limited and affiliates.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
# *******************************************************************************
17+
18+
name: "Build ACL cache"
19+
20+
#* To avoid duplicate jobs running when both push and PR is satisfied, we use this:
21+
#* https://github.com/orgs/community/discussions/26940#discussioncomment-5686753
22+
on:
23+
push:
24+
branches: [ main, 'rls-*' ]
25+
paths:
26+
- '.github/ci-aarch64.json'
27+
- '.github/workflows/aarch64-acl.yml'
28+
pull_request:
29+
types: [opened, synchronize, reopened]
30+
paths:
31+
- '.github/ci-aarch64.json'
32+
- '.github/workflows/aarch64-acl.yml'
33+
workflow_dispatch:
34+
35+
#* Stop stale workflows when pull requests are updated: https://stackoverflow.com/a/70972844
36+
#* Does not apply to the main branch.
37+
concurrency:
38+
group: ${{ github.workflow }}-${{ github.ref }}
39+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
40+
41+
# Declare default permissions as read only.
42+
permissions: read-all
43+
44+
jobs:
45+
# Cache is built sequentially to avoid cache-hit race conditions
46+
build-cache:
47+
strategy:
48+
matrix:
49+
config: [
50+
{ name: MacOS, label: macos-14, threading: SEQ, toolset: clang, build: Release, testset: SMOKE },
51+
{ name: c6g, label: ah-ubuntu_22_04-c6g_2x-50, threading: OMP, toolset: clang, build: Debug, testset: SMOKE },
52+
{ name: c7g, label: ah-ubuntu_22_04-c7g_4x-50, threading: OMP, toolset: gcc, build: Release, testset: CI }
53+
]
54+
55+
name: ${{ matrix.config.name }}, ${{ matrix.config.toolset }}, ${{ matrix.config.threading }}, ${{ matrix.config.build }}
56+
runs-on: ${{ matrix.config.label }}
57+
steps:
58+
59+
- name: Checkout oneDNN
60+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
61+
with:
62+
path: oneDNN
63+
64+
- name: Install Scons MacOS
65+
if: ${{ matrix.config.name == 'MacOS' }}
66+
uses: threeal/pipx-install-action@b0bf0add7d5aefda03a3d4e47d651df807889e10 # v1.0.0
67+
with:
68+
packages: scons
69+
70+
- name: Install scons linux
71+
if: ${{ matrix.config.name != 'MacOS' }}
72+
run: |
73+
sudo apt update -y
74+
sudo apt install -y scons
75+
76+
- name: Read version file
77+
id: get-versions
78+
run: |
79+
content=`cat ${{ github.workspace }}/oneDNN/.github/ci-aarch64.json`
80+
content="${content//[$'\t\r\n$ ']}"
81+
echo "output=$content" >> $GITHUB_OUTPUT
82+
83+
- if: ${{ (startsWith(matrix.config.label,'ah-ubuntu') && (matrix.config.threading == 'OMP')) }}
84+
name: Install openmp
85+
run: |
86+
sudo apt install -y libomp-dev
87+
88+
- if: ${{ (startsWith(matrix.config.label,'ah-ubuntu') && (matrix.config.toolset == 'gcc')) }}
89+
name: Install gcc
90+
run: |
91+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
92+
sudo apt update -y
93+
sudo apt install -y g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
94+
95+
- if: ${{ (startsWith(matrix.config.label,'ah-ubuntu') && (matrix.config.toolset == 'clang')) }}
96+
name: Install clang
97+
uses: KyleMayes/install-llvm-action@e0a8dc9cb8a22e8a7696e8a91a4e9581bec13181
98+
with:
99+
version: ${{ fromJson(steps.get-versions.outputs.output).dependencies.clang }}
100+
101+
- name: Clone ACL
102+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
103+
env:
104+
ACL_ACTION: clone
105+
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
106+
ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }}
107+
108+
- name: Get ACL commit hash for cache key
109+
id: get_acl_commit_hash
110+
run: (cd ${{ github.workspace }}/ComputeLibrary && echo "ACLCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT
111+
112+
- name: Build ACL
113+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
114+
env:
115+
ACL_ACTION: build
116+
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
117+
ACL_THREADING: ${{ matrix.config.threading }}
118+
BUILD_TOOLSET: ${{ matrix.config.toolset }}
119+
ACL_BUILD_TYPE: ${{ matrix.config.build }}
120+
GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
121+
122+
- name: Get system name
123+
id: get_system_name
124+
run: (echo "SystemName=$(uname)") >> $GITHUB_OUTPUT
125+
126+
- name: Save ACL in cache
127+
id: cache-acl_build-save
128+
uses: actions/cache/save@v4
129+
with:
130+
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.config.toolset }}-${{ matrix.config.build }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
131+
path: ${{ github.workspace }}/ComputeLibrary/build

.github/workflows/ci-aarch64.yml

+14-33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *******************************************************************************
2-
# Copyright 2024 Arm Limited and affiliates.
2+
# Copyright 2024-2025 Arm Limited and affiliates.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,7 +55,7 @@ concurrency:
5555
permissions: read-all
5656

5757
jobs:
58-
build-and-test:
58+
run-tests:
5959
strategy:
6060
matrix:
6161
config: [
@@ -74,6 +74,13 @@ jobs:
7474
with:
7575
path: oneDNN
7676

77+
- name: Read version file
78+
id: get-versions
79+
run: |
80+
content=`cat ${{ github.workspace }}/oneDNN/.github/ci-aarch64.json`
81+
content="${content//[$'\t\r\n$ ']}"
82+
echo "output=$content" >> $GITHUB_OUTPUT
83+
7784
- name: Get latest CMake and Ninja
7885
uses: lukka/get-cmake@acb35cf920333f4dc3fc4f424f1b30d5e7d561b4 # v3.31.4
7986
with:
@@ -90,20 +97,20 @@ jobs:
9097
run: |
9198
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
9299
sudo apt update -y
93-
sudo apt install -y g++-13
100+
sudo apt install -y g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
94101
95102
- if: ${{ (startsWith(matrix.config.label,'ah-ubuntu') && (matrix.config.toolset == 'clang')) }}
96103
name: Install clang
97104
uses: KyleMayes/install-llvm-action@e0a8dc9cb8a22e8a7696e8a91a4e9581bec13181
98105
with:
99-
version: "17"
106+
version: ${{ fromJson(steps.get-versions.outputs.output).dependencies.clang }}
100107

101108
- name: Clone ACL
102109
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
103110
env:
104111
ACL_ACTION: clone
105112
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
106-
ACL_VERSION: v24.11.1
113+
ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }}
107114

108115
- name: Get ACL commit hash for cache key
109116
id: get_acl_commit_hash
@@ -120,32 +127,6 @@ jobs:
120127
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.config.toolset }}-${{ matrix.config.build }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
121128
path: ${{ github.workspace }}/ComputeLibrary/build
122129

123-
- name: Configure ACL
124-
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
125-
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
126-
env:
127-
ACL_ACTION: configure
128-
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
129-
ACL_THREADING: ${{ matrix.config.threading }}
130-
BUILD_TOOLSET: ${{ matrix.config.toolset }}
131-
CMAKE_BUILD_TYPE: ${{ matrix.config.build }}
132-
CMAKE_GENERATOR: Ninja
133-
GCC_VERSION: 13
134-
135-
- name: Build ACL
136-
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
137-
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
138-
env:
139-
ACL_ACTION: build
140-
141-
- name: Save ACL in cache
142-
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
143-
id: cache-acl_build-save
144-
uses: actions/cache/save@v4
145-
with:
146-
key: ${{ steps.cache-acl-restore.outputs.cache-primary-key }}
147-
path: ${{ github.workspace }}/ComputeLibrary/build
148-
149130
- name: Configure oneDNN
150131
run: ${{ github.workspace }}/oneDNN/.github/automation/build_aarch64.sh
151132
working-directory: ${{ github.workspace }}/oneDNN
@@ -154,7 +135,7 @@ jobs:
154135
BUILD_TOOLSET: ${{ matrix.config.toolset }}
155136
CMAKE_BUILD_TYPE: ${{ matrix.config.build }}
156137
CMAKE_GENERATOR: Ninja
157-
GCC_VERSION: 13
138+
GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
158139
ONEDNN_ACTION: configure
159140
ONEDNN_TEST_SET: ${{ matrix.config.testset }}
160141
ONEDNN_THREADING: ${{ matrix.config.threading }}
@@ -177,7 +158,7 @@ jobs:
177158
# This job adds a check named "CI AArch64" that represents overall
178159
# workflow status and can be used in branch rulesets
179160
status:
180-
needs: build-and-test
161+
needs: run-tests
181162
runs-on: ubuntu-latest
182163
name: "CI AArch64"
183164
steps:

.github/workflows/nightly-aarch64.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *******************************************************************************
2-
# Copyright 2024 Arm Limited and affiliates.
2+
# Copyright 2024-2025 Arm Limited and affiliates.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -63,18 +63,25 @@ jobs:
6363
run: |
6464
sudo apt install -y libomp-dev
6565
66+
- name: Read version file
67+
id: get-versions
68+
run: |
69+
content=`cat ${{ github.workspace }}/oneDNN/.github/ci-aarch64.json`
70+
content="${content//[$'\t\r\n$ ']}"
71+
echo "output=$content" >> $GITHUB_OUTPUT
72+
6673
- name: Install gcc
6774
run: |
6875
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
6976
sudo apt update -y
70-
sudo apt install -y g++-13
77+
sudo apt install -y g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
7178
7279
- name: Clone ACL
7380
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
7481
env:
7582
ACL_ACTION: clone
7683
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
77-
ACL_VERSION: v24.11.1
84+
ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }}
7885

7986
- name: Configure ACL
8087
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
@@ -85,7 +92,7 @@ jobs:
8592
BUILD_TOOLSET: ${{ matrix.config.toolset }}
8693
CMAKE_BUILD_TYPE: ${{ matrix.config.build }}
8794
CMAKE_GENERATOR: Ninja
88-
GCC_VERSION: 13
95+
GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
8996

9097
- name: Build ACL
9198
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
@@ -100,7 +107,7 @@ jobs:
100107
BUILD_TOOLSET: ${{ matrix.config.toolset }}
101108
CMAKE_BUILD_TYPE: ${{ matrix.config.build }}
102109
CMAKE_GENERATOR: Ninja
103-
GCC_VERSION: 13
110+
GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
104111
ONEDNN_ACTION: configure
105112
ONEDNN_TEST_SET: ${{ matrix.config.testset }}
106113
ONEDNN_THREADING: ${{ matrix.config.threading }}

0 commit comments

Comments
 (0)