1
1
# Executes benchmarks implemented in this repository
2
+ # using scripts for benchmark results visualisation,
3
+ # which are downloaded from Unified Runtime repository.
2
4
name : Benchmarks
3
5
4
6
on :
5
7
workflow_call :
6
8
inputs :
7
9
pr_no :
8
- required : true
9
10
# even though this is a number, this is a workaround for issues with
10
11
# reusable workflow calls that result in "Unexpected value '0'" error.
11
12
type : string
@@ -24,24 +25,26 @@ permissions:
24
25
pull-requests : write
25
26
26
27
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 "
29
30
30
31
jobs :
31
32
benchmarks :
32
33
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"
35
34
strategy :
36
35
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']
42
37
runs-on : ${{matrix.os}}
43
38
44
39
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
+
45
48
- name : Add comment to PR
46
49
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
47
50
if : ${{ always() && inputs.pr_no != 0 }}
@@ -59,14 +62,16 @@ jobs:
59
62
body: body
60
63
})
61
64
62
- - name : Checkout
65
+ - name : Checkout UMF
63
66
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
64
67
with :
68
+ path : ${{env.UMF_DIR}}
65
69
fetch-depth : 0
66
70
67
71
# We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
68
72
- name : Fetch PR's merge commit
69
73
if : ${{ inputs.pr_no != 0 }}
74
+ working-directory : ${{env.UMF_DIR}}
70
75
env :
71
76
PR_NO : ${{ inputs.pr_no }}
72
77
run : |
@@ -75,31 +80,16 @@ jobs:
75
80
git rev-parse origin/pr/${PR_NO}/merge
76
81
77
82
- name : Install apt packages
78
- if : matrix.os == 'ubuntu-latest'
79
83
run : |
80
84
sudo apt-get update
81
85
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libtbb-dev
82
86
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}}"
97
87
- name : Configure build
98
88
run : >
99
89
cmake
90
+ -S ${{env.UMF_DIR}}
100
91
-B ${{env.BUILD_DIR}}
101
- ${{matrix.extra_build_option}}
102
- -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
92
+ -DCMAKE_BUILD_TYPE=Release
103
93
-DUMF_BUILD_SHARED_LIBRARY=ON
104
94
-DUMF_BUILD_BENCHMARKS=ON
105
95
-DUMF_BUILD_BENCHMARKS_MT=ON
@@ -110,15 +100,13 @@ jobs:
110
100
-DUMF_BUILD_CUDA_PROVIDER=ON
111
101
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
112
102
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
103
+ -DUMF_BUILD_EXAMPLES=OFF
113
104
114
- - name : Build UMF on Linux
115
- if : matrix.os == 'ubuntu-latest'
105
+ - name : Build UMF
116
106
run : cmake --build ${{env.BUILD_DIR}} -j $(nproc)
117
107
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
122
110
- name : Checkout UR
123
111
uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
124
112
with :
@@ -127,19 +115,12 @@ jobs:
127
115
fetch-depth : 1
128
116
fetch-tags : false
129
117
130
- - name : Install pip packages
118
+ - name : Install pip packages for benchmarking scripts from UR
131
119
run : |
132
120
pip install --force-reinstall -r ${{github.workspace}}/ur-repo/third_party/benchmark_requirements.txt
133
121
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
141
123
id : benchmarks
142
- if : matrix.os == 'ubuntu-latest'
143
124
working-directory : ${{env.BUILD_DIR}}
144
125
run : >
145
126
${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
@@ -148,20 +129,6 @@ jobs:
148
129
${{ inputs.upload_report && '--output-html' || '' }}
149
130
${{ inputs.bench_script_params }}
150
131
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
-
165
132
- name : Add comment to PR
166
133
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
167
134
if : ${{ always() && inputs.pr_no != 0 }}
0 commit comments