Skip to content

[CI] Add CI workflow to run compute-benchmarks on incoming syclos PRs #14454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 200 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
1276f39
[SYCL] Introduce PoC benchmarking option into sycl-linux-run-tests
ianayl Jul 3, 2024
754c33a
[SYCL] Fix EOF character for sycl-linux-run-tests
ianayl Jul 3, 2024
9981c3a
[SYCL] Fix: Make benchmarking script executable
ianayl Jul 3, 2024
3ed35ca
[SYCL] Bug fix on sycl-bench.sh
ianayl Jul 3, 2024
6ea0110
[SYCL] Amend workflow as per review in #14351
ianayl Jul 4, 2024
6d14a32
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Jul 4, 2024
940e3be
Complete redo of workflow, switch to compute-benchmarks
ianayl Sep 6, 2024
7aafdf5
Add safeguards and update usage(), names
ianayl Sep 12, 2024
24b5169
Change SYCL_PI_TRACE to SYCL_UR_TRACE
ianayl Sep 12, 2024
b2d4463
Test commit to learn more about the workflow
ianayl Sep 12, 2024
5f1cd57
Test commit to integrate building into the workflow
ianayl Sep 12, 2024
7a889f8
Refactor benchmarks out of sycl e2e
ianayl Sep 12, 2024
6e1b3bb
Re-enable benchmarks for testing purposes
ianayl Sep 12, 2024
5d1dea4
temporarily hijack precommit for testing
ianayl Sep 12, 2024
991cd55
temporarily enable benchmark
ianayl Sep 12, 2024
6e141e8
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Sep 12, 2024
8a5ecb6
Set CMPLR_ROOT for run
ianayl Sep 12, 2024
606c02a
Test pushing
ianayl Sep 12, 2024
5dd976e
Enable more debugging
ianayl Sep 12, 2024
6c83d2b
disable post commit temporarily for testing purposes, turn down paral…
ianayl Sep 12, 2024
5266cac
disable ccache
ianayl Sep 12, 2024
ab17254
Take benchmarking out of sycl-linux-run-tests
ianayl Sep 13, 2024
45a93ba
Fix leftover chars
ianayl Sep 13, 2024
a4a1c03
Add missing fields
ianayl Sep 13, 2024
52f5dc3
Disable windows, fix missing fields
ianayl Sep 13, 2024
90575fe
ammend permissions
ianayl Sep 13, 2024
8dfeff6
ammend boolean matching
ianayl Sep 13, 2024
3346a09
change ssh key directory
ianayl Sep 13, 2024
3a28ded
Added options to disable caching
ianayl Sep 16, 2024
e67c29f
attempt to introduce aggregate
ianayl Sep 17, 2024
88f8b3b
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Sep 17, 2024
e6cbc2e
changed permissions to allow aggregate
ianayl Sep 17, 2024
c6645aa
further write permission correction
ianayl Sep 17, 2024
867e6e6
further read permission correction
ianayl Sep 17, 2024
18ff8b1
test amendmnet of build permissions
ianayl Sep 17, 2024
cc29c23
Initial support for time ranges
ianayl Sep 17, 2024
3b5454f
Fixed aggregate, improved logging
ianayl Sep 18, 2024
6ed0361
Change repo used
ianayl Sep 18, 2024
f54e1d2
Resolve issue with using two action/checkout's
ianayl Sep 18, 2024
47693f9
amend location of aggregate
ianayl Sep 18, 2024
f1d3a7f
amend location of aggregate
ianayl Sep 18, 2024
652667f
fix timestamp format in common
ianayl Sep 18, 2024
be75574
fix missing $
ianayl Sep 18, 2024
1200217
fix missing $
ianayl Sep 18, 2024
97b2d4f
exit on error
ianayl Sep 19, 2024
08da292
exit on error
ianayl Sep 19, 2024
441bc10
update config to trigger new run
ianayl Sep 20, 2024
8979115
update config to trigger new run
ianayl Sep 20, 2024
7fa6a2e
Fix up typo
ianayl Sep 20, 2024
1074e42
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Oct 15, 2024
21498b4
Revert permissions on previous files
ianayl Oct 16, 2024
8506c20
Amend permissions to be more strict
ianayl Oct 16, 2024
c2835cd
Amend permissions on aggregate
ianayl Oct 16, 2024
51cdaee
Fix bug with permissions
ianayl Oct 16, 2024
ef6a085
Revert amend
ianayl Oct 16, 2024
2fd6b7b
Amend benchmarks permissions
ianayl Oct 16, 2024
1d5c676
Make build permissions more restrictive
ianayl Oct 16, 2024
c20d75e
Amend benchmark permissions
ianayl Oct 16, 2024
a9dad80
Try new config file loading
ianayl Oct 22, 2024
0c3e901
Fixed sed expression
ianayl Oct 22, 2024
12326ce
trigger workflow
ianayl Oct 22, 2024
4335bf9
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Oct 28, 2024
ba29015
Added iteration options, changed build to each case
ianayl Oct 30, 2024
90fe17f
Add debug prints
ianayl Oct 30, 2024
59e38fe
Make changes to the debug prints
ianayl Oct 30, 2024
d212adc
Upped number of iterations
ianayl Oct 30, 2024
321d83a
increase iterations
ianayl Nov 11, 2024
ba3c45c
Test PVC
ianayl Nov 26, 2024
81fb277
Merge branch 'sycl' into benchmarking-workflow
ianayl Nov 26, 2024
e8178c5
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Jan 2, 2025
410666e
disable igc dev for now
ianayl Jan 2, 2025
c32ad36
fix benchmarking
ianayl Jan 2, 2025
b5fa113
fix benchmarking
ianayl Jan 2, 2025
0ae396d
Introduce separating of results based on runners
ianayl Jan 10, 2025
5d8f864
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Jan 15, 2025
fda62fc
Fix merge fault
ianayl Jan 15, 2025
0a083b8
undo change to build
ianayl Jan 16, 2025
e58248d
Redo changes to build
ianayl Jan 16, 2025
8091ed0
expand build perms
ianayl Jan 16, 2025
d142575
propagate expanded permissions
ianayl Jan 16, 2025
c77f967
Give more perms to benchmark
ianayl Jan 16, 2025
c04ccaa
Remove write perms
ianayl Jan 16, 2025
e4897d5
remove unnecessary permission grant
ianayl Jan 16, 2025
a5b7e23
Remove further write perms
ianayl Jan 16, 2025
6a12cf4
expand benchmark perms
ianayl Jan 16, 2025
f027f8e
Clean up some files before review
ianayl Jan 16, 2025
08388fa
Enable more tests
ianayl Jan 17, 2025
9f7b0ff
Remove non-sycl tests, clean up code
ianayl Jan 17, 2025
30bd28c
Amend bad test case names
ianayl Jan 17, 2025
a3b0487
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Jan 17, 2025
0e4bb7f
Put benchmarking back into sycl-linux-run-tests
ianayl Jan 18, 2025
74bd73c
add benchmark option to sycl-linux-run-tests
ianayl Jan 18, 2025
0282c0a
parallelize aggregate again:
ianayl Jan 18, 2025
66a51f3
Restore CI testing
ianayl Jan 20, 2025
5173a0d
Conditional dependency on aggregate if benchmarking
ianayl Jan 20, 2025
d5a9468
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Jan 20, 2025
867fc5a
Attempt to correct syntax
ianayl Jan 20, 2025
168325f
Add dependency on benchmark_aggregate
ianayl Jan 20, 2025
cf599c0
fix conditional for aggregate
ianayl Jan 20, 2025
96ad8dd
try to trigger aggregate
ianayl Jan 21, 2025
a4f1d5e
try to trigger aggregate
ianayl Jan 21, 2025
7bf79fd
try to trigger aggregate
ianayl Jan 21, 2025
23a21e9
try to trigger aggregate
ianayl Jan 21, 2025
c1c7313
Enable nightly
ianayl Jan 21, 2025
3bdf383
added extra debugging to sus out where the working directories are
ianayl Jan 21, 2025
e9425f5
Prepare workflows for git tokens, add comments
ianayl Jan 21, 2025
6e889d4
Sanitize workflow config variables
ianayl Jan 22, 2025
e158a70
Figure out where aggregate runner paths are
ianayl Jan 22, 2025
bfedd09
Fix paths, update load_single_config
ianayl Jan 22, 2025
d5bfa08
Fix missing apostrophe
ianayl Jan 22, 2025
02428d6
Fix cutoff format
ianayl Jan 22, 2025
54b8fd4
fixed glaring python issues
ianayl Jan 22, 2025
acd1931
Add more documentation
ianayl Jan 22, 2025
38c9bed
Fix bad merges from before
ianayl Jan 22, 2025
6193059
Appease check formatting
ianayl Jan 22, 2025
fcbbe52
Change folder structure
ianayl Jan 23, 2025
e5a12b8
fix bad options in benchmark.sh
ianayl Jan 23, 2025
cf886e9
Apparently posix shell doesn't have herestrings
ianayl Jan 23, 2025
e434d74
Fix config
ianayl Jan 23, 2025
ec8b2f0
add extra debug prints
ianayl Jan 23, 2025
3936328
fix bug
ianayl Jan 23, 2025
dff86d2
add debug for timestamp
ianayl Jan 23, 2025
371097d
oops
ianayl Jan 23, 2025
619c86b
Upload uncached results to artifactory
ianayl Jan 23, 2025
792769e
Update artifacts
ianayl Jan 23, 2025
ec369cd
Fix bug
ianayl Jan 23, 2025
3f1666f
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Jan 23, 2025
07bca84
Fix repository secrets not propagating
ianayl Jan 24, 2025
5d5c755
Improve artifacts
ianayl Jan 24, 2025
40e8b9b
bug fixes
ianayl Jan 24, 2025
7bf8043
needs newline
ianayl Jan 24, 2025
3d366ae
forgot to load artifact path
ianayl Jan 24, 2025
98b1acf
fix artifact path
ianayl Jan 24, 2025
4c13ae7
Move configs out of scripts directory
ianayl Jan 24, 2025
ba9da64
Split config loading into constants and options
ianayl Jan 25, 2025
798e16b
Remove old lines
ianayl Jan 25, 2025
0dea393
Preliminary impl of python config loading, new configs, and changes r…
ianayl Jan 31, 2025
3252b59
Fix typo
ianayl Jan 31, 2025
37612f5
Fix bug
ianayl Jan 31, 2025
6f5074f
Fix bug with timestamp
ianayl Jan 31, 2025
efef394
Sanitize tests conf
ianayl Jan 31, 2025
93456e0
Amend config loading to python, split aggregate workflow
ianayl Feb 3, 2025
625c72f
Fix bug
ianayl Feb 3, 2025
0faada5
fix bug
ianayl Feb 3, 2025
c256b5c
Fix issue with double cloning
ianayl Feb 3, 2025
ab29ffc
Add missing arugment
ianayl Feb 3, 2025
337c51e
fix bugs
ianayl Feb 3, 2025
cdea68d
fix bug
ianayl Feb 3, 2025
beb2942
fix bug
ianayl Feb 3, 2025
f4d8a3f
fix bug
ianayl Feb 3, 2025
572ff7e
Shuffle testing to the end
ianayl Feb 3, 2025
412449e
Hardcode all paths
ianayl Feb 3, 2025
2951b37
apply clang-format
ianayl Feb 3, 2025
bce5229
Remove cutoff timestamp behavior for aggregate
ianayl Feb 3, 2025
5c25a95
Fix typo
ianayl Feb 3, 2025
3e01431
Fix small formatting issues and add comments here and there
ianayl Feb 4, 2025
82c1248
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Feb 4, 2025
ff8675a
fix bug
ianayl Feb 4, 2025
6751d2b
fix bug
ianayl Feb 4, 2025
472c6be
Remove redundant specification of docker image
ianayl Feb 4, 2025
1953dab
Fix bug with regex
ianayl Feb 4, 2025
a48a3d2
Didn't know + was extended regex
ianayl Feb 4, 2025
28798c8
Better messages
ianayl Feb 4, 2025
4e59fb6
Apply clang-format
ianayl Feb 4, 2025
2433d88
Test newly updated compute benchmarks
ianayl Feb 5, 2025
41d664a
added test case name validation to benchmark.sh, added additional san…
ianayl Feb 7, 2025
bc30802
Added extra sanitation for DEVOPS_PATH
ianayl Feb 7, 2025
24d10fa
change from benchmark to compute-benchmarks
ianayl Feb 10, 2025
289d9c5
bump lookback days
ianayl Feb 10, 2025
b7b8821
Fix logic with samples_under_threshold
ianayl Feb 10, 2025
d028580
Fix missing dir when uploading
ianayl Feb 10, 2025
4438530
I now realize why the other git workflows had an arbitrary pull
ianayl Feb 11, 2025
2ff3e49
Enable support only for pvc, gen12
ianayl Feb 11, 2025
4c1c0f0
Typo
ianayl Feb 11, 2025
eb5ece2
Use new intel repo for results
ianayl Feb 11, 2025
2484960
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Feb 12, 2025
5a90573
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Feb 18, 2025
c8c1a99
Fix bug catching error codes from compute-benchmarks
ianayl Feb 18, 2025
3c85d5a
Restrict compute-benchmarks to certain commits
ianayl Feb 19, 2025
d5b5a5b
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Feb 19, 2025
5a8cbe6
Remove testing for aggregate
ianayl Feb 19, 2025
55d339c
Changes to comments
ianayl Feb 19, 2025
43d67cb
Fix missing actions path
ianayl Feb 19, 2025
8a6a48a
Add github secret
ianayl Feb 19, 2025
5cc455b
Fix extra env statement
ianayl Feb 19, 2025
97d0c2f
Skip push if no changes
ianayl Feb 19, 2025
f5633a1
Inherit secrets
ianayl Feb 19, 2025
d4c8d14
Pass secrets from workflows
ianayl Feb 19, 2025
07f2966
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Feb 20, 2025
a3874d5
Fix conditional to check for difference
ianayl Feb 20, 2025
bbb16f4
Forgot shell truncates before the pipe
ianayl Feb 20, 2025
cb6c2e2
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl Feb 20, 2025
056c724
Enforce fail on regression
ianayl Feb 20, 2025
f2603bf
Enforce failures
ianayl Feb 20, 2025
489372a
fix benchmark
ianayl Feb 20, 2025
0bdbc5c
Revert "fix benchmark"
ianayl Feb 20, 2025
137edef
fix benchmark name in nightly
ianayl Feb 20, 2025
e4496f2
Inherit secrets in nightly
ianayl Feb 21, 2025
9345dc0
Fix bad naming after removing constants
ianayl Feb 21, 2025
8df9b21
apply clang-format
ianayl Feb 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/sycl-benchmark-aggregate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Aggregate compute-benchmark averages from historical data

