Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github: workflows: Enable ACL caching for aarch64 ci #2160

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
85 changes: 77 additions & 8 deletions .github/workflows/ci-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ on:
pull_request:
types: [opened, synchronize, reopened]

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

# Declare default permissions as read only.
permissions: read-all
Expand All @@ -53,13 +54,47 @@ 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: 13

- 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: ${{ steps.get_system_name.outputs.SystemName }}-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
GCC_VERSION: 13

- 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
Expand All @@ -68,16 +103,16 @@ jobs:
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
BUILD_TOOLSET: ${{ matrix.toolset }}
CMAKE_BUILD_TYPE: ${{ matrix.config }}
GCC_VERSION: 14

GCC_VERSION: 13
- 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 Expand Up @@ -122,15 +157,49 @@ jobs:
with:
version: "17"

- name: Build ACL
- 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: 13

- 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: ${{ steps.get_system_name.outputs.SystemName }}-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: 13
ACL_THREADING: ${{ matrix.threading }}

- 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 Down
Loading