Skip to content

Commit ccb2156

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 ccb2156

File tree

6 files changed

+61
-183
lines changed

6 files changed

+61
-183
lines changed

.github/workflows/benchmarks.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Compute Benchmarks
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
pr_no:
7+
description: PR number (if 0, it'll run on the main)
8+
type: number
9+
bench_script_params:
10+
description: Parameters passed to script executing benchmark
11+
type: string
12+
required: false
13+
default: ''
14+
upload_report:
15+
description: 'Upload HTML report'
16+
type: boolean
17+
required: false
18+
default: false
19+
20+
permissions:
21+
contents: read
22+
pull-requests: write
23+
24+
jobs:
25+
manual:
26+
name: Compute Benchmarks
27+
uses: ./.github/workflows/reusable_benchmarks.yml
28+
with:
29+
pr_no: ${{ inputs.pr_no }}
30+
bench_script_params: ${{ inputs.bench_script_params }}
31+
upload_report: ${{ inputs.upload_report }}

.github/workflows/nightly.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99

1010
permissions:
1111
contents: read
12-
pull-requests: write
1312

1413
jobs:
1514
fuzz-test:
@@ -198,6 +197,9 @@ jobs:
198197

199198
Benchmarks:
200199
uses: ./.github/workflows/reusable_benchmarks.yml
200+
permissions:
201+
contents: read
202+
pull-requests: write
201203
with:
202204
pr_no: '0'
203205
bench_script_params: ''

.github/workflows/performance.yml

Lines changed: 0 additions & 115 deletions
This file was deleted.

.github/workflows/pr_push.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ concurrency:
1414

1515
permissions:
1616
contents: read
17-
pull-requests: write
18-
17+
1918
jobs:
2019
CodeChecks:
2120
uses: ./.github/workflows/reusable_checks.yml
@@ -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: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Executes benchmarks implemented in this repository
2+
# using scripts for benchmark results visualisation,
3+
# which are downloaded from Unified Runtime repository.
24
name: Benchmarks
35

46
on:
57
workflow_call:
68
inputs:
79
pr_no:
8-
required: true
910
# even though this is a number, this is a workaround for issues with
1011
# reusable workflow calls that result in "Unexpected value '0'" error.
1112
type: string
@@ -24,24 +25,26 @@ permissions:
2425
pull-requests: write
2526

2627
env:
27-
BUILD_DIR : "${{github.workspace}}/build"
28-
INSTL_DIR : "${{github.workspace}}/../install-dir"
28+
UMF_DIR: "${{github.workspace}}/umf-repo"
29+
BUILD_DIR : "${{github.workspace}}/umf-repo/build"
2930

3031
jobs:
3132
benchmarks:
3233
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"
3534
strategy:
3635
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'
36+
os: ['ubuntu-latest']
4237
runs-on: ${{matrix.os}}
4338

4439
steps:
40+
# Workspace on self-hosted runners is not cleaned automatically.
41+
# We have to delete the files created outside of using actions.
42+
- name: Cleanup self-hosted workspace
43+
if: always()
44+
run: |
45+
ls -la ./
46+
rm -rf ./* || true
47+
4548
- name: Add comment to PR
4649
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
4750
if: ${{ always() && inputs.pr_no != 0 }}
@@ -59,14 +62,16 @@ jobs:
5962
body: body
6063
})
6164
62-
- name: Checkout
65+
- name: Checkout UMF
6366
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6467
with:
68+
path: ${{env.UMF_DIR}}
6569
fetch-depth: 0
6670

6771
# We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
6872
- name: Fetch PR's merge commit
6973
if: ${{ inputs.pr_no != 0 }}
74+
working-directory: ${{env.UMF_DIR}}
7075
env:
7176
PR_NO: ${{ inputs.pr_no }}
7277
run: |
@@ -75,31 +80,16 @@ jobs:
7580
git rev-parse origin/pr/${PR_NO}/merge
7681
7782
- name: Install apt packages
78-
if: matrix.os == 'ubuntu-latest'
7983
run: |
8084
sudo apt-get update
8185
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libtbb-dev
8286
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}}"
9787
- name: Configure build
9888
run: >
9989
cmake
90+
-S ${{env.UMF_DIR}}
10091
-B ${{env.BUILD_DIR}}
101-
${{matrix.extra_build_option}}
102-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
92+
-DCMAKE_BUILD_TYPE=Release
10393
-DUMF_BUILD_SHARED_LIBRARY=ON
10494
-DUMF_BUILD_BENCHMARKS=ON
10595
-DUMF_BUILD_BENCHMARKS_MT=ON
@@ -110,15 +100,13 @@ jobs:
110100
-DUMF_BUILD_CUDA_PROVIDER=ON
111101
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
112102
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
103+
-DUMF_BUILD_EXAMPLES=OFF
113104
114-
- name: Build UMF on Linux
115-
if: matrix.os == 'ubuntu-latest'
105+
- name: Build UMF
116106
run: cmake --build ${{env.BUILD_DIR}} -j $(nproc)
117107

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-
108+
# We are going to clone Unified Runtime repository in order to run
109+
# the most up-to-date UR scripts for benchmark data visualisation
122110
- name: Checkout UR
123111
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
124112
with:
@@ -127,19 +115,12 @@ jobs:
127115
fetch-depth: 1
128116
fetch-tags: false
129117

130-
- name: Install pip packages
118+
- name: Install pip packages for benchmarking scripts from UR
131119
run: |
132120
pip install --force-reinstall -r ${{github.workspace}}/ur-repo/third_party/benchmark_requirements.txt
133121
134-
- name: Install HWLOC
135-
if: matrix.os == 'ubuntu-latest'
136-
run: |
137-
sudo apt-get update
138-
sudo apt-get install libhwloc-dev
139-
140-
- name: Run benchmarks
122+
- name: Run dedicated for UMF benchmarking scripts from UR
141123
id: benchmarks
142-
if: matrix.os == 'ubuntu-latest'
143124
working-directory: ${{env.BUILD_DIR}}
144125
run: >
145126
${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
@@ -148,20 +129,6 @@ jobs:
148129
${{ inputs.upload_report && '--output-html' || '' }}
149130
${{ inputs.bench_script_params }}
150131
151-
- name: Test output
152-
run: >
153-
echo 'out: ${{ steps.benchmarks.outcome }}'
154-
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-
165132
- name: Add comment to PR
166133
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
167134
if: ${{ always() && inputs.pr_no != 0 }}

.github/workflows/reusable_docs_build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ jobs:
4545
-DUMF_DISABLE_HWLOC=ON
4646
cmake --build build --target docs
4747
48-
- name: Download benchmark HTML
48+
- name: Download benchmark HTML before uploading with documentation on GitHub pages
49+
# If the benchmark results are meant to be uploaded on GH pages
4950
if: ${{ inputs.upload == true }}
5051
id: download-bench-html
5152
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0

0 commit comments

Comments
 (0)