Skip to content

Commit 7e7a422

Browse files
Merge branch 'sycl' into sycl_ext_intel_kernel_queries
2 parents f47ba21 + a4f9764 commit 7e7a422

File tree

241 files changed

+9106
-2103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+9106
-2103
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Aggregate compute-benchmark averages from historical data
2+
3+
# The benchmarking workflow in sycl-linux-run-tests.yml passes or fails based on
4+
# how the benchmark results compare to a historical average: This historical
5+
# average is calculated in this workflow, which aggregates historical data and
6+
# produces measures of central tendency (median in this case) used for this
7+
# purpose.
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
lookback_days:
13+
description: |
14+
Number of days from today to look back in historical results for:
15+
This sets the age limit of data used in average calculation: Any
16+
benchmark results created before `lookback_days` from today is
17+
excluded from being aggregated in the historical average.
18+
type: number
19+
required: true
20+
workflow_call:
21+
inputs:
22+
lookback_days:
23+
type: number
24+
required: true
25+
secrets:
26+
LLVM_SYCL_BENCHMARK_TOKEN:
27+
description: |
28+
Github token used by the faceless account to push newly calculated
29+
medians.
30+
required: true
31+
32+
33+
permissions:
34+
contents: read
35+
36+
jobs:
37+
aggregate:
38+
name: Aggregate average (median) value for all metrics
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
sparse-checkout: |
44+
devops/scripts/benchmarking
45+
devops/benchmarking
46+
devops/actions/benchmarking
47+
- name: Aggregate benchmark results and produce historical average
48+
uses: ./devops/actions/benchmarking/aggregate
49+
with:
50+
lookback_days: ${{ inputs.lookback_days }}
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }}

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
required: False
2626
tests_selector:
2727
description: |
28-
Two possible options: "e2e" and "cts".
28+
Three possible options: "e2e", "cts", and "compute-benchmarks".
2929
type: string
3030
default: "e2e"
3131

@@ -38,16 +38,17 @@ on:
3838
ref:
3939
type: string
4040
required: True
41+
description: |
42+
Commit SHA or branch to checkout the intel/llvm repo.
4143
devops_ref:
4244
type: string
4345
required: False
4446
description: |
45-
By default we checkout the devops directory from "inputs.ref" branch.
46-
devops_ref may be specified to checkout the devops dir from different
47-
branch.
48-
Note: it doesn't affect ./devops/actions/run-tests/* as these actions
49-
call checkout again and therefore override the devops directory, so
50-
configs/dependecies from input.ref are used.
47+
Commit SHA or branch to checkout the devops directory.
48+
tests_ref:
49+
type: string
50+
required: False
51+
description: Commit SHA or branch to checkout e2e/cts tests.
5152

5253
sycl_toolchain_artifact:
5354
type: string
@@ -152,6 +153,7 @@ on:
152153
options:
153154
- e2e
154155
- cts
156+
- compute-benchmarks
155157

156158
env:
157159
description: |
@@ -297,7 +299,7 @@ jobs:
297299
if: inputs.tests_selector == 'e2e'
298300
uses: ./devops/actions/run-tests/e2e
299301
with:
300-
ref: ${{ inputs.ref || github.sha }}
302+
ref: ${{ inputs.tests_ref || inputs.ref || github.sha }}
301303
binaries_artifact: ${{ inputs.e2e_binaries_artifact }}
302304
testing_mode: ${{ inputs.e2e_testing_mode }}
303305
extra_cmake_args: ${{ inputs.extra_cmake_args }}
@@ -309,8 +311,18 @@ jobs:
309311
if: inputs.tests_selector == 'cts'
310312
uses: ./devops/actions/run-tests/cts
311313
with:
314+
ref: ${{ inputs.tests_ref || 'main' }}
312315
extra_cmake_args: ${{ inputs.extra_cmake_args }}
313316
cts_testing_mode: ${{ inputs.cts_testing_mode }}
314317
sycl_cts_artifact: ${{ inputs.sycl_cts_artifact }}
315318
target_devices: ${{ inputs.target_devices }}
316319
retention-days: ${{ inputs.retention-days }}
320+
321+
- name: Run compute-benchmarks on SYCL
322+
if: inputs.tests_selector == 'compute-benchmarks'
323+
uses: ./devops/actions/run-tests/benchmark
324+
with:
325+
target_devices: ${{ inputs.target_devices }}
326+
env:
327+
RUNNER_TAG: ${{ inputs.runner }}
328+
GITHUB_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }}

.github/workflows/sycl-nightly.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ jobs:
108108
runner: '["Linux", "arc"]'
109109
image_options: -u 1001
110110
target_devices: opencl:cpu
111+
112+
- name: Preview mode on SPR/PVC
113+
runner: '["Linux", "pvc"]'
114+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
115+
target_devices: level_zero:gpu
116+
extra_lit_opts: --param test-preview-mode=True
117+
111118
uses: ./.github/workflows/sycl-linux-run-tests.yml
112119
with:
113120
name: ${{ matrix.name }}
@@ -236,6 +243,46 @@ jobs:
236243
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
237244
sycl_cts_artifact: sycl_cts_bin
238245