# The benchmarking workflow in sycl-linux-run-tests.yml passes or fails based on
# how the benchmark results compare to a historical average: This historical
# average is calculated in this workflow, which aggregates historical data and
# produces measures of central tendency (median in this case) used for this
# purpose.

on:
workflow_dispatch:
inputs:
lookback_days:
description: |
Number of days from today to look back in historical results for:
This sets the age limit of data used in average calculation: Any
benchmark results created before `lookback_days` from today is
excluded from being aggregated in the historical average.
type: number
required: true
workflow_call:
inputs:
lookback_days:
type: number
required: true
secrets:
LLVM_SYCL_BENCHMARK_TOKEN:
description: |
Github token used by the faceless account to push newly calculated
medians.
required: true


permissions:
contents: read

jobs:
aggregate:
name: Aggregate average (median) value for all metrics
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
devops/scripts/benchmarking
devops/benchmarking
devops/actions/benchmarking
- name: Aggregate benchmark results and produce historical average
uses: ./devops/actions/benchmarking/aggregate
with:
lookback_days: ${{ inputs.lookback_days }}
env:
GITHUB_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }}
12 changes: 11 additions & 1 deletion .github/workflows/sycl-linux-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
required: False
tests_selector:
description: |
Two possible options: "e2e" and "cts".
Three possible options: "e2e", "cts", and "compute-benchmarks".
type: string
default: "e2e"

