Skip to content

Commit 81e2696

Browse files
committed
github: workflows: Enable ACL caching for aarch64 ci
- Downgrade GCC to v13 on Mac to fix warnings. - Help improve ci throughput significantly.
1 parent ad55afa commit 81e2696

File tree

2 files changed

+93
-19
lines changed

2 files changed

+93
-19
lines changed

.github/automation/build_acl.sh

+16-10
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,19 @@ fi
6161
echo "Compiler version:"
6262
$CC --version
6363

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
64+
if [[ "$ACL_ACTION" == "clone" ]]; then
65+
set -x
66+
git clone --branch $ACL_VERSION --depth 1 $ACL_REPO $ACL_ROOT_DIR
67+
set +x
68+
elif [[ "$ACL_ACTION" == "build" ]]; then
69+
cd $ACL_ROOT_DIR
70+
set -x
71+
scons $MP Werror=0 debug=$ACL_DEBUG neon=1 opencl=0 embed_kernels=0 \
72+
os=$ACL_OS arch=$ACL_ARCH build=native multi_isa=$ACL_MULTI_ISA_SUPPORT \
73+
fixed_format_kernels=1 cppthreads=0 openmp=$ACL_OPENMP examples=0 \
74+
validation_tests=0
75+
set +x
76+
else
77+
echo "Unknown action: $ACL_ACTION"
78+
exit 1
79+
fi

.github/workflows/ci-aarch64.yml

+77-9
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ on:
2424
pull_request:
2525
types: [opened, synchronize, reopened]
2626

27+
# TODO: Fix job cancellation.
2728
#* Stop stale workflows when pull requests are updated: https://stackoverflow.com/a/70972844
2829
#* Does not apply to the main branch.
29-
concurrency:
30-
group: ${{ github.ref }}
31-
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
30+
# concurrency:
31+
# group: ${{ github.ref }}
32+
# cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
3233

3334
# Declare default permissions as read only.
3435
permissions: read-all
@@ -53,13 +54,47 @@ jobs:
5354
with:
5455
packages: scons
5556

57+
- name: Clone ACL
58+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
59+
env:
60+
ACL_ACTION: clone
61+
ACL_CONFIG: ${{ matrix.config }}
62+
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
63+
BUILD_TOOLSET: ${{ matrix.toolset }}
64+
GCC_VERSION: 13
65+
66+
- name: Get ACL commit hash for cache key
67+
id: get_acl_commit_hash
68+
run: (cd ${{ github.workspace }}/ComputeLibrary && echo "ACLCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT
69+
70+
- name: Get system name
71+
id: get_system_name
72+
run: (echo "SystemName=$(uname)") >> $GITHUB_OUTPUT
73+
74+
- name: Restore cached ACL
75+
id: cache-acl-restore
76+
uses: actions/cache/restore@v4
77+
with:
78+
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.toolset }}-${{ matrix.config }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
79+
path: ${{ github.workspace }}/ComputeLibrary/build
80+
5681
- name: Build ACL
82+
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
5783
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
5884
env:
85+
ACL_ACTION: build
5986
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
6087
BUILD_TOOLSET: ${{ matrix.toolset }}
6188
ACL_CONFIG: ${{ matrix.config }}
62-
GCC_VERSION: 14
89+
GCC_VERSION: 13
90+
91+
- name: Save ACL in cache
92+
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
93+
id: cache-acl_build-save
94+
uses: actions/cache/save@v4
95+
with:
96+
key: ${{ steps.cache-acl-restore.outputs.cache-primary-key }}
97+
path: ${{ github.workspace }}/ComputeLibrary/build
6398

6499
- name: Build oneDNN
65100
run: ${{ github.workspace }}/oneDNN/.github/automation/build_aarch64.sh
@@ -68,16 +103,16 @@ jobs:
68103
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
69104
BUILD_TOOLSET: ${{ matrix.toolset }}
70105
CMAKE_BUILD_TYPE: ${{ matrix.config }}
71-
GCC_VERSION: 14
72-
106+
GCC_VERSION: 13
107+
73108
- if: matrix.toolset == 'clang'
74109
name: Run oneDNN smoke tests
75110
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
76111
working-directory: ${{ github.workspace }}/oneDNN/build
77112
env:
78113
CMAKE_BUILD_TYPE: ${{ matrix.config }}
79114
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build
80-
115+
81116
# We only run the linux aarch64 runners if macos smoke tests pass.
82117
linux:
83118
needs: macos
@@ -122,14 +157,47 @@ jobs:
122157
with:
123158
version: "17"
124159

125-
- name: Build ACL
160+
- name: Clone ACL
126161
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
127162
env:
163+
ACL_ACTION: clone
128164
ACL_CONFIG: ${{ matrix.config }}
129165
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
130166
BUILD_TOOLSET: ${{ matrix.toolset }}
131167
GCC_VERSION: 13
132-
ACL_THREADING: ${{ matrix.threading }}
168+
169+
- name: Get ACL commit hash for cache key
170+
id: get_acl_commit_hash
171+
run: (cd ${{ github.workspace }}/ComputeLibrary && echo "ACLCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT
172+
173+
- name: Get system name
174+
id: get_system_name
175+
run: (echo "SystemName=$(uname)") >> $GITHUB_OUTPUT
176+
177+
- name: Restore cached ACL
178+
id: cache-acl-restore
179+
uses: actions/cache/restore@v4
180+
with:
181+
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.toolset }}-${{ matrix.config }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
182+
path: ${{ github.workspace }}/ComputeLibrary/build
183+
184+
- name: Build ACL
185+
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
186+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
187+
env:
188+
ACL_ACTION: build
189+
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
190+
BUILD_TOOLSET: ${{ matrix.toolset }}
191+
ACL_CONFIG: ${{ matrix.config }}
192+
GCC_VERSION: 13
193+
194+
- name: Save ACL in cache
195+
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
196+
id: cache-acl_build-save
197+
uses: actions/cache/save@v4
198+
with:
199+
key: ${{ steps.cache-acl-restore.outputs.cache-primary-key }}
200+
path: ${{ github.workspace }}/ComputeLibrary/build
133201

134202
- name: Build oneDNN
135203
run: ${{ github.workspace }}/oneDNN/.github/automation/build_aarch64.sh

0 commit comments

Comments
 (0)