246+
aggregate_benchmark_results:
247+
if: always() && !cancelled()
248+
name: Aggregate benchmark results and produce historical averages
249+
uses: ./.github/workflows/sycl-benchmark-aggregate.yml
250+
secrets:
251+
LLVM_SYCL_BENCHMARK_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }}
252+
with:
253+
lookback_days: 100
254+
255+
run-sycl-benchmarks:
256+
needs: [ubuntu2204_build, aggregate_benchmark_results]
257+
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
258+
strategy:
259+
fail-fast: false
260+
matrix:
261+
include:
262+
- name: Run compute-benchmarks on L0 Gen12
263+
runner: '["Linux", "gen12"]'
264+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
265+
target_devices: level_zero:gpu
266+
reset_intel_gpu: true
267+
- name: Run compute-benchmarks on L0 PVC
268+
runner: '["Linux", "pvc"]'
269+
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
270+
target_devices: level_zero:gpu
271+
reset_intel_gpu: false
272+
uses: ./.github/workflows/sycl-linux-run-tests.yml
273+
secrets: inherit
274+
with:
275+
name: ${{ matrix.name }}
276+
runner: ${{ matrix.runner }}
277+
image_options: ${{ matrix.image_options }}
278+
target_devices: ${{ matrix.target_devices }}
279+
tests_selector: compute-benchmarks
280+
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
281+
ref: ${{ github.sha }}
282+
sycl_toolchain_artifact: sycl_linux_default
283+
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
284+
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
285+
239286
nightly_build_upload:
240287
name: Nightly Build Upload
241288
if: ${{ github.ref_name == 'sycl' }}
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
name: Benchmarks Reusable
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
str_name:
7+
required: true
8+
type: string
9+
pr_no:
10+
required: true
11+
# even though this is a number, this is a workaround for issues with
12+
# reusable workflow calls that result in "Unexpected value '0'" error.
13+
type: string
14+
bench_script_params:
15+
required: false
16+
type: string
17+
default: ''
18+
sycl_config_params:
19+
required: false
20+
type: string
21+
default: ''
22+
upload_report:
23+
required: false
24+
type: boolean
25+
default: false
26+
compute_runtime_commit:
27+
required: false
28+
type: string
29+
default: ''
30+
31+
permissions:
32+
contents: read
33+
pull-requests: write
34+
35+
jobs:
36+
bench-run:
37+
name: Build SYCL, Run Benchmarks
38+
strategy:
39+
matrix:
40+
adapter: [
41+
{str_name: "${{ inputs.str_name }}",
42+
sycl_config: "${{ inputs.sycl_config_params }}"
43+
}
44+
]
45+
build_type: [Release]
46+
compiler: [{c: clang, cxx: clang++}]
47+
48+
runs-on: "PVC_PERF"
49+
50+
steps:
51+
- name: Add comment to PR
52+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
53+
if: ${{ always() && inputs.pr_no != 0 }}
54+
with:
55+
script: |
56+
const pr_no = '${{ inputs.pr_no }}';
57+
const adapter = '${{ matrix.adapter.str_name }}';
58+
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
59+
const params = '${{ inputs.bench_script_params }}';
60+
const body = `Compute Benchmarks ${adapter} run (with params: ${params}):\n${url}`;
61+
62+
github.rest.issues.createComment({
63+
issue_number: pr_no,
64+
owner: context.repo.owner,
65+
repo: context.repo.repo,
66+
body: body
67+
})
68+
69+
- name: Checkout SYCL
70+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
71+
with:
72+
path: sycl-repo
73+
74+
# We need to fetch special ref for proper PR's merge commit. Note, this ref may be absent if the PR is already merged.
75+
- name: Fetch PR's merge commit
76+
if: ${{ inputs.pr_no != 0 }}
77+
working-directory: ${{github.workspace}}/sycl-repo
78+
run: |
79+
git fetch -- https://github.com/${{github.repository}} +refs/pull/${{ inputs.pr_no }}/*:refs/remotes/origin/pr/${{ inputs.pr_no }}/*
80+
git checkout origin/pr/${{ inputs.pr_no }}/merge
81+
git rev-parse origin/pr/${{ inputs.pr_no }}/merge
82+
83+
- name: Install pip packages
84+
run: |
85+
pip install --force-reinstall -r ${{github.workspace}}/sycl-repo/unified-runtime/scripts/benchmarks/requirements.txt
86+
87+
- name: Configure SYCL
88+
run: >
89+
python3 sycl-repo/buildbot/configure.py
90+
-t ${{matrix.build_type}}
91+
-o ${{github.workspace}}/sycl_build
92+
--cmake-gen "Ninja"
93+
--cmake-opt="-DLLVM_INSTALL_UTILS=ON"
94+
--cmake-opt="-DSYCL_PI_TESTS=OFF"
95+
--cmake-opt=-DCMAKE_C_COMPILER_LAUNCHER=ccache
96+
--cmake-opt=-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
97+
${{matrix.adapter.sycl_config}}
98+
99+
- name: Build SYCL
100+
run: cmake --build ${{github.workspace}}/sycl_build -j $(nproc)
101+
102+
# We need a complete installed UR for compute-benchmarks.
103+
- name: Configure UR
104+
run: >
105+
cmake -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
106+
-S${{github.workspace}}/sycl-repo/unified-runtime
107+
-B${{github.workspace}}/ur_build
108+
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/ur_install
109+
-DUR_BUILD_TESTS=OFF
110+
-DUR_BUILD_ADAPTER_L0=ON
111+
-DUR_BUILD_ADAPTER_L0_V2=ON
112+
-DUMF_DISABLE_HWLOC=ON
113+
114+
- name: Build UR
115+
run: cmake --build ${{github.workspace}}/ur_build -j $(nproc)
116+
117+
- name: Install UR
118+
run: cmake --install ${{github.workspace}}/ur_build
119+
120+
- name: Compute core range
121+
run: |
122+
# Compute the core range for the first NUMA node; second node is for UMF jobs.
123+
# Skip the first 4 cores - the kernel is likely to schedule more work on these.
124+
CORES="$(lscpu | awk '
125+
/NUMA node0 CPU|On-line CPU/ {line=$0}
126+
END {
127+
split(line, a, " ")
128+
split(a[4], b, ",")
129+
sub(/^0/, "4", b[1])
130+
print b[1]
131+
}')"
132+
echo "Selected core: $CORES"
133+
echo "CORES=$CORES" >> $GITHUB_ENV
134+
135+
ZE_AFFINITY_MASK=0
136+
echo "ZE_AFFINITY_MASK=$ZE_AFFINITY_MASK" >> $GITHUB_ENV
137+
138+
- name: Run benchmarks
139+
working-directory: ${{ github.workspace }}
140+
id: benchmarks
141+
run: >
142+
taskset -c "${{ env.CORES }}" ${{ github.workspace }}/sycl-repo/unified-runtime/scripts/benchmarks/main.py
143+
~/llvm_bench_workdir
144+
--sycl ${{ github.workspace }}/sycl_build
145+
--ur ${{ github.workspace }}/ur_install
146+
--adapter ${{ matrix.adapter.str_name }}
147+
--compare baseline
148+
--compute-runtime ${{ inputs.compute_runtime_commit }}
149+
--build-igc
150+
${{ inputs.upload_report && '--output-html' || '' }}
151+
${{ inputs.pr_no != 0 && '--output-markdown' || '' }}
152+
${{ inputs.bench_script_params }}
153+
154+
- name: Print benchmark results
155+
run: |
156+
cat ${{ github.workspace }}/benchmark_results.md || true
157+
158+
- name: Add comment to PR
159+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
160+
if: ${{ always() && inputs.pr_no != 0 }}
161+
with:
162+
script: |
163+
let markdown = ""
164+
try {
165+
const fs = require('fs');
166+
markdown = fs.readFileSync('benchmark_results.md', 'utf8');
167+
} catch(err) {
168+
}
169+
170+
const pr_no = '${{ inputs.pr_no }}';
171+
const adapter = '${{ matrix.adapter.str_name }}';
172+
const url = '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}';
173+
const test_status = '${{ steps.benchmarks.outcome }}';
174+
const job_status = '${{ job.status }}';
175+
const params = '${{ inputs.bench_script_params }}';
176+
const body = `Benchmarks ${adapter} run (${params}):\n${url}\nJob status: ${job_status}. Test status: ${test_status}.\n ${markdown}`;
177+
178+
github.rest.issues.createComment({
179+
issue_number: pr_no,
180+
owner: context.repo.owner,
181+
repo: context.repo.repo,
182+
body: body
183+
})
184+
185+
- name: Rename benchmark results file
186+
if: ${{ always() && inputs.upload_report }}
187+
run: mv benchmark_results.html benchmark_results_${{ inputs.pr_no }}.html
188+
189+
- name: Upload HTML report
190+
if: ${{ always() && inputs.upload_report }}
191+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
192+
with:
193+
path: benchmark_results_${{ inputs.pr_no }}.html
194+
key: benchmark-results-${{ inputs.pr_no }}-${{ matrix.adapter.str_name }}-${{ github.run_id }}
195+
196+
- name: Get information about platform
197+
if: ${{ always() }}
198+
run: ${{github.workspace}}/sycl-repo/unified-runtime/.github/scripts/get_system_info.sh

0 commit comments

Comments
 (0)