Expand Down Expand Up @@ -152,6 +152,7 @@ on:
options:
- e2e
- cts
- compute-benchmarks

env:
description: |
Expand Down Expand Up @@ -314,3 +315,12 @@ jobs:
sycl_cts_artifact: ${{ inputs.sycl_cts_artifact }}
target_devices: ${{ inputs.target_devices }}
retention-days: ${{ inputs.retention-days }}

- name: Run compute-benchmarks on SYCL
if: inputs.tests_selector == 'compute-benchmarks'
uses: ./devops/actions/run-tests/benchmark
with:
target_devices: ${{ inputs.target_devices }}
env:
RUNNER_TAG: ${{ inputs.runner }}
GITHUB_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/sycl-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,46 @@ jobs:
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}
sycl_cts_artifact: sycl_cts_bin

aggregate_benchmark_results:
if: always() && !cancelled()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ianayl hi, likely there should also be github.repository == 'intel/llvm' && ... to avoid running this in forks. @intel/dpcpp-devops-reviewers FYI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw: fix for this is in #17122, I will merge after I do some final testing with my tuning here

name: Aggregate benchmark results and produce historical averages
uses: ./.github/workflows/sycl-benchmark-aggregate.yml
secrets:
LLVM_SYCL_BENCHMARK_TOKEN: ${{ secrets.LLVM_SYCL_BENCHMARK_TOKEN }}
with:
lookback_days: 100

