Skip to content

Commit

Permalink
github: workflows: Enable ACL caching for macOS ci
Browse files Browse the repository at this point in the history
- Upgrade MacOS image to v15.
  • Loading branch information
theComputeKid committed Oct 13, 2024
1 parent 42be8d5 commit 567a495
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 13 deletions.
26 changes: 16 additions & 10 deletions .github/automation/build_acl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ fi
echo "Compiler version:"
$CC --version

set -x
git clone --branch $ACL_VERSION --depth 1 $ACL_REPO $ACL_ROOT_DIR

cd $ACL_ROOT_DIR

scons $MP Werror=0 debug=$ACL_DEBUG neon=1 opencl=0 embed_kernels=0 \
os=$ACL_OS arch=$ACL_ARCH build=native multi_isa=$ACL_MULTI_ISA_SUPPORT \
fixed_format_kernels=1 cppthreads=0 openmp=$ACL_OPENMP examples=0 \
validation_tests=0
set +x
if [[ "$ACL_ACTION" == "clone" ]]; then
set -x
git clone --branch $ACL_VERSION --depth 1 $ACL_REPO $ACL_ROOT_DIR
set +x
elif [[ "$ACL_ACTION" == "build" ]]; then
cd $ACL_ROOT_DIR
set -x
scons $MP Werror=0 debug=$ACL_DEBUG neon=1 opencl=0 embed_kernels=0 \
os=$ACL_OS arch=$ACL_ARCH build=native multi_isa=$ACL_MULTI_ISA_SUPPORT \
fixed_format_kernels=1 cppthreads=0 openmp=$ACL_OPENMP examples=0 \
validation_tests=0
set +x
else
echo "Unknown action: $ACL_ACTION"
exit 1
fi
41 changes: 38 additions & 3 deletions .github/workflows/ci-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ permissions: read-all
jobs:
macos:
name: macOS
runs-on: macos-14
runs-on: macos-15
strategy:
matrix:
toolset: [clang, gcc]
Expand All @@ -53,14 +53,49 @@ jobs:
with:
packages: scons

- name: Clone ACL
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
env:
ACL_ACTION: clone
ACL_CONFIG: ${{ matrix.config }}
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
BUILD_TOOLSET: ${{ matrix.toolset }}
GCC_VERSION: 14

- name: Get ACL commit hash for cache key
id: get_acl_commit_hash
run: (cd ${{ github.workspace }}/ComputeLibrary && echo "ACLCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT

- name: Get system name
id: get_system_name
run: (echo "SystemName=$(uname)") >> $GITHUB_OUTPUT

- name: Restore cached ACL
id: cache-acl-restore
uses: actions/cache/restore@v4
with:
# Key must have MacOS version to force rebuild when it is updated.
key: ${{ steps.get_system_name.outputs.SystemName }}-15-acl-${{ matrix.toolset }}-${{ matrix.config }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
path: ${{ github.workspace }}/ComputeLibrary/build

- name: Build ACL
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
env:
ACL_ACTION: build
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
BUILD_TOOLSET: ${{ matrix.toolset }}
ACL_CONFIG: ${{ matrix.config }}
GCC_VERSION: 14

- name: Save ACL in cache
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
id: cache-acl_build-save
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-acl-restore.outputs.cache-primary-key }}
path: ${{ github.workspace }}/ComputeLibrary/build

- name: Build oneDNN
run: ${{ github.workspace }}/oneDNN/.github/automation/build_aarch64.sh
working-directory: ${{ github.workspace }}/oneDNN
Expand All @@ -69,15 +104,15 @@ jobs:
BUILD_TOOLSET: ${{ matrix.toolset }}
CMAKE_BUILD_TYPE: ${{ matrix.config }}
GCC_VERSION: 14

- if: matrix.toolset == 'clang'
name: Run oneDNN smoke tests
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
working-directory: ${{ github.workspace }}/oneDNN/build
env:
CMAKE_BUILD_TYPE: ${{ matrix.config }}
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build

# We only run the linux aarch64 runners if macos smoke tests pass.
linux:
needs: macos
Expand Down

0 comments on commit 567a495

Please sign in to comment.