Skip to content
Draft
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
106 changes: 106 additions & 0 deletions .github/actions/build-acl-aarch64/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# *******************************************************************************
# Copyright 2025 Arm Limited and affiliates.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# *******************************************************************************

name: "Build ACL"
description: "Build and cache ACL"

inputs:
onednn_path:
description: oneDNN repository path. Default ./oneDNN.
default: ./oneDNN
required: false
acl_path:
description: ACL repository path. Default ./ComputeLibrary.
default: ./ComputeLibrary
required: false
toolset:
description: Compiler to use. gcc or clang.
required: true
build:
description: Build type. Release, RelWithAssert or Debug.
required: true
threading:
description: Threading type. OMP or Sequential.
required: true
acl_hash:
description: ACL hash to build.
required: true
gcc_version:
description: GCC Version.
required: true

# Cache is built sequentially to avoid cache-hit race conditions
runs:
using: "composite"

steps:
- name: Clone ACL
run: ${{ inputs.onednn_path }}/.github/automation/aarch64/build_acl.sh
shell: bash
env:
ACL_ACTION: clone
ACL_ROOT_DIR: ${{ inputs.acl_path }}
ACL_VERSION: ${{ inputs.acl_hash }}

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

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

- name: Restore cached ACL
id: cache-acl-restore
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ inputs.toolset }}-${{ inputs.build }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
path: ${{ inputs.acl_path }}/build

- name: Install Scons (MacOS)
if: ${{ (steps.get_system_name.outputs.SystemName == 'Darwin') && (steps.cache-acl-restore.outputs.cache-hit != 'true') }}
shell: bash
run: brew install scons

- name: Install scons (Linux)
if: ${{ (steps.get_system_name.outputs.SystemName == 'Linux') && (steps.cache-acl-restore.outputs.cache-hit != 'true') }}
shell: bash
run: |
sudo apt update -y
sudo apt install -y scons

- name: Build ACL
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
shell: bash
run: ${{ inputs.onednn_path }}/.github/automation/aarch64/build_acl.sh
env:
ACL_ACTION: build
ACL_ROOT_DIR: ${{ inputs.acl_path }}
ACL_THREADING: ${{ inputs.threading }}
BUILD_TOOLSET: ${{ inputs.toolset }}
ACL_BUILD_TYPE: ${{ inputs.build }}
GCC_VERSION: ${{ inputs.gcc_version }}

- name: Save ACL in cache
id: cache-acl_build-save
if: ${{ steps.cache-acl-restore.outputs.cache-hit != 'true' }}
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ inputs.toolset }}-${{ inputs.build }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }}
path: ${{ inputs.acl_path }}/build
178 changes: 178 additions & 0 deletions .github/actions/build-onednn-aarch64/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# *******************************************************************************
# Copyright 2025 Arm Limited and affiliates.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# *******************************************************************************

name: "Build oneDNN AArch64"
description: "Build oneDNN"

inputs:
artifact_name:
required: false
description: Name of the artifact to upload to. Leave empty to not upload an artifact.
threading:
required: true
description: OMP or SEQ.
toolset:
required: true
description: gcc or clang
build:
required: true
description: Cmake build type. Release, RelWithAssert or Debug.
testset:
required: true
description: SMOKE, CI or NIGHTLY.
onednn_hash:
required: false
description: oneDNN commit to check out.
acl_hash:
required: false
description: ACL hash to checkout.
cache:
required: false
description: Whether to cache the built oneDNN or not.

runs:
using: 'composite'
steps:
- name: Checkout oneDNN
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
path: oneDNN

- name: Read version file
shell: bash
id: get-versions
run: |
content=`cat ${{ github.workspace }}/oneDNN/.github/automation/aarch64/ci.json`
content="${content//[$'\t\r\n$ ']}"
echo "output=$content" >> $GITHUB_OUTPUT

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

# Note: This will create a github actions cache
- name: Get latest CMake and Ninja
uses: lukka/get-cmake@56d043d188c3612951d8755da8f4b709ec951ad6 # v3.31.6
with:
cmakeVersion: 3.31.0
ninjaVersion: 1.12.0

- if: ${{ (steps.get_system_name.outputs.SystemName == 'Linux') && (inputs.threading == 'OMP') }}
name: Install openmp
shell: bash
run: sudo apt install -y libomp-dev

- if: ${{ (steps.get_system_name.outputs.SystemName == 'Linux') && (inputs.toolset == 'gcc') }}
name: Install gcc
shell: bash
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update -y
sudo apt install -y g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}

- if: ${{ (steps.get_system_name.outputs.SystemName == 'Linux') && (inputs.toolset == 'clang') }}
name: Install clang
uses: KyleMayes/install-llvm-action@98e68e10c96dffcb7bfed8b2144541a66b49aa02 # v2.0.8
with:
version: ${{ fromJson(steps.get-versions.outputs.output).dependencies.clang }}

- name: Build ComputeLibrary
uses: ./oneDNN/.github/actions/build-acl-aarch64
with:
toolset: ${{ inputs.toolset }}
build: ${{ inputs.build }}
threading: ${{ inputs.threading }}
acl_hash: ${{ inputs.acl_hash || fromJson(steps.get-versions.outputs.output).dependencies.acl }}
gcc_version: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}

- name: Setup Package
shell: bash
run: |
mkdir -p oneDNN_pkg/oneDNN
mv ComputeLibrary oneDNN_pkg
ls oneDNN_pkg

- name: Checkout oneDNN to build
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
path: oneDNN_build
fetch-depth: 0