run-sycl-benchmarks:
needs: [ubuntu2204_build, aggregate_benchmark_results]
if: ${{ always() && !cancelled() && needs.ubuntu2204_build.outputs.build_conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
include:
- name: Run compute-benchmarks on L0 Gen12
runner: '["Linux", "gen12"]'
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu
reset_intel_gpu: true
- name: Run compute-benchmarks on L0 PVC
runner: '["Linux", "pvc"]'
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
target_devices: level_zero:gpu
reset_intel_gpu: false
uses: ./.github/workflows/sycl-linux-run-tests.yml
secrets: inherit
with:
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
image_options: ${{ matrix.image_options }}
target_devices: ${{ matrix.target_devices }}
tests_selector: compute-benchmarks
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
ref: ${{ github.sha }}
sycl_toolchain_artifact: sycl_linux_default
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
sycl_toolchain_decompress_command: ${{ needs.ubuntu2204_build.outputs.artifact_decompress_command }}

nightly_build_upload:
name: Nightly Build Upload
if: ${{ github.ref_name == 'sycl' }}
Expand Down
95 changes: 95 additions & 0 deletions devops/actions/benchmarking/aggregate/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: 'Aggregate compute-benchmark results and produce historical averages'

# The benchmarking workflow in sycl-linux-run-tests.yml passes or fails based on
# how the benchmark results compare to a historical average: This historical
# average is calculated in this composite workflow, which aggregates historical
# data and produces measures of central tendency (median in this case) used for
# this purpose.
#
# This action assumes that /devops has been checked out in ./devops. This action
# also assumes that GITHUB_TOKEN was properly set in env, because according to
# Github, that's apparently the recommended way to pass a secret into a github
# action:
#
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#accessing-your-secrets
#

inputs:
lookback_days:
type: number
required: true

runs:
using: "composite"
steps:
- name: Obtain oldest timestamp allowed for data in aggregation
shell: bash
run: |
# DO NOT use inputs.lookback_days directly, only use SANITIZED_TIMESTAMP.
SANITIZED_LOOKBACK_DAYS="$(echo '${{ inputs.lookback_days }}' | grep -oE '^[0-9]+$')"
if [ -z "$SANITIZED_LOOKBACK_DAYS" ]; then
echo "Please ensure inputs.lookback_days is a number."
exit 1
fi
SANITIZED_TIMESTAMP="$(date -d "$SANITIZED_LOOKBACK_DAYS days ago" +%Y%m%d_%H%M%S)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to apply grep filter on 'date' output with following -z check as well (same approach as for $SANITIZED_LOOKBACK_DAYS)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@offsake Mind if I ask your thinking behind this? Are you trying to make sure the date executable hasn't been tampered with?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone ahead and made the changes anyway, but an explanation would still be appreciated; thanks!

if [ -z "$(echo "$SANITIZED_TIMESTAMP" | grep -oE '^[0-9]{8}_[0-9]{6}$' )" ]; then
echo "Invalid timestamp generated: is inputs.lookback_days valid?"
exit 1
fi
echo "SANITIZED_TIMESTAMP=$SANITIZED_TIMESTAMP" >> $GITHUB_ENV
- name: Load benchmarking configuration
shell: bash
run: |
$(python ./devops/scripts/benchmarking/load_config.py ./devops constants)
echo "SANITIZED_PERF_RES_GIT_REPO=$SANITIZED_PERF_RES_GIT_REPO" >> $GITHUB_ENV
echo "SANITIZED_PERF_RES_GIT_BRANCH=$SANITIZED_PERF_RES_GIT_BRANCH" >> $GITHUB_ENV
- name: Checkout historical performance results repository
shell: bash
run: |
if [ ! -d ./llvm-ci-perf-results ]; then
git clone -b "$SANITIZED_PERF_RES_GIT_BRANCH" "https://github.com/$SANITIZED_PERF_RES_GIT_REPO" ./llvm-ci-perf-results
fi
- name: Run aggregator on historical results
shell: bash
run: |
# The current format of the historical results respository is:
#
# /<ONEAPI_DEVICE_SELECTOR>/<runner>/<test name>
#
# Thus, a min/max depth of 3 is used to enumerate all test cases in the
# repository. Test name is also derived from here.
find ./llvm-ci-perf-results -mindepth 3 -maxdepth 3 -type d ! -path '*.git*' |
while read -r dir; do
test_name="$(basename "$dir")"
python ./devops/scripts/benchmarking/aggregate.py ./devops "$test_name" "$dir" "$SANITIZED_TIMESTAMP"
done
- name: Upload average to the repo
shell: bash
run: |
cd ./llvm-ci-perf-results
git config user.name "SYCL Benchmarking Bot"
git config user.email "[email protected]"
git pull
# Make sure changes have been made
if git diff --quiet && git diff --cached --quiet; then
echo "No changes to median, skipping push."
else
git add .
git commit -m "[GHA] Aggregate median data from $SANITIZED_TIMESTAMP to $(date +%Y%m%d_%H%M%S)"
git push "https://[email protected]/$SANITIZED_PERF_RES_GIT_REPO.git" "$SANITIZED_PERF_RES_GIT_BRANCH"
fi
- name: Find aggregated average results artifact here
if: always()
shell: bash
run: |
cat << EOF
#
# Artifact link for aggregated averages here:
#
EOF
- name: Archive new medians
if: always()
uses: actions/upload-artifact@v4
with:
name: llvm-ci-perf-results new medians
path: ./llvm-ci-perf-results/**/*-median.csv
107 changes: 107 additions & 0 deletions devops/actions/run-tests/benchmark/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: 'Run compute-benchmarks'

# Run compute-benchmarks on SYCL
#
# This action assumes SYCL is in ./toolchain, and that /devops has been
# checked out in ./devops. This action also assumes that GITHUB_TOKEN
# was properly set in env, because according to Github, that's apparently the
# recommended way to pass a secret into a github action:
#
# https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#accessing-your-secrets
#
# This action also expects a RUNNER_TAG environment variable to be set to the
# runner tag used to run this workflow: Currently, only gen12 and pvc on Linux
# are fully supported. Although this workflow won't stop you from running other
# devices, note that only gen12 and pvc has been tested to work.
#

inputs:
target_devices:
type: string
required: True

runs:
using: "composite"
steps:
- name: Check specified runner type / target backend
shell: bash
env:
TARGET_DEVICE: ${{ inputs.target_devices }}
run: |
case "$RUNNER_TAG" in
'["Linux", "gen12"]' | '["Linux", "pvc"]') ;;
*)
echo "#"
echo "# WARNING: Only gen12/pvc on Linux is fully supported."
echo "# This workflow is not guaranteed to work with other runners."
echo "#" ;;
esac

