Skip to content

Commit cf939c4

Browse files
committed
ci: Build acl cache sequentially
1 parent ff65080 commit cf939c4

File tree

4 files changed

+162
-38
lines changed

4 files changed

+162
-38
lines changed

.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

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
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+
pull_request:
28+
types: [opened, synchronize, reopened]
29+
paths:
30+
- '.github/ci-aarch64.json'
31+
workflow_dispatch:
32+
33+
#* Stop stale workflows when pull requests are updated: https://stackoverflow.com/a/70972844
34+
#* Does not apply to the main branch.
35+
concurrency:
36+
group: ${{ github.workflow }}-${{ github.ref }}
37+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
38+
39+
# Declare default permissions as read only.
40+
permissions: read-all
41+
42+
jobs:
43+
# Cache is built sequentially to avoid cache-hit race conditions
44+
build-cache:
45+
strategy:
46+
matrix:
47+
config: [
48+
{ name: MacOS, label: macos-14, threading: SEQ, toolset: clang, build: Release, testset: SMOKE },
49+
{ name: c6g, label: ah-ubuntu_22_04-c6g_2x-50, threading: OMP, toolset: clang, build: Debug, testset: SMOKE },
50+
{ name: c7g, label: ah-ubuntu_22_04-c7g_4x-50, threading: OMP, toolset: gcc, build: Release, testset: CI }
51+
]
52+
53+
name: ${{ matrix.config.name }}, ${{ matrix.config.toolset }}, ${{ matrix.config.threading }}, ${{ matrix.config.build }}
54+
runs-on: ${{ matrix.config.label }}
55+
steps:
56+
57+
- name: Checkout oneDNN
58+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
59+
with:
60+
path: oneDNN
61+
62+
- name: Get latest CMake and Ninja
63+
uses: lukka/get-cmake@acb35cf920333f4dc3fc4f424f1b30d5e7d561b4 # v3.31.4
64+
with:
65+
cmakeVersion: 3.31.0
66+
ninjaVersion: 1.12.0
67+
68+
- name: Read version file
69+
id: get-versions
70+
run: |
71+
content=`cat ${{ github.workspace }}/oneDNN/.github/ci-aarch64.json`
72+
content="${content//[$'\t\r\n$ ']}"
73+
echo "output=$content" >> $GITHUB_OUTPUT
74+
75+
- if: ${{ (startsWith(matrix.config.label,'ah-ubuntu') && (matrix.config.threading == 'OMP')) }}
76+
name: Install openmp
77+
run: |
78+
sudo apt install -y libomp-dev
79+
80+
- if: ${{ (startsWith(matrix.config.label,'ah-ubuntu') && (matrix.config.toolset == 'gcc')) }}
81+
name: Install gcc
82+
run: |
83+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
84+
sudo apt update -y
85+
sudo apt install -y g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
86+
87+
- if: ${{ (startsWith(matrix.config.label,'ah-ubuntu') && (matrix.config.toolset == 'clang')) }}
88+
name: Install clang
89+
uses: KyleMayes/install-llvm-action@e0a8dc9cb8a22e8a7696e8a91a4e9581bec13181
90+
with:
91+
version: ${{ fromJson(steps.get-versions.outputs.output).dependencies.clang }}
92+
93+
- name: Clone ACL
94+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
95+
env:
96+
ACL_ACTION: clone
97+
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
98+
ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }}
99+
100+
- name: Get ACL commit hash for cache key
101+
id: get_acl_commit_hash
102+
run: (cd ${{ github.workspace }}/ComputeLibrary && echo "ACLCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT
103+
104+
- name: Configure ACL
105+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
106+
env:
107+
ACL_ACTION: configure
108+
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
109+
ACL_THREADING: ${{ matrix.config.threading }}
110+
BUILD_TOOLSET: ${{ matrix.config.toolset }}
111+
CMAKE_BUILD_TYPE: ${{ matrix.config.build }}
112+
CMAKE_GENERATOR: Ninja
113+
GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
114+
115+
- name: Build ACL
116+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
117+
env:
118+
ACL_ACTION: build
119+
120+
- name: Get system name
121+
id: get_system_name
122+
run: (echo "SystemName=$(uname)") >> $GITHUB_OUTPUT
123+
124+
- name: Save ACL in cache
125+
id: cache-acl_build-save
126+
uses: actions/cache/save@v4
127+
with:
128+
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.config.toolset }}-${{ matrix.config.build }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
129+
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@8567b9d9b63052b8430ef30042e13c3ba5288f16 # v3.31.3
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)