- name: Checkout specified oneDNN
if: ${{ inputs.onednn_hash != '' }}
working-directory: oneDNN_build
shell: bash
run: git checkout ${{ inputs.onednn_hash }}

- name: Get oneDNN commit hash for cache key
id: get_oneDNN_commit_hash
shell: bash
run: (cd oneDNN_build && echo "oneDNNCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT

- name: Restore cached oneDNN
id: cache-onednn-restore
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ inputs.acl_hash || fromJson(steps.get-versions.outputs.output).dependencies.acl }}-onednn-${{ steps.get_onednn_commit_hash.outputs.oneDNNCommitHash }}-${{ inputs.toolset }}-${{ inputs.build }}
path: ${{ github.workspace }}/oneDNN_pkg

- name: Configure oneDNN
if: ${{ steps.cache-onednn-restore.outputs.cache-hit != 'true'}}
shell: bash
run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh
working-directory: ${{ github.workspace }}/oneDNN_build
env:
ACL_ROOT_DIR: ${{ github.workspace }}/oneDNN_pkg/ComputeLibrary
BUILD_TOOLSET: ${{ inputs.toolset }}
CMAKE_BUILD_TYPE: ${{ inputs.build }}
CMAKE_GENERATOR: Ninja
GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }}
ONEDNN_ACTION: configure
ONEDNN_TEST_SET: ${{ inputs.testset }}
ONEDNN_THREADING: ${{ inputs.threading }}

- name: Build oneDNN
if: ${{ steps.cache-onednn-restore.outputs.cache-hit != 'true'}}
shell: bash
run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh
working-directory: ${{ github.workspace }}/oneDNN_build
env:
ONEDNN_ACTION: build
ACL_ROOT_DIR: oneDNN_pkg/ComputeLibrary

- name: Package oneDNN & ComputeLibrary
if: ${{ steps.cache-onednn-restore.outputs.cache-hit != 'true'}}
shell: bash
run: mv oneDNN_build/build oneDNN_pkg/oneDNN/build

- name: Cache oneDNN
if: ${{ inputs.cache == 'true' && steps.cache-onednn-restore.outputs.cache-hit != 'true' }}
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ inputs.acl_hash || fromJson(steps.get-versions.outputs.output).dependencies.acl }}-onednn-${{ steps.get_onednn_commit_hash.outputs.oneDNNCommitHash }}-${{ inputs.toolset }}-${{ inputs.build }}
path: ${{ github.workspace }}/oneDNN_pkg

- name: Upload artifact
if: ${{ inputs.artifact_name != '' }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact_name }}
path: ${{ github.workspace }}/oneDNN_pkg
if-no-files-found: error
include-hidden-files: true
retention-days: 1
15 changes: 11 additions & 4 deletions .github/automation/aarch64/bisect_ctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,29 @@ def main():
)
args_parser.add_argument("good", nargs="?", help="good hash")
args_parser.add_argument("file", nargs="?", help="input file")
args_parser.add_argument(
"build", nargs="?", default="build", help="build directory"
)
args_parser.add_argument(
"--unique",
action="store_true",
help="whether to return only one test case per unique op",
)
args = args_parser.parse_args()

if args.good is None:
raise Exception("Good hash cannot be empty")
if args.file is None:
raise Exception("File argument cannot be empty")

cases = ctest_utils.failed_benchdnn_tests(args.file, args.unique)

results_dict = {}
for case in cases:
bisect_cmd = str(F_PATH / f"git_bisect.sh")
build_dir = str(F_PATH.parent.parent.parent / "build")
build_dir = str(args.build)
result = subprocess.run(
args=[
f'bash {bisect_cmd} {args.good} HEAD {build_dir} "{case}"'
],
args=[f'bash {bisect_cmd} {args.good} HEAD {build_dir} "{case}"'],
shell=True,
capture_output=True,
)
Expand Down
6 changes: 4 additions & 2 deletions .github/automation/aarch64/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ if [[ "$ONEDNN_ACTION" == "configure" ]]; then
-DONEDNN_WERROR=ON \
-DDNNL_BUILD_FOR_CI=ON \
-DONEDNN_TEST_SET=$ONEDNN_TEST_SET \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_SKIP_BUILD_RPATH=FALSE \
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON
set +x
fi
elif [[ "$ONEDNN_ACTION" == "build" ]]; then
set -x
cmake --build build
cmake --build build -j"$(nproc)"
set +x
else
echo "Unknown action: $ONEDNN_ACTION"
Expand Down
4 changes: 3 additions & 1 deletion .github/automation/aarch64/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
set -o errexit -o pipefail -o noclobber

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
OUTPUT_XML=$1
OUTPUT_LOG=$2

# Defines MP, CC, CXX and OS.
source ${SCRIPT_DIR}/common.sh
Expand All @@ -32,5 +34,5 @@ if [[ "$ONEDNN_THREADING" == "SEQ" ]]; then
fi

set -x
ctest --no-tests=error --output-on-failure -E $("${SCRIPT_DIR}"/skipped-tests.sh) --output-junit $1
ctest --no-tests=error --output-on-failure -E $("${SCRIPT_DIR}"/skipped-tests.sh) --output-junit ${OUTPUT_XML} | tee ${OUTPUT_LOG}
set +x
6 changes: 6 additions & 0 deletions .github/automation/performance/inputs/conv_nightly
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@
--dir=FWD_D,FWD_B
--attr-fpmath=,bf16
--batch=shapes_resnet_50

--reset
--dt=bf16,f32
--batch=shapes_regression_1x1
--batch=shapes_regression_dw
--batch=shapes_regression_gemm
Loading
Loading