Skip to content

Commit

Permalink
github: workflows: Add initial linux aarch64 runners
Browse files Browse the repository at this point in the history
- Introduce cross-platform ci scripts.
- Add Arm hosted github runners.
- Add build/test for OMP and SEQ backends.

Signed-off-by: Hamza Butt <[email protected]>
Change-Id: I43484e94364f9b18978f45cba1d4be980c20abdf
  • Loading branch information
theComputeKid authored and Radu2k committed Dec 2, 2024
1 parent a477aef commit 4273854
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/automation/build_aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ cmake \
-DDNNL_AARCH64_USE_ACL=ON \
-DONEDNN_BUILD_GRAPH=0 \
-DDNNL_CPU_RUNTIME=$ONEDNN_THREADING \
-DONEDNN_WERROR=OFF \
-DONEDNN_WERROR=ON \
-DDNNL_BUILD_FOR_CI=ON \
-DONEDNN_TEST_SET=$ONEDNN_TEST_SET \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
Expand Down
142 changes: 89 additions & 53 deletions .github/workflows/ci-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,66 +35,27 @@ permissions: read-all

jobs:
macos:
name: macOS
runs-on: macos-14
strategy:
matrix:
compiler: [{ CC: clang, CXX: clang++ }, { CC: gcc-14, CXX: g++-14 }]
config:
[
{
CMAKE_BUILD_TYPE: Debug,
ACL_WITH_ASSERTS: '1',
IGNORED_TEST_FAILS: 'cpu-primitives-deconvolution-cpp|test_benchdnn_modeC_lnorm_smoke_cpu|test_benchdnn_modeC_brgemm_smoke_cpu'
},
{
CMAKE_BUILD_TYPE: Release,
ACL_WITH_ASSERTS: '0',
IGNORED_TEST_FAILS: 'cpu-primitives-deconvolution-cpp|test_benchdnn_modeC_lnorm_smoke_cpu'
}
]
name: macOS (${{ matrix.compiler.CC }}, ${{ matrix.config.CMAKE_BUILD_TYPE }})
toolset: [clang, gcc]
config: [Debug, Release]

steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@97ba232459a8e02ff6121db9362b09661c875ab8 # v2.0.0
id: cpu-cores
- name: Checkout oneDNN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: oneDNN
# ACL is built with clang, so we can link with it directly if we are using
# clang as well.
- if: matrix.compiler.CC == 'clang'
name: Download and Extract ACL
run: ${{ github.workspace }}/oneDNN/.github/automation/get_acl.sh
env:
ACL_WITH_ASSERTS: ${{ matrix.config.ACL_WITH_ASSERTS }}
ACL_VERSION: ${{ github.event.inputs.ACL_VERSION || 'v24.08.1' }}
# If we are building with gcc, we need to clone and build ACL ourselves to
# link properly.
- if: contains( matrix.compiler.CC , 'gcc' )
name: Install Scons

- name: Install Scons
uses: threeal/pipx-install-action@b0bf0add7d5aefda03a3d4e47d651df807889e10 # v1.0.0
with:
packages: scons
- if: contains( matrix.compiler.CC , 'gcc' )
name: Checkout ACL
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: ARM-software/ComputeLibrary
ref: 'v24.08.1'
path: ComputeLibrary
- if: contains( matrix.compiler.CC , 'gcc' )
name: Build ACL
working-directory: ${{ github.workspace }}/ComputeLibrary
run: scons Werror=1 -j${{ steps.cpu-cores.outputs.count }} neon=1 opencl=0 os=macos arch=armv8.2-a build=native cppthreads=0 openmp=0 examples=0 validation_tests=0
env:
CC: ${{ matrix.compiler.CC }}
CXX: ${{ matrix.compiler.CXX }}
- name: Configure oneDNN
run: cmake -B${{ github.workspace }}/oneDNN/build -S${{ github.workspace }}/oneDNN -DDNNL_AARCH64_USE_ACL=ON -DONEDNN_BUILD_GRAPH=0 -DONEDNN_WERROR=ON -DDNNL_BUILD_FOR_CI=ON -DONEDNN_TEST_SET=SMOKE -DCMAKE_BUILD_TYPE=${{ matrix.config.CMAKE_BUILD_TYPE }}
working-directory: ${{ github.workspace }}/oneDNN

- name: Build ACL
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
env:
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/lib
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
BUILD_TOOLSET: ${{ matrix.toolset }}
ACL_CONFIG: ${{ matrix.config }}
Expand All @@ -105,11 +66,86 @@ jobs:
working-directory: ${{ github.workspace }}/oneDNN
env:
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
# Only run smoke tests for clang. We only test gcc for build.
# Failure list currently depends on config. Exclude current failures.
- if: matrix.compiler.CC == 'clang'
BUILD_TOOLSET: ${{ matrix.toolset }}
CMAKE_BUILD_TYPE: ${{ matrix.config }}
GCC_VERSION: 14

- if: matrix.toolset == 'clang'
name: Run oneDNN smoke tests
run: ctest --test-dir ${{ github.workspace }}/oneDNN/build -j${{ steps.cpu-cores.outputs.count }} -E '${{ matrix.config.IGNORED_TEST_FAILS }}'
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
strategy:
matrix:
threading: [OMP]
toolset: [clang, gcc]
config: [Debug, Release]
host: [
{ name: c6g, label: ah-ubuntu_22_04-c6g_2x-50 },
{ name: c7g, label: ah-ubuntu_22_04-c7g_2x-50 }
]

name: ${{ matrix.host.name }}, ${{ matrix.toolset }}, ${{ matrix.threading }}, ${{ matrix.config }}
runs-on: ${{ matrix.host.label }}
steps:
- name: Checkout oneDNN
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: oneDNN

- name: Install dev tools
run: |
sudo apt update -y
sudo apt install -y scons cmake make
- if: matrix.threading == 'OMP'
name: Install openmp
run: |
sudo apt install -y libomp-dev
- if: matrix.toolset == 'gcc'
name: Install gcc
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update -y
sudo apt install -y g++-13
- if: matrix.toolset == 'clang'
name: Install clang
uses: KyleMayes/install-llvm-action@e0a8dc9cb8a22e8a7696e8a91a4e9581bec13181
with:
version: "17"

- name: Build ACL
run: ${{ github.workspace }}/oneDNN/.github/automation/build_acl.sh
env:
ACL_CONFIG: ${{ matrix.config }}
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
BUILD_TOOLSET: ${{ matrix.toolset }}
GCC_VERSION: 13
ACL_THREADING: ${{ matrix.threading }}

- name: Build oneDNN
run: ${{ github.workspace }}/oneDNN/.github/automation/build_aarch64.sh
working-directory: ${{ github.workspace }}/oneDNN
env:
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/lib
ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary
BUILD_TOOLSET: ${{ matrix.toolset }}
CMAKE_BUILD_TYPE: ${{ matrix.config }}
GCC_VERSION: 13
ONEDNN_THREADING: ${{ matrix.threading }}

- name: Run oneDNN tests
run: ${{ github.workspace }}/oneDNN/.github/automation/test_aarch64.sh
working-directory: ${{ github.workspace }}/oneDNN/build
env:
BUILD_TOOLSET: ${{ matrix.toolset }}
CMAKE_BUILD_TYPE: ${{ matrix.config }}
DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build
ONEDNN_THREADING: ${{ matrix.threading }}

0 comments on commit 4273854

Please sign in to comment.