diff --git a/.github/automation/aarch64/ci.json b/.github/automation/aarch64/ci.json index 7908e41fd41..bdd44eaed7c 100644 --- a/.github/automation/aarch64/ci.json +++ b/.github/automation/aarch64/ci.json @@ -2,6 +2,7 @@ "dependencies": { "acl": "v25.02", "gcc": "13", - "clang": "17" + "clang": "17", + "onednn-base": "v3.7" } -} \ No newline at end of file +} diff --git a/.github/automation/performance/bench_nightly_performance.sh b/.github/automation/performance/bench_nightly_performance.sh new file mode 100644 index 00000000000..9b66f0a7c01 --- /dev/null +++ b/.github/automation/performance/bench_nightly_performance.sh @@ -0,0 +1,53 @@ +#! /bin/bash + +# ******************************************************************************* +# 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. +# ******************************************************************************* + +# Usage: bash bench_nightly_performance.sh {baseline_benchdnn_executable} {benchdnn_executable} {baseline_results_file} {new_results_file} + +IFS=$'\n' # Prevents shuffling from using spaces as delimiters + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +TESTS=( + "$1 --matmul --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/matmul_nightly >> $3" + "$2 --matmul --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/matmul_nightly >> $4" + "$1 --conv --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/conv_nightly >> $3" + "$2 --conv --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/conv_nightly >> $4" + "$1 --eltwise --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/eltwise_nightly >> $3" + "$2 --eltwise --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/eltwise_nightly >> $4" + "$1 --reorder --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/reorder_nightly >> $3" + "$2 --reorder --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/reorder_nightly >> $4" + ) + +N=5 + +for i in $( seq $N ) +do + echo "Testing loop ${i} / ${N}..." + + TESTS=( $(shuf -e "${TESTS[@]}") ) + + for test in "${TESTS[@]}" + do + echo "Starting ${test}" + SECONDS=0 + eval $test + duration=$SECONDS + echo "Completed in $((duration / 60)):$((duration % 60))" + done +done diff --git a/.github/automation/performance/bench_performance.sh b/.github/automation/performance/bench_performance.sh deleted file mode 100755 index 2551991aec6..00000000000 --- a/.github/automation/performance/bench_performance.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/bash - -# ******************************************************************************* -# 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. -# ******************************************************************************* - -# Usage: bash bench_performance.sh {baseline_benchdnn_executable} {benchdnn_executable} {baseline_results_file} {new_results_file} - -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) - -for i in {1..5} -do - $1 --matmul --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/matmul >> $3 - $2 --matmul --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/matmul >> $4 - $1 --conv --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/conv >> $3 - $2 --conv --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/conv >> $4 - $1 --eltwise --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/eltwise >> $3 - $2 --eltwise --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/eltwise >> $4 -done diff --git a/.github/automation/performance/bench_pr_performance.sh b/.github/automation/performance/bench_pr_performance.sh new file mode 100755 index 00000000000..48f0eebd643 --- /dev/null +++ b/.github/automation/performance/bench_pr_performance.sh @@ -0,0 +1,52 @@ +#! /bin/bash + +# ******************************************************************************* +# 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. +# ******************************************************************************* + +# Usage: bash bench_pr_performance.sh {baseline_benchdnn_executable} {benchdnn_executable} {baseline_results_file} {new_results_file} + +IFS=$'\n' # Prevents shuffling from using spaces as delimiters +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +TESTS=( + "$1 --matmul --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/matmul >> $3" + "$2 --matmul --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/matmul >> $4" + "$1 --conv --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/conv >> $3" + "$2 --conv --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/conv >> $4" + "$1 --eltwise --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/eltwise >> $3" + "$2 --eltwise --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/eltwise >> $4" + "$1 --reorder --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/reorder >> $3" + "$2 --reorder --mode=P --perf-template=%prb%,%-time% --batch=${SCRIPT_DIR}/inputs/reorder >> $4" + ) + +N=5 + +for i in $( seq $N ) +do + echo "Testing loop ${i} / ${N}..." + + TESTS=( $(shuf -e "${TESTS[@]}") ) + + for test in "${TESTS[@]}" + do + echo "Starting ${test}" + SECONDS=0 + eval $test + duration=$SECONDS + echo "Completed in $((duration / 60)):$((duration % 60))" + done +done diff --git a/.github/automation/performance/benchdnn_comparison.py b/.github/automation/performance/benchdnn_comparison.py index 71326076dac..1dba59e4e4b 100644 --- a/.github/automation/performance/benchdnn_comparison.py +++ b/.github/automation/performance/benchdnn_comparison.py @@ -21,6 +21,8 @@ import os from collections import defaultdict from scipy.stats import ttest_ind +import warnings +import statistics def compare_two_benchdnn(file1, file2, tolerance=0.05): @@ -38,9 +40,9 @@ def compare_two_benchdnn(file1, file2, tolerance=0.05): r2 = [x.split(",") for x in r2 if x[0:8] == "--mode=P"] if (len(r1) == 0) or (len(r2) == 0): - raise Exception("One or both of the test results have zero lines") + warnings.warn("One or both of the test results have zero lines") if len(r1) != len(r2): - raise Exception("The number of benchdnn runs do not match") + warnings.warn("The number of benchdnn runs do not match") r1_samples = defaultdict(list) r2_samples = defaultdict(list) @@ -50,26 +52,37 @@ def compare_two_benchdnn(file1, file2, tolerance=0.05): for k, v in r2: r2_samples[k].append(float(v[:-1])) - passed = True failed_tests = [] + times = {} for prb, r1_times in r1_samples.items(): if prb not in r2_samples: - raise Exception(f"{prb} exists in {file1} but not {file2}") + warnings.warn(f"{prb} exists in {file1} but not {file2}") + continue + r2_times = r2_samples[prb] res = ttest_ind(r2_times, r1_times, alternative='greater') - - if res.pvalue < 0.05: - failed_tests.append(prb) + r1_med = statistics.median(r1_times) + r2_med = statistics.median(r2_times) + times[prb] = (r1_med, r2_med) + times_str = f" {times[prb][0]} vs {times[prb][1]}" + + # pass the test if: + # the t-test passes (i.e. pvalue > 0.05) OR + # both the median time and min time has not + # slowed down by more than 10% + passed = res.pvalue > 0.05 or \ + ((r2_med - r1_med) / r1_med < 0.1 and \ + (min(r2_times) - min(r1_times)) / min(r1_times) < 0.1) + if not passed: + failed_tests.append(prb + times_str) passed = False - print(prb + (" passed" if passed else " failed")) - if "GITHUB_OUTPUT" in os.environ: with open(os.environ["GITHUB_OUTPUT"], "a") as f: - print(f"pass={passed}", file=f) + print(f"pass={not failed_tests}", file=f) - if passed: + if not failed_tests: print("Regression tests passed") else: message = "\n----The following regression tests failed:----\n" + \ diff --git a/.github/automation/performance/inputs/conv b/.github/automation/performance/inputs/conv index 85f8016d90e..554fb596465 100644 --- a/.github/automation/performance/inputs/conv +++ b/.github/automation/performance/inputs/conv @@ -15,8 +15,13 @@ # limitations under the License. # ******************************************************************************* -# From Resnet --reset --dir=FWD_D ---dt=bf16,f32 +--dt=f32 +mb1_ic64oc256_ih200oh200kh1sh1dh0ph0_iw267ow267kw1sw1dw0pw0 + +--reset +--dir=FWD_D +--dt=f32 +--attr-fpmath=bf16 mb1_ic64oc256_ih200oh200kh1sh1dh0ph0_iw267ow267kw1sw1dw0pw0 diff --git a/.github/automation/performance/inputs/conv_nightly b/.github/automation/performance/inputs/conv_nightly new file mode 100644 index 00000000000..04699bee0e5 --- /dev/null +++ b/.github/automation/performance/inputs/conv_nightly @@ -0,0 +1,25 @@ +# ******************************************************************************* +# 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. +# ******************************************************************************* +--reset +--batch=conv + +--reset +--dt=f32 +--alg=auto +--dir=FWD_D,FWD_B +--attr-fpmath=,bf16 +--batch=shapes_resnet_50 diff --git a/.github/automation/performance/inputs/eltwise b/.github/automation/performance/inputs/eltwise index 6f2afde5fce..35935ce2629 100644 --- a/.github/automation/performance/inputs/eltwise +++ b/.github/automation/performance/inputs/eltwise @@ -18,6 +18,6 @@ --inplace=true --alg=gelu_erf --dir=FWD_D ---dt=bf16 +--dt=f32,bf16 --tag=abc -1x1x1536 +1536x384 diff --git a/.github/automation/performance/inputs/eltwise_nightly b/.github/automation/performance/inputs/eltwise_nightly new file mode 100644 index 00000000000..801ff66a3ba --- /dev/null +++ b/.github/automation/performance/inputs/eltwise_nightly @@ -0,0 +1,41 @@ +# ******************************************************************************* +# 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. +# ******************************************************************************* + +--reset +--batch=eltwise + +--reset + +--dt=f32 +--tag=abx,axb +--dir=FWD_D +--attr-post-ops=, + +## algs which do not support alpha and beta + relu with alpha=0 +--alpha=0 --beta=0 +--alg=exp,exp_dst,gelu_erf,gelu_tanh,relu_dst,tanh,tanh_dst +384x384 + +## algs which support negative alpha +--alpha=-2 --beta=0 +--alg=elu,relu,swish +384x384 + +## algs which support alpha and beta +--alpha=-2 --beta=3 +--alg=linear +384x384 diff --git a/.github/automation/performance/inputs/matmul b/.github/automation/performance/inputs/matmul index 4809690dc16..f9deaac91f0 100644 --- a/.github/automation/performance/inputs/matmul +++ b/.github/automation/performance/inputs/matmul @@ -17,7 +17,16 @@ --reset --stag=ab --wtag=any +--dtag=ab --attr-post-ops=sum +--dt=f32 +1500x1536:1536x384 + +--reset +--stag=ab +--wtag=any --dtag=ab ---dt=f32,bf16 +--attr-post-ops=sum +--attr-fpmath=bf16 +--dt=f32 1500x1536:1536x384 diff --git a/.github/automation/performance/inputs/matmul_nightly b/.github/automation/performance/inputs/matmul_nightly new file mode 100644 index 00000000000..9a37d97c7ec --- /dev/null +++ b/.github/automation/performance/inputs/matmul_nightly @@ -0,0 +1,43 @@ +# ******************************************************************************* +# 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. +# ******************************************************************************* +--reset +--batch=matmul + +# Plain cases +--reset +--dt=f32,s8:s8:f32 +--bia-dt=f32,undef +--bia_mask=2 +--batch=shapes_2d_ci +--bia_mask=4 +--batch=shapes_3d + +--dt=f32 +--bia-dt=f32,undef +--bia_mask=2 +--attr-fpmath=bf16 +--batch=shapes_2d_ci +--bia_mask=4 +--batch=shapes_3d + +#f16 +--dt=f16:f16:f16 +--bia-dt=undef +--bia_mask=2 +--batch=shapes_2d_ci +--bia_mask=4 +--batch=shapes_3d diff --git a/.github/automation/performance/inputs/reorder b/.github/automation/performance/inputs/reorder new file mode 100644 index 00000000000..38441f10f2c --- /dev/null +++ b/.github/automation/performance/inputs/reorder @@ -0,0 +1,39 @@ +# ******************************************************************************* +# 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. +# ******************************************************************************* + +--reset +--sdt=f32 +--ddt=f32 +--allow-enum-tags-only=0 +--stag=ba +--dtag=Ab4a,Ab8a +384x384 + +--reset +--sdt=f32 +--ddt=bf16 +--allow-enum-tags-only=0 +--stag=ba +--dtag=BA8b4a,BA4b4a +384x384 + +--reset +--sdt=bf16 +--ddt=f32 +--allow-enum-tags-only=0 +--stag=BA8b4a,BA4b4a +384x384 diff --git a/.github/automation/performance/inputs/reorder_nightly b/.github/automation/performance/inputs/reorder_nightly new file mode 100644 index 00000000000..62e5f9ed262 --- /dev/null +++ b/.github/automation/performance/inputs/reorder_nightly @@ -0,0 +1,27 @@ +# ******************************************************************************* +# 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. +# ******************************************************************************* + +--reset +--batch=reorder + +--reset +--sdt=f32,s8 +--ddt=f32,s8 + +--stag=abx,axb,aBx4b,aBx8b +--dtag=abx,axb,aBx4b,aBx8b +4x256x5x5 diff --git a/.github/workflows/ci-aarch64.yml b/.github/workflows/ci-aarch64.yml index a5e1531e7d8..3f024aa50cb 100644 --- a/.github/workflows/ci-aarch64.yml +++ b/.github/workflows/ci-aarch64.yml @@ -125,7 +125,7 @@ jobs: - name: Install scipy if: ${{ matrix.config.build == 'Release' }} - run: pip install scipy + run: pip install scipy statistics - name: Clone ACL run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build_acl.sh @@ -211,8 +211,8 @@ jobs: shell: bash if: ${{ github.event_name == 'pull_request' && matrix.config.build == 'Release' && matrix.config.name != 'cb100' }} run: | - OMP_NUM_THREADS=4 bash ${{ github.workspace }}/oneDNN/.github/automation/performance/bench_performance.sh ${{ github.workspace }}/oneDNN_base/build/tests/benchdnn/benchdnn ${{ github.workspace }}/oneDNN/build/tests/benchdnn/benchdnn base.txt new.txt - OMP_NUM_THREADS=16 bash ${{ github.workspace }}/oneDNN/.github/automation/performance/bench_performance.sh ${{ github.workspace }}/oneDNN_base/build/tests/benchdnn/benchdnn ${{ github.workspace }}/oneDNN/build/tests/benchdnn/benchdnn base.txt new.txt + OMP_NUM_THREADS=4 bash ${{ github.workspace }}/oneDNN/.github/automation/performance/bench_pr_performance.sh ${{ github.workspace }}/oneDNN_base/build/tests/benchdnn/benchdnn ${{ github.workspace }}/oneDNN/build/tests/benchdnn/benchdnn base_4.txt new_4.txt + OMP_NUM_THREADS=16 bash ${{ github.workspace }}/oneDNN/.github/automation/performance/bench_pr_performance.sh ${{ github.workspace }}/oneDNN_base/build/tests/benchdnn/benchdnn ${{ github.workspace }}/oneDNN/build/tests/benchdnn/benchdnn base_16.txt new_16.txt env: DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build @@ -220,7 +220,11 @@ jobs: if: ${{ github.event_name == 'pull_request' && matrix.config.build == 'Release' && matrix.config.name != 'cb100' }} id: performance-test continue-on-error: true - run: python ${{ github.workspace }}/oneDNN/.github/automation/performance/benchdnn_comparison.py base.txt new.txt + run: | + echo "4 threads:" + python ${{ github.workspace }}/oneDNN/.github/automation/performance/benchdnn_comparison.py base_4.txt new_4.txt + echo "16 threads:" + python ${{ github.workspace }}/oneDNN/.github/automation/performance/benchdnn_comparison.py base_16.txt new_16.txt - name: Check performance test failure if: ${{ steps.performance-test.outputs.pass != 'True' && github.event_name == 'pull_request' && matrix.config.build == 'Release' && matrix.config.name != 'cb100' }} diff --git a/.github/workflows/nightly-aarch64.yml b/.github/workflows/nightly-aarch64.yml index f026ab36e34..d237f53ae79 100644 --- a/.github/workflows/nightly-aarch64.yml +++ b/.github/workflows/nightly-aarch64.yml @@ -38,6 +38,9 @@ jobs: build-acl-cache: uses: ./.github/workflows/aarch64-acl.yml + test-performance: + uses: ./.github/workflows/performance-aarch64.yml + build-and-test: needs: build-acl-cache strategy: diff --git a/.github/workflows/performance-aarch64.yml b/.github/workflows/performance-aarch64.yml new file mode 100644 index 00000000000..35a0fb8a748 --- /dev/null +++ b/.github/workflows/performance-aarch64.yml @@ -0,0 +1,171 @@ +# ******************************************************************************* +# Copyright 2024-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: "Performance AArch64" + +on: + workflow_call: + +#* Stop stale workflows +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-performance + cancel-in-progress: true + +# Declare default permissions as read only. +permissions: read-all + +jobs: + build-acl-cache: + uses: ./.github/workflows/aarch64-acl.yml + + build-and-test-performance: + needs: build-acl-cache + strategy: + matrix: + config: [ + { name: c7g, label: ah-ubuntu_22_04-c7g_m-100, threading: OMP, toolset: gcc, build: Release, testset: NIGHTLY } + ] + + name: ${{ matrix.config.name }}, ${{ matrix.config.toolset }}, ${{ matrix.config.threading }}, ${{ matrix.config.build }} + runs-on: ${{ matrix.config.label }} + steps: + + - name: Checkout oneDNN + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: oneDNN + + # Note: This will create a github actions cache + - name: Get latest CMake and Ninja + uses: lukka/get-cmake@5f6e04f5267c8133f1273bf2103583fc72c46b17 # v3.31.5 + with: + cmakeVersion: 3.31.0 + ninjaVersion: 1.12.0 + + - if: ${{ matrix.config.threading == 'OMP' }} + name: Install openmp + run: | + sudo apt install -y libomp-dev + + - name: Read version file + 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: Install gcc + 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 }} + + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install scipy + if: ${{ matrix.config.build == 'Release' }} + run: pip install scipy statistics + + - name: Clone ACL + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build_acl.sh + env: + ACL_ACTION: clone + ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary + ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }} + + - 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.config.toolset }}-${{ matrix.config.build }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }} + path: ${{ github.workspace }}/ComputeLibrary/build + + - name: Configure oneDNN + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh + working-directory: ${{ github.workspace }}/oneDNN + env: + ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary + BUILD_TOOLSET: ${{ matrix.config.toolset }} + CMAKE_BUILD_TYPE: ${{ matrix.config.build }} + CMAKE_GENERATOR: Ninja + GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }} + ONEDNN_ACTION: configure + ONEDNN_TEST_SET: ${{ matrix.config.testset }} + ONEDNN_THREADING: ${{ matrix.config.threading }} + + - name: Build oneDNN + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh + working-directory: ${{ github.workspace }}/oneDNN + env: + ONEDNN_ACTION: build + + - name: Checkout oneDNN base + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ fromJson(steps.get-versions.outputs.output).dependencies.onednn-base }} + path: oneDNN_base + + - name: Configure oneDNN base + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh + working-directory: ${{ github.workspace }}/oneDNN_base + env: + ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary + BUILD_TOOLSET: ${{ matrix.config.toolset }} + CMAKE_BUILD_TYPE: ${{ matrix.config.build }} + CMAKE_GENERATOR: Ninja + GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }} + ONEDNN_ACTION: configure + ONEDNN_TEST_SET: ${{ matrix.config.testset }} + ONEDNN_THREADING: ${{ matrix.config.threading }} + + - name: Build oneDNN base + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh + working-directory: ${{ github.workspace }}/oneDNN_base + env: + ONEDNN_ACTION: build + + - name: Run performance tests + shell: bash + run: | + OMP_NUM_THREADS=16 bash ${{ github.workspace }}/oneDNN/.github/automation/performance/bench_nightly_performance.sh ${{ github.workspace }}/oneDNN_base/build/tests/benchdnn/benchdnn ${{ github.workspace }}/oneDNN/build/tests/benchdnn/benchdnn base.txt new.txt + env: + DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build + + - name: Compare 16 threads performance test results + run: | + python ${{ github.workspace }}/oneDNN/.github/automation/performance/benchdnn_comparison.py base.txt new.txt + + #* This job adds a check named "Nightly Performance AArch64" that represents overall + #* workflow status and can be used in branch rulesets + status: + needs: build-and-test-performance + runs-on: ubuntu-latest + name: "Nightly Performance AArch64" + steps: + - name: Print success + run: echo Success