Skip to content

Commit 44c2c47

Browse files
committed
github: workflows: Enable ACL caching for macOS ci
1 parent 42be8d5 commit 44c2c47

File tree

2 files changed

+46
-23
lines changed

2 files changed

+46
-23
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

+30-13
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,47 @@ jobs:
5353
with:
5454
packages: scons
5555

56-
- name: Build ACL
56+
- name: Clone ACL
5757
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
5858
env:
59+
ACL_ACTION: clone
60+
ACL_CONFIG: ${{ matrix.config }}
5961
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
6062
BUILD_TOOLSET: ${{ matrix.toolset }}
61-
ACL_CONFIG: ${{ matrix.config }}
6263
GCC_VERSION: 14
6364

64-
- name: Build oneDNN
65-
run: ${{ github.workspace }}/oneDNN/.github/automation/build_aarch64.sh
66-
working-directory: ${{ github.workspace }}/oneDNN
65+
- name: Get ACL commit hash for cache key
66+
id: get_acl_commit_hash
67+
run: (cd ${{ github.workspace }}/ComputeLibrary && echo "ACLCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT
68+
69+
- name: Get system name
70+
id: get_system_name
71+
run: (echo "SystemName=$(uname)") >> $GITHUB_OUTPUT
72+
73+
- name: Restore cached ACL
74+
id: cache-acl-restore
75+
uses: actions/cache/restore@v4
76+
with:
77+
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.toolset }}-${{ matrix.config }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
78+
path: ${{ github.workspace }}/ComputeLibrary/build
79+
80+
- name: Build ACL
81+
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
82+
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
6783
env:
84+
ACL_ACTION: build
6885
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
6986
BUILD_TOOLSET: ${{ matrix.toolset }}
70-
CMAKE_BUILD_TYPE: ${{ matrix.config }}
87+
ACL_CONFIG: ${{ matrix.config }}
7188
GCC_VERSION: 14
7289

73-
- if: matrix.toolset == 'clang'
74-
name: Run oneDNN smoke tests
75-
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
76-
working-directory: ${{ github.workspace }}/oneDNN/build
77-
env:
78-
CMAKE_BUILD_TYPE: ${{ matrix.config }}
79-
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build
90+
- name: Save ACL in cache
91+
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
92+
id: cache-acl_build-save
93+
uses: actions/cache/save@v4
94+
with:
95+
key: ${{ steps.cache-acl-restore.outputs.cache-primary-key }}
96+
path: ${{ github.workspace }}/ComputeLibrary/build
8097

8198
# We only run the linux aarch64 runners if macos smoke tests pass.
8299
linux:

0 commit comments

Comments
 (0)