1
1
name : Compute Benchmarks
2
2
3
3
on :
4
- # this workflow can by only triggered by other workflows
5
- # for example by: e2e_cuda.yml or e2e_opencl.yml
6
- workflow_call :
7
- # acceptable input from adapter-specific workflows
4
+ # Can be triggered via manual "dispatch" (from workflow view in GitHub Actions tab)
5
+ workflow_dispatch :
6
+ # acceptable input for adapter-specific runs
8
7
inputs :
9
- name :
10
- description : Adapter name
11
- type : string
12
- required : true
13
8
str_name :
14
9
description : Formatted adapter name
15
- type : string
16
- required : true
17
- config :
18
- description : Params for sycl configuration
19
- type : string
10
+ type : choice
20
11
required : true
12
+ default : ' level_zero'
13
+ options :
14
+ - level_zero
21
15
unit :
22
16
description : Test unit (cpu/gpu)
23
- type : string
17
+ type : choice
24
18
required : true
25
- runner_tag :
26
- description : Tag defined for the runner
27
- type : string
19
+ default : ' gpu'
20
+ options :
21
+ - cpu
22
+ - gpu
23
+ pr_no :
24
+ description : PR number (if 0, it'll run on the main)
25
+ type : number
28
26
required : true
29
- trigger :
30
- description : Type of workflow trigger
27
+ bench_script_params :
28
+ description : Parameters passed to script executing benchmark
31
29
type : string
32
- required : true
33
- comment :
34
- description : Text if triggered by a comment
30
+ required : false
31
+ default : ' '
32
+ sycl_config_params :
33
+ description : Extra params for SYCL configuration
35
34
type : string
36
35
required : false
36
+ default : ' '
37
37
38
38
permissions :
39
39
contents : read
40
40
pull-requests : write
41
41
42
42
jobs :
43
43
e2e-build-hw :
44
- if : github.repository == 'oneapi-src/unified-runtime' # run only on upstream; forks will not have the HW
44
+ # Run only on upstream; forks will not have the HW
45
+ if : github.repository == 'oneapi-src/unified-runtime'
45
46
name : Build SYCL, UR, run Compute Benchmarks
46
47
strategy :
47
48
matrix :
48
49
adapter : [
49
- {name: "${{inputs.name}}",
50
- str_name : " ${{inputs.str_name}}" ,
51
- config : " ${{inputs.config}}" ,
50
+ {str_name: "${{inputs.str_name}}",
51
+ sycl_config : " ${{inputs.sycl_config_params}}" ,
52
52
unit : " ${{inputs.unit}}" }
53
53
]
54
54
build_type : [Release]
55
55
compiler : [{c: clang, cxx: clang++}]
56
56
57
- runs-on : ${{inputs.runner_tag}}
57
+ runs-on : " ${{inputs.str_name}}_PERF "
58
58
59
59
steps :
60
60
# Workspace on self-hosted runners is not cleaned automatically.
@@ -67,15 +67,17 @@ jobs:
67
67
68
68
- name : Add comment to PR
69
69
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
70
- if : ${{ always() && inputs.trigger != 'schedule' }}
70
+ if : ${{ always() && inputs.pr_no != 0 }}
71
71
with :
72
72
script : |
73
- const adapter = '${{ matrix.adapter.name }}';
73
+ const pr_no = '${{ inputs.pr_no }}';
74
+ const adapter = '${{ matrix.adapter.str_name }}';
74
75
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
75
- const body = `Compute Benchmarks ${adapter} run: \n${url}`;
76
+ const params = '${{ inputs.bench_script_params }}';
77
+ const body = `Compute Benchmarks ${adapter} run (with params: ${params}):\n${url}`;
76
78
77
79
github.rest.issues.createComment({
78
- issue_number: context.issue.number ,
80
+ issue_number: pr_no ,
79
81
owner: context.repo.owner,
80
82
repo: context.repo.repo,
81
83
body: body
@@ -86,13 +88,12 @@ jobs:
86
88
with :
87
89
path : ur-repo
88
90
89
- # On issue_comment trigger (for PRs) we need to fetch special ref for
90
- # proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
91
+ # We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
91
92
- name : Fetch PR's merge commit
92
- if : ${{ inputs.trigger != 'schedule' }}
93
+ if : ${{ inputs.pr_no != 0 }}
93
94
working-directory : ${{github.workspace}}/ur-repo
94
95
env :
95
- PR_NO : ${{github.event.issue.number }}
96
+ PR_NO : ${{ inputs.pr_no }}
96
97
run : |
97
98
git fetch -- https://github.com/${{github.repository}} +refs/pull/${PR_NO}/*:refs/remotes/origin/pr/${PR_NO}/*
98
99
git checkout origin/pr/${PR_NO}/merge
@@ -108,7 +109,7 @@ jobs:
108
109
fetch-tags : false
109
110
110
111
- name : Set CUDA env vars
111
- if : matrix.adapter.name == 'CUDA '
112
+ if : matrix.adapter.str_name == 'cuda '
112
113
run : |
113
114
echo "CUDA_LIB_PATH=/usr/local/cuda/lib64/stubs" >> $GITHUB_ENV
114
115
echo "LD_LIBRARY_PATH=/usr/local/cuda/compat/:/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
@@ -119,7 +120,7 @@ jobs:
119
120
-t ${{matrix.build_type}}
120
121
-o ${{github.workspace}}/sycl_build
121
122
--cmake-gen "Ninja"
122
- --ci-defaults ${{matrix.adapter.config }}
123
+ --ci-defaults ${{matrix.adapter.sycl_config }}
123
124
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
124
125
--cmake-opt="-DSYCL_PI_TESTS=OFF"
125
126
--cmake-opt="-DSYCL_PI_UR_USE_FETCH_CONTENT=OFF"
@@ -165,17 +166,13 @@ jobs:
165
166
run : |
166
167
echo "ONEAPI_DEVICE_SELECTOR=${{ matrix.adapter.str_name }}:${{ matrix.adapter.unit }}" >> $GITHUB_ENV
167
168
168
- - name : Extract arguments from comment
169
- id : args
170
- run : echo "ARGS=$(echo '${{ inputs.comment }}' | sed -n 's/.*\/benchmarks-[^ ]* \(.*\)/\1/p')" >> $GITHUB_ENV
171
-
172
169
- name : Run SYCL API Overhead benchmark
173
170
id : benchmarks
174
- run : ${{github.workspace}}/ur-repo/.github/scripts/compute_benchmarks.py ${{github.workspace}}/compute-benchmarks-build/bin/ $ARGS
171
+ run : ${{ github.workspace }}/ur-repo/.github/scripts/compute_benchmarks.py ${{ github.workspace }}/compute-benchmarks-build/bin/ ${{ inputs.bench_script_params }}
175
172
176
173
- name : Add comment to PR
177
174
uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
178
- if : ${{ always() && inputs.trigger != 'schedule' }}
175
+ if : ${{ always() && inputs.pr_no != 0 }}
179
176
with :
180
177
script : |
181
178
let markdown = ""
@@ -185,14 +182,16 @@ jobs:
185
182
} catch(err) {
186
183
}
187
184
188
- const adapter = '${{ matrix.adapter.name }}';
185
+ const pr_no = '${{ inputs.pr_no }}';
186
+ const adapter = '${{ matrix.adapter.str_name }}';
189
187
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
190
188
const test_status = '${{ steps.benchmarks.outcome }}';
191
189
const job_status = '${{ job.status }}';
192
- const body = `Compute Benchmarks ${adapter} run:\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
190
+ const params = '${{ inputs.bench_script_params }}';
191
+ const body = `Compute Benchmarks ${adapter} run (with params: ${params}):\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
193
192
194
193
github.rest.issues.createComment({
195
- issue_number: context.issue.number ,
194
+ issue_number: pr_no ,
196
195
owner: context.repo.owner,
197
196
repo: context.repo.repo,
198
197
body: body
0 commit comments