|
| 1 | +# ******************************************************************************* |
| 2 | +# Copyright 2024-2025 Arm Limited and affiliates. |
| 3 | +# SPDX-License-Identifier: Apache-2.0 |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# ******************************************************************************* |
| 17 | + |
| 18 | +name: "Performance AArch64" |
| 19 | + |
| 20 | +on: |
| 21 | + workflow_call: |
| 22 | + |
| 23 | +#* Stop stale workflows |
| 24 | +concurrency: |
| 25 | + group: ${{ github.workflow }}-${{ github.ref }}-performance |
| 26 | + cancel-in-progress: true |
| 27 | + |
| 28 | +# Declare default permissions as read only. |
| 29 | +permissions: read-all |
| 30 | + |
| 31 | +jobs: |
| 32 | + build-acl-cache: |
| 33 | + uses: ./.github/workflows/aarch64-acl.yml |
| 34 | + |
| 35 | + build-and-test-performance: |
| 36 | + needs: build-acl-cache |
| 37 | + strategy: |
| 38 | + matrix: |
| 39 | + config: [ |
| 40 | + { name: c7g, label: ah-ubuntu_22_04-c7g_m-100, threading: OMP, toolset: gcc, build: Release, testset: NIGHTLY } |
| 41 | + ] |
| 42 | + |
| 43 | + name: ${{ matrix.config.name }}, ${{ matrix.config.toolset }}, ${{ matrix.config.threading }}, ${{ matrix.config.build }} |
| 44 | + runs-on: ${{ matrix.config.label }} |
| 45 | + steps: |
| 46 | + |
| 47 | + - name: Checkout oneDNN |
| 48 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 49 | + with: |
| 50 | + path: oneDNN |
| 51 | + |
| 52 | + # Note: This will create a github actions cache |
| 53 | + - name: Get latest CMake and Ninja |
| 54 | + uses: lukka/get-cmake@5f6e04f5267c8133f1273bf2103583fc72c46b17 # v3.31.5 |
| 55 | + with: |
| 56 | + cmakeVersion: 3.31.0 |
| 57 | + ninjaVersion: 1.12.0 |
| 58 | + |
| 59 | + - if: ${{ matrix.config.threading == 'OMP' }} |
| 60 | + name: Install openmp |
| 61 | + run: | |
| 62 | + sudo apt install -y libomp-dev |
| 63 | +
|
| 64 | + - name: Read version file |
| 65 | + id: get-versions |
| 66 | + run: | |
| 67 | + content=`cat ${{ github.workspace }}/oneDNN/.github/automation/aarch64/ci.json` |
| 68 | + content="${content//[$'\t\r\n$ ']}" |
| 69 | + echo "output=$content" >> $GITHUB_OUTPUT |
| 70 | +
|
| 71 | + - name: Install gcc |
| 72 | + run: | |
| 73 | + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y |
| 74 | + sudo apt update -y |
| 75 | + sudo apt install -y g++-${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }} |
| 76 | +
|
| 77 | + - name: setup python |
| 78 | + uses: actions/setup-python@v4 |
| 79 | + with: |
| 80 | + python-version: '3.10' |
| 81 | + |
| 82 | + - name: Install scipy |
| 83 | + if: ${{ matrix.config.build == 'Release' }} |
| 84 | + run: pip install scipy statistics |
| 85 | + |
| 86 | + - name: Clone ACL |
| 87 | + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build_acl.sh |
| 88 | + env: |
| 89 | + ACL_ACTION: clone |
| 90 | + ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary |
| 91 | + ACL_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.acl }} |
| 92 | + |
| 93 | + - name: Get ACL commit hash for cache key |
| 94 | + id: get_acl_commit_hash |
| 95 | + run: (cd ${{ github.workspace }}/ComputeLibrary && echo "ACLCommitHash=$(git rev-parse --short HEAD)") >> $GITHUB_OUTPUT |
| 96 | + |
| 97 | + - name: Get system name |
| 98 | + id: get_system_name |
| 99 | + run: (echo "SystemName=$(uname)") >> $GITHUB_OUTPUT |
| 100 | + |
| 101 | + - name: Restore cached ACL |
| 102 | + id: cache-acl-restore |
| 103 | + uses: actions/cache/restore@v4 |
| 104 | + with: |
| 105 | + key: ${{ steps.get_system_name.outputs.SystemName }}-acl-${{ matrix.config.toolset }}-${{ matrix.config.build }}-${{ steps.get_acl_commit_hash.outputs.ACLCommitHash }} |
| 106 | + path: ${{ github.workspace }}/ComputeLibrary/build |
| 107 | + |
| 108 | + - name: Configure oneDNN |
| 109 | + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh |
| 110 | + working-directory: ${{ github.workspace }}/oneDNN |
| 111 | + env: |
| 112 | + ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary |
| 113 | + BUILD_TOOLSET: ${{ matrix.config.toolset }} |
| 114 | + CMAKE_BUILD_TYPE: ${{ matrix.config.build }} |
| 115 | + CMAKE_GENERATOR: Ninja |
| 116 | + GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }} |
| 117 | + ONEDNN_ACTION: configure |
| 118 | + ONEDNN_TEST_SET: ${{ matrix.config.testset }} |
| 119 | + ONEDNN_THREADING: ${{ matrix.config.threading }} |
| 120 | + |
| 121 | + - name: Build oneDNN |
| 122 | + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh |
| 123 | + working-directory: ${{ github.workspace }}/oneDNN |
| 124 | + env: |
| 125 | + ONEDNN_ACTION: build |
| 126 | + |
| 127 | + - name: Checkout oneDNN base |
| 128 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 129 | + with: |
| 130 | + ref: ${{ fromJson(steps.get-versions.outputs.output).dependencies.onednn-base }} |
| 131 | + path: oneDNN_base |
| 132 | + |
| 133 | + - name: Configure oneDNN base |
| 134 | + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh |
| 135 | + working-directory: ${{ github.workspace }}/oneDNN_base |
| 136 | + env: |
| 137 | + ACL_ROOT_DIR: ${{ github.workspace }}/ComputeLibrary |
| 138 | + BUILD_TOOLSET: ${{ matrix.config.toolset }} |
| 139 | + CMAKE_BUILD_TYPE: ${{ matrix.config.build }} |
| 140 | + CMAKE_GENERATOR: Ninja |
| 141 | + GCC_VERSION: ${{ fromJson(steps.get-versions.outputs.output).dependencies.gcc }} |
| 142 | + ONEDNN_ACTION: configure |
| 143 | + ONEDNN_TEST_SET: ${{ matrix.config.testset }} |
| 144 | + ONEDNN_THREADING: ${{ matrix.config.threading }} |
| 145 | + |
| 146 | + - name: Build oneDNN base |
| 147 | + run: ${{ github.workspace }}/oneDNN/.github/automation/aarch64/build.sh |
| 148 | + working-directory: ${{ github.workspace }}/oneDNN_base |
| 149 | + env: |
| 150 | + ONEDNN_ACTION: build |
| 151 | + |
| 152 | + - name: Run performance tests |
| 153 | + shell: bash |
| 154 | + run: | |
| 155 | + 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 |
| 156 | + env: |
| 157 | + DYLD_LIBRARY_PATH: ${{ github.workspace }}/ComputeLibrary/build |
| 158 | + |
| 159 | + - name: Compare 16 threads performance test results |
| 160 | + run: | |
| 161 | + python ${{ github.workspace }}/oneDNN/.github/automation/performance/benchdnn_comparison.py base.txt new.txt |
| 162 | +
|
| 163 | + #* This job adds a check named "Nightly Performance AArch64" that represents overall |
| 164 | + #* workflow status and can be used in branch rulesets |
| 165 | + status: |
| 166 | + needs: build-and-test-performance |
| 167 | + runs-on: ubuntu-latest |
| 168 | + name: "Nightly Performance AArch64" |
| 169 | + steps: |
| 170 | + - name: Print success |
| 171 | + run: echo Success |
0 commit comments