Skip to content
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

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

Draft
wants to merge 155 commits into
base: sycl
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
155 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
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
22 changes: 14 additions & 8 deletions .github/workflows/sycl-linux-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
required: False
tests_selector:
description: |
Two possible options: "e2e" and "cts".
Three options: "e2e", "cts", "benchmark".
type: string
default: "e2e"

Expand Down Expand Up @@ -112,6 +112,7 @@ on:
options:
- e2e
- cts
- benchmark

env:
description: |
Expand Down Expand Up @@ -217,11 +218,6 @@ jobs:
uses: actions/download-artifact@v4
with:
name: ${{ inputs.sycl_toolchain_artifact }}
- name: Debug prints [workflow_run]
if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
run: |
pwd
ls
- name: Download SYCL toolchain [workflow_run]
if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
uses: actions/github-script@v7
Expand All @@ -247,8 +243,6 @@ jobs:
- name: Unzip artifact [workflow_run]
if: inputs.sycl_toolchain_artifact != '' && github.event_name == 'workflow_run'
run: |
pwd
ls
unzip ${{ inputs.sycl_toolchain_artifact }}.zip
rm ${{ inputs.sycl_toolchain_artifact }}.zip
- name: Extract/Setup SYCL toolchain
Expand Down Expand Up @@ -369,3 +363,15 @@ jobs:
grep 'exit code: [^0]' -r logs >> $GITHUB_STEP_SUMMARY

exit $ret

- name: Run sycl-bench microbenchmarks
id: run_benchmarks
if: inputs.tests_selector == 'benchmark'
run: ./devops/scripts/sycl-bench.sh https://github.com/ianayl/sycl-bench
- name: Upload sycl-bench microbenchmark results
if: inputs.tests_selector == 'benchmark' && steps.run_benchmarks.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: sycl_benchmark_res_${{ steps.run_benchmarks.outputs.TIMESTAMP }}
path: ${{ steps.run_benchmarks.outputs.BENCHMARK_RESULTS }}
retention-days: 7
Copy link
Contributor

Choose a reason for hiding this comment

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

That isn't very useful. I'd hope there are some GH actions that can draw some graphs with performance data of the project over time (if that data is "reported" properly to it).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review Andrei! Udit and I were talking about graphing this a while back: As of right now this workflow has not yet been approved, as many details regarding the workflow needs to be hashed out. However, we do plan on graphing this data if this workflow gets approved.

The current idea that I have is to store/cache benchmarks periodically over time as long-term artifacts, and then graphing it using either a python or js action. Although, I have yet to sort out the details. This may potentially be janky, so I'm open to new ideas.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we are yet to decide whether we will keep sycl-bench in intel/llvm CI. I guess we will also be exploring other micro benchmarking suites to find the ones appropriate for our use. This POC PR was just to evaluate the time it takes to run sycl-bench in CI.

105 changes: 105 additions & 0 deletions devops/scripts/sycl-bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/bin/sh

# sycl-bench.sh: Benchmark dpcpp using sycl-bench

usage () {
>&2 echo "Usage: $0 <sycl-bench git repo> [-B <sycl-bench build path>]
-B Path to clone and build sycl-bench on

This script builds and runs benchmarks from sycl-bench."
exit 1
}

clone() {
mkdir -p $SYCL_BENCH_PATH
git clone $SYCL_BENCH_GIT_REPO $SYCL_BENCH_PATH || return $?
}

build() {
cd $SYCL_BENCH_PATH
cmake -DSYCL_IMPL=dpcpp -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=./bin -S . -B ./build &&
cmake --build ./build || return $?
cd -
}

get_csv_col_index() {
# Determine the index of a column in a CSV given its title
# Usage: get_csv_col_index <benchmark output .csv file> <column name>
tmp_csv_col_i="$(cat "$1" | head -n 1 | grep -o "^.*$2," | grep -o ',' | wc -l)"
}

print_bench_res() {
# Usage: print_bench_res <benchmark output .csv file> <benchmark status code> <summary file>
if [ ! -s $1 ]; then
printf "NO OUTPUT! (Status $2)\n" | tee -a $3
return # Do not proceed if file is empty
fi

get_csv_col_index $1 run-time-mean
tmp_run_time_mean_i=$tmp_csv_col_i
get_csv_col_index $1 run-time-median
tmp_run_time_median_i=$tmp_csv_col_i
get_csv_col_index $1 run-time-throughput
tmp_run_time_throughput_i=$tmp_csv_col_i

# `sycl-bench` output seems to like inserting the header multiple times.
# Here we cache the header to make sure it prints only once:
tmp_header_title="$(cat $1 | head -n 1 | sed 's/^\# Benchmark name/benchmark/')"
tmp_result="$(cat $1 | grep '^[^\#]')"

printf "%s\n%s" "$tmp_header_title" "$tmp_result" \
| awk -F',' -v me="$tmp_run_time_mean_i" \
-v md="$tmp_run_time_median_i" \
-v th="$tmp_run_time_throughput_i" \
'{printf "%-57s %-13s %-15s %-20s\n", $1, $me, $md, $th }' \
| tee -a $3 # Print to summary file
}

# run sycl bench step
run() {
TIMESTAMP="$(date '+%Y%m%d_%H%M%S')"
mkdir "$SYCL_BENCH_PATH/build/bench-$TIMESTAMP/"
tmp_summary_file="$SYCL_BENCH_PATH/build/bench-$TIMESTAMP/summary.txt"

for file in $SYCL_BENCH_PATH/build/bin/*; do
# TODO -size should not be always 256, caution
tmp_bench_output="$SYCL_BENCH_PATH/build/bench-$TIMESTAMP/$(basename $file).csv"
tmp_bench_log="$SYCL_BENCH_PATH/build/bench-$TIMESTAMP/$(basename $file).log"

tmp_err="0"
printf "\n### Results for $(basename $file) ###\n" | tee -a $tmp_summary_file
# The pipe here suppresses errors in a way that doesn't stop github actions:
$file --output=$tmp_bench_output --no-verification --size=256 2> "$tmp_bench_log" || tmp_err=$?
print_bench_res $tmp_bench_output $tmp_err $tmp_summary_file
# Remove log if nothing logged
[ ! -s "$tmp_bench_log" ] && rm "$tmp_bench_log" || cat "$tmp_bench_log" | tee -a $tmp_summary_file
done

# Export timestamp for later use
[ -f "$GITHUB_OUTPUT" ] && echo TIMESTAMP=$TIMESTAMP >> $GITHUB_OUTPUT
}

compress() {
tar -I gzip -cf "$SYCL_BENCH_PATH/build/bench-$TIMESTAMP.tar.gz" -C "$SYCL_BENCH_PATH/build/bench-$TIMESTAMP" .
if [ -f "$SYCL_BENCH_PATH/build/bench-$TIMESTAMP.tar.gz" ] && [ -f "$GITHUB_OUTPUT" ]; then
echo BENCHMARK_RESULTS="$SYCL_BENCH_PATH/build/bench-$TIMESTAMP.tar.gz" >> $GITHUB_OUTPUT
fi
}

cleanup() {
rm -r $SYCL_BENCH_PATH
}


[ "$#" -lt "1" ] && usage

SYCL_BENCH_GIT_REPO="$1"; shift
SYCL_BENCH_PATH="./sycl-bench"
while getopts "B:" opt; do
case $opt in
B) SYCL_BENCH_PATH=$OPTARG ;;
\?) usage ;;
esac
done

clone && build && run && compress
Loading