Skip to content

Commit a4baff0

Browse files
add workflow for running UMF benchmarks on Ubuntu
download scripts for data visualisation from UR repository, run UMF benchmarks, upload the results to GitHub pages
1 parent 378d1a3 commit a4baff0

File tree

3 files changed

+65
-49
lines changed

3 files changed

+65
-49
lines changed

.github/workflows/benchmarks.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Compute Benchmarks
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
str_name:
7+
description: Formatted adapter name
8+
type: choice
9+
required: true
10+
default: 'level_zero'
11+
options:
12+
- level_zero
13+
- level_zero_v2
14+
unit:
15+
description: Test unit (cpu/gpu)
16+
type: choice
17+
required: true
18+
default: 'gpu'
19+
options:
20+
- cpu
21+
- gpu
22+
pr_no:
23+
description: PR number (if 0, it'll run on the main)
24+
type: number
25+
# required: true
26+
bench_script_params:
27+
description: Parameters passed to script executing benchmark
28+
type: string
29+
required: false
30+
default: ''
31+
upload_report:
32+
description: 'Upload HTML report'
33+
type: boolean
34+
required: false
35+
default: false
36+
37+
permissions:
38+
contents: read
39+
pull-requests: write
40+
41+
jobs:
42+
manual:
43+
name: Compute Benchmarks
44+
uses: ./.github/workflows/reusable_benchmarks.yml
45+
with:
46+
pr_no: ${{ inputs.pr_no }}
47+
bench_script_params: ${{ inputs.bench_script_params }}
48+
upload_report: ${{ inputs.upload_report }}
49+

.github/workflows/pr_push.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ concurrency:
1414

1515
permissions:
1616
contents: read
17-
pull-requests: write
1817

1918
jobs:
2019
CodeChecks:
@@ -55,13 +54,6 @@ jobs:
5554
uses: ./.github/workflows/reusable_qemu.yml
5655
with:
5756
short_run: true
58-
Benchmarks:
59-
needs: [Build]
60-
uses: ./.github/workflows/reusable_benchmarks.yml
61-
with:
62-
pr_no: '0'
63-
bench_script_params: ''
64-
upload_report: true
6557
ProxyLib:
6658
needs: [Build]
6759
uses: ./.github/workflows/reusable_proxy_lib.yml

.github/workflows/reusable_benchmarks.yml

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# Executes benchmarks implemented in this repository
1+
# Executes benchmarks implemented in this repository,
2+
# using scripts for benchmark results visualisation,
3+
# which are downloaded from Unified Runtime repository.
4+
# The results are displayed in form of charts on Github Pages
5+
# at <github-pages-url>/benchmark_results.html
26
name: Benchmarks
37

48
on:
59
workflow_call:
610
inputs:
711
pr_no:
8-
required: true
12+
# required: true
913
# even though this is a number, this is a workaround for issues with
1014
# reusable workflow calls that result in "Unexpected value '0'" error.
1115
type: string
@@ -30,18 +34,20 @@ env:
3034
jobs:
3135
benchmarks:
3236
name: Benchmarks
33-
# env:
34-
# VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
3537
strategy:
3638
matrix:
37-
os: ['ubuntu-latest'] #, 'windows-latest']
38-
include:
39-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command to determine the build type
40-
- os: ubuntu-latest
41-
extra_build_option: '-DCMAKE_BUILD_TYPE=Release'
39+
os: ['ubuntu-latest']
4240
runs-on: ${{matrix.os}}
4341

4442
steps:
43+
# Workspace on self-hosted runners is not cleaned automatically.
44+
# We have to delete the files created outside of using actions.
45+
- name: Cleanup self-hosted workspace
46+
if: always()
47+
run: |
48+
ls -la ./
49+
rm -rf ./* || true
50+
4551
- name: Add comment to PR
4652
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
4753
if: ${{ always() && inputs.pr_no != 0 }}
@@ -75,31 +81,17 @@ jobs:
7581
git rev-parse origin/pr/${PR_NO}/merge
7682
7783
- name: Install apt packages
78-
if: matrix.os == 'ubuntu-latest'
7984
run: |
8085
sudo apt-get update
8186
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libtbb-dev
8287
83-
# - name: Initialize vcpkg
84-
# if: matrix.os == 'windows-latest'
85-
# uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
86-
# with:
87-
# vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
88-
# vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
89-
# vcpkgJsonGlob: '**/vcpkg.json'
90-
91-
# - name: Install vcpkg packages
92-
# if: matrix.os == 'windows-latest'
93-
# run: vcpkg install
94-
# shell: pwsh # Specifies PowerShell as the shell for running the script.
95-
96-
# -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
9788
- name: Configure build
9889
run: >
9990
cmake
10091
-B ${{env.BUILD_DIR}}
10192
${{matrix.extra_build_option}}
10293
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
94+
-DCMAKE_BUILD_TYPE=Release
10395
-DUMF_BUILD_SHARED_LIBRARY=ON
10496
-DUMF_BUILD_BENCHMARKS=ON
10597
-DUMF_BUILD_BENCHMARKS_MT=ON
@@ -112,13 +104,8 @@ jobs:
112104
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
113105
114106
- name: Build UMF on Linux
115-
if: matrix.os == 'ubuntu-latest'
116107
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
117108

118-
# - name: Build UMF on Windows
119-
# if: matrix.os == 'windows-latest'
120-
# run: cmake --build ${{env.BUILD_DIR}} --config Release -j $Env:NUMBER_OF_PROCESSORS
121-
122109
- name: Checkout UR
123110
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
124111
with:
@@ -132,14 +119,12 @@ jobs:
132119
pip install --force-reinstall -r ${{github.workspace}}/ur-repo/third_party/benchmark_requirements.txt
133120
134121
- name: Install HWLOC
135-
if: matrix.os == 'ubuntu-latest'
136122
run: |
137123
sudo apt-get update
138124
sudo apt-get install libhwloc-dev
139125
140126
- name: Run benchmarks
141127
id: benchmarks
142-
if: matrix.os == 'ubuntu-latest'
143128
working-directory: ${{env.BUILD_DIR}}
144129
run: >
145130
${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
@@ -152,16 +137,6 @@ jobs:
152137
run: >
153138
echo 'out: ${{ steps.benchmarks.outcome }}'
154139
155-
# - name: Run benchmarks
156-
# if: matrix.os == 'windows-latest'
157-
# working-directory: ${{env.BUILD_DIR}}
158-
# run: >
159-
# python3 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
160-
# ~/bench_workdir
161-
# --umf ${{env.BUILD_DIR}}
162-
# ${{ inputs.upload_report && '--output-html' || '' }}
163-
# ${{ inputs.bench_script_params }}
164-
165140
- name: Add comment to PR
166141
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
167142
if: ${{ always() && inputs.pr_no != 0 }}

0 commit comments

Comments
 (0)