6
6
str_name :
7
7
required : true
8
8
type : string
9
- unit :
9
+ preset :
10
10
required : true
11
11
type : string
12
12
pr_no :
30
30
required : false
31
31
type : string
32
32
default : ' '
33
- upload_report :
34
- required : false
35
- type : boolean
36
- default : false
37
33
compute_runtime_commit :
38
34
required : false
39
35
type : string
40
36
default : ' '
41
37
42
38
permissions :
43
- contents : read
39
+ contents : write
44
40
pull-requests : write
45
41
46
42
jobs :
51
47
adapter : [
52
48
{str_name: "${{ inputs.str_name }}",
53
49
sycl_config : " ${{ inputs.sycl_config_params }}" ,
54
- unit : " ${{ inputs.unit }}"
55
50
}
56
51
]
57
52
build_type : [Release]
60
55
runs-on : " ${{ inputs.str_name }}_PERF"
61
56
62
57
steps :
63
- - name : Cleanup self-hosted workspace
64
- if : always()
65
- run : |
66
- ls -la ./
67
- rm -rf ./* || true
68
-
69
58
- name : Add comment to PR
70
59
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
71
60
if : ${{ always() && inputs.pr_no != 0 }}
@@ -84,25 +73,28 @@ jobs:
84
73
body: body
85
74
})
86
75
87
- - name : Checkout UR
76
+ - name : Checkout benchmark scripts
88
77
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
89
78
with :
90
- path : ur-repo
79
+ repository : intel/llvm
80
+ ref : unify-benchmark-ci
81
+ path : sc
82
+ sparse-checkout : |
83
+ devops/scripts/benchmarks
91
84
92
- - name : Install pip packages
93
- run : |
94
- pip install --force-reinstall -r ${{github.workspace}}/ur-repo/third_party/benchmark_requirements.txt
95
-
96
- # We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
97
- - name : Fetch PR's merge commit
98
- if : ${{ inputs.pr_no != 0 }}
99
- working-directory : ${{github.workspace}}/ur-repo
100
- env :
101
- PR_NO : ${{ inputs.pr_no }}
85
+ - name : Checkout results branch
86
+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
87
+ with :
88
+ ref : benchmark-results
89
+ path : results-repo
90
+
91
+ - name : Create virtual environment
92
+ run : python -m venv .venv
93
+
94
+ - name : Activate virtual environment and install pip packages
102
95
run : |
103
- git fetch -- https://github.com/${{github.repository}} +refs/pull/${PR_NO}/*:refs/remotes/origin/pr/${PR_NO}/*
104
- git checkout origin/pr/${PR_NO}/merge
105
- git rev-parse origin/pr/${PR_NO}/merge
96
+ source .venv/bin/activate
97
+ pip install -r sc/devops/scripts/benchmarks/requirements.txt
106
98
107
99
- name : Checkout SYCL
108
100
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -135,8 +127,6 @@ jobs:
135
127
--ci-defaults ${{matrix.adapter.sycl_config}}
136
128
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
137
129
--cmake-opt="-DSYCL_PI_TESTS=OFF"
138
- --cmake-opt="-DSYCL_UR_USE_FETCH_CONTENT=OFF"
139
- --cmake-opt="-DSYCL_UR_SOURCE_DIR=${{github.workspace}}/ur-repo/"
140
130
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
141
131
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
142
132
@@ -146,7 +136,7 @@ jobs:
146
136
- name : Configure UR
147
137
run : >
148
138
cmake -DCMAKE_BUILD_TYPE=Release
149
- -S${{github.workspace}}/ur -repo
139
+ -S${{github.workspace}}/sycl -repo/unified-runtime
150
140
-B${{github.workspace}}/ur_build
151
141
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ur_install
152
142
-DUR_BUILD_TESTS=OFF
@@ -160,35 +150,6 @@ jobs:
160
150
- name : Install UR
161
151
run : cmake --install ${{github.workspace}}/ur_build
162
152
163
- - name : Checkout UMF
164
- uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
165
- with :
166
- repository : oneapi-src/unified-memory-framework
167
- ref : main
168
- path : umf-repo
169
- fetch-depth : 1
170
- fetch-tags : false
171
-
172
- - name : Configure UMF
173
- run : >
174
- cmake -DCMAKE_BUILD_TYPE=Release
175
- -S${{github.workspace}}/umf-repo
176
- -B${{github.workspace}}/umf_build
177
- -DUMF_BUILD_BENCHMARKS=ON
178
- -DUMF_BUILD_SHARED_LIBRARY=ON
179
- -DUMF_BUILD_BENCHMARKS_MT=ON
180
- -DUMF_BUILD_TESTS=OFF
181
- -DUMF_FORMAT_CODE_STYLE=OFF
182
- -DUMF_DEVELOPER_MODE=OFF
183
- -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
184
- -DUMF_BUILD_CUDA_PROVIDER=ON
185
- -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
186
- -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
187
- -DUMF_BUILD_EXAMPLES=OFF
188
-
189
- - name : Build UMF
190
- run : cmake --build ${{github.workspace}}/umf_build -j $(nproc)
191
-
192
153
- name : Compute core range
193
154
run : |
194
155
# Compute the core range for the first NUMA node; second node is for UMF jobs.
@@ -208,25 +169,25 @@ jobs:
208
169
echo "ZE_AFFINITY_MASK=$ZE_AFFINITY_MASK" >> $GITHUB_ENV
209
170
210
171
- name : Run benchmarks
211
- working-directory : ${{ github.workspace }}/ur-repo/
212
172
id : benchmarks
213
173
run : >
214
- taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
215
- ~/bench_workdir
174
+ source .venv/bin/activate &&
175
+ taskset -c ${{ env.CORES }} ./sc/devops/scripts/benchmarks/main.py
176
+ ~/ur_bench_workdir
216
177
--sycl ${{ github.workspace }}/sycl_build
217
178
--ur ${{ github.workspace }}/ur_install
218
- --umf ${{ github.workspace }}/umf_build
219
179
--adapter ${{ matrix.adapter.str_name }}
220
180
--compute-runtime ${{ inputs.compute_runtime_commit }}
221
181
--build-igc
222
- --compare baseline
223
- ${{ inputs.upload_report && '--output-html' || '' }}
224
- ${{ inputs.pr_no != 0 && '--output-markdown' || '' }}
182
+ --output-html remote
183
+ --results-dir ${{ github.workspace }}/results-repo
184
+ --output-markdown
185
+ --preset ${{ inputs.preset }}
225
186
${{ inputs.bench_script_params }}
226
187
227
188
- name : Print benchmark results
228
189
run : |
229
- cat ${{ github.workspace }}/ur-repo /benchmark_results.md || true
190
+ cat ${{ github.workspace }}/sc/devops/scripts/benchmarks /benchmark_results.md || true
230
191
231
192
- name : Add comment to PR
232
193
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
@@ -236,7 +197,7 @@ jobs:
236
197
let markdown = ""
237
198
try {
238
199
const fs = require('fs');
239
- markdown = fs.readFileSync('ur-repo /benchmark_results.md', 'utf8');
200
+ markdown = fs.readFileSync('sc/devops/scripts/benchmarks /benchmark_results.md', 'utf8');
240
201
} catch(err) {
241
202
}
242
203
@@ -255,14 +216,41 @@ jobs:
255
216
body: body
256
217
})
257
218
258
- - name : Upload HTML report
259
- if : ${{ always() && inputs.upload_report }}
260
- uses : actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
261
- with :
262
- path : ur-repo/benchmark_results.html
263
- key : benchmark-results-${{ matrix.adapter.str_name }}-${{ github.run_id }}
219
+ - name : Commit data.json and results directory
220
+ working-directory : results-repo
221
+ run : |
222
+ git config --global user.name "GitHub Actions Bot"
223
+ git config --global user.email "[email protected] "
224
+
225
+ for attempt in {1..5}; do
226
+ echo "Attempt $attempt to push changes"
227
+
228
+ rm -f data.json
229
+ cp ${{ github.workspace }}/sc/devops/scripts/benchmarks/html/data.json .
230
+
231
+ git add data.json results/
232
+ git commit -m "Add benchmark results and data.json"
233
+
234
+ results_file=$(git diff HEAD~1 --name-only -- results/ | head -n 1)
235
+
236
+ if git push origin benchmark-results; then
237
+ echo "Push succeeded"
238
+ break
239
+ fi
240
+
241
+ echo "Push failed, retrying..."
242
+
243
+ if [ -n "$results_file" ]; then
244
+ mv $results_file ${{ github.workspace }}/temp_$(basename $results_file)
245
+
246
+ git reset --hard origin/benchmark-results
247
+ git pull origin benchmark-results
248
+
249
+ new_file="results/$(basename "$results_file")"
250
+ mv ${{ github.workspace }}/temp_$(basename $results_file) $new_file
251
+ fi
252
+
253
+ echo "Regenerating data.json"
254
+ (cd ${{ github.workspace }} && ${{ github.workspace }}/sc/devops/scripts/benchmarks/main.py ~/ur_bench_workdir --dry-run --results-dir ${{ github.workspace }}/results-repo --output-html remote)
264
255
265
- - name : Get information about platform
266
- if : ${{ always() }}
267
- working-directory : ${{ github.workspace }}/ur-repo/
268
- run : .github/scripts/get_system_info.sh
256
+ done
0 commit comments