# input.target_devices is not directly used, as this allows code injection
case "$TARGET_DEVICE" in
level_zero:*) ;;
*)
echo "#"
echo "# WARNING: Only level_zero backend is fully supported."
echo "# This workflow is not guaranteed to work with other backends."
echo "#" ;;
esac
- name: Run compute-benchmarks
shell: bash
run: |
cat << EOF
#
# NOTE TO DEVELOPERS:
#

Check latter steps of the workflow: This job produces an artifact with:
- benchmark results from passing/failing tests
- log containing all failing (too slow) benchmarks
- log containing all erroring benchmarks

While this step in the workflow provides debugging output describing this
information, it might be easier to inspect the logs from the artifact
instead.

EOF
export ONEAPI_DEVICE_SELECTOR="${{ inputs.target_devices }}"
export CMPLR_ROOT=./toolchain
echo "-----"
sycl-ls
echo "-----"
./devops/scripts/benchmarking/benchmark.sh -n '${{ runner.name }}' -s || exit 1
- name: Push compute-benchmarks results
if: always()
shell: bash
run: |
# TODO -- waiting on security clearance
# Load configuration values
$(python ./devops/scripts/benchmarking/load_config.py ./devops constants)

cd "./llvm-ci-perf-results"
git config user.name "SYCL Benchmarking Bot"
git config user.email "[email protected]"
git pull
git add .
# Make sure changes have been made
if git diff --quiet && git diff --cached --quiet; then
echo "No new results added, skipping push."
else
git commit -m "[GHA] Upload compute-benchmarks results from https://github.com/intel/llvm/actions/runs/${{ github.run_id }}"
git push "https://[email protected]/$SANITIZED_PERF_RES_GIT_REPO.git" "$SANITIZED_PERF_RES_GIT_BRANCH"
fi
- name: Find benchmark result artifact here
if: always()
shell: bash
run: |
cat << EOF
#
# Artifact link for benchmark results here:
#
EOF
- name: Archive compute-benchmark results
if: always()
uses: actions/upload-artifact@v4
with:
name: Compute-benchmark run ${{ github.run_id }} (${{ runner.name }})
path: ./artifact
44 changes: 44 additions & 0 deletions devops/benchmarking/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
;
; This file contains configuration options to change the behaviour of the
; benchmarking workflow in sycl-linux-run-tests.yml.
;
; DO NOT USE THE CONTENTS OF THIS FILE DIRECTLY -- Due to security concerns, The
; contents of this file must be sanitized first before use.
; See: /devops/scripts/benchmarking/common.py
;

; Compute-benchmark compile/run options
[compute_bench]
; Value for -j during compilation of compute-benchmarks
compile_jobs = 2
; Number of iterations to run compute-benchmark tests
iterations = 100

; Options for benchmark result metrics (to record/compare against)
[metrics]
; Sets the metrics to record/aggregate in the historical average.
; Format: comma-separated list of column names in compute-benchmark results
recorded = Median,StdDev
; Sets the tolerance for each recorded metric and their allowed deviation from
; the historical average. Metrics not included here are not compared against
; when passing/failing benchmark results.
; Format: comma-separated list of <metric>:<deviation percentage in decimals>
tolerances = Median:0.5

; Options for computing historical averages
[average]
; Number of days (from today) to look back for results when computing historical
; average
cutoff_range = 7
; Minimum number of samples required to compute a historical average
min_threshold = 3

; ONEAPI_DEVICE_SELECTOR linting/options
[device_selector]
; Backends to allow in device_selector
enabled_backends = level_zero,opencl,cuda,hip
; native_cpu is disabled

; Devices to allow in device_selector
enabled_devices = cpu,gpu
; fpga is disabled
Loading
Loading