-
Notifications
You must be signed in to change notification settings - Fork 752
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
ianayl
wants to merge
155
commits into
sycl
Choose a base branch
from
benchmarking-workflow
base: sycl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
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 754c33a
[SYCL] Fix EOF character for sycl-linux-run-tests
ianayl 9981c3a
[SYCL] Fix: Make benchmarking script executable
ianayl 3ed35ca
[SYCL] Bug fix on sycl-bench.sh
ianayl 6ea0110
[SYCL] Amend workflow as per review in #14351
ianayl 6d14a32
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl 940e3be
Complete redo of workflow, switch to compute-benchmarks
ianayl 7aafdf5
Add safeguards and update usage(), names
ianayl 24b5169
Change SYCL_PI_TRACE to SYCL_UR_TRACE
ianayl b2d4463
Test commit to learn more about the workflow
ianayl 5f1cd57
Test commit to integrate building into the workflow
ianayl 7a889f8
Refactor benchmarks out of sycl e2e
ianayl 6e1b3bb
Re-enable benchmarks for testing purposes
ianayl 5d1dea4
temporarily hijack precommit for testing
ianayl 991cd55
temporarily enable benchmark
ianayl 6e141e8
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl 8a5ecb6
Set CMPLR_ROOT for run
ianayl 606c02a
Test pushing
ianayl 5dd976e
Enable more debugging
ianayl 6c83d2b
disable post commit temporarily for testing purposes, turn down paral…
ianayl 5266cac
disable ccache
ianayl ab17254
Take benchmarking out of sycl-linux-run-tests
ianayl 45a93ba
Fix leftover chars
ianayl a4a1c03
Add missing fields
ianayl 52f5dc3
Disable windows, fix missing fields
ianayl 90575fe
ammend permissions
ianayl 8dfeff6
ammend boolean matching
ianayl 3346a09
change ssh key directory
ianayl 3a28ded
Added options to disable caching
ianayl e67c29f
attempt to introduce aggregate
ianayl 88f8b3b
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl e6cbc2e
changed permissions to allow aggregate
ianayl c6645aa
further write permission correction
ianayl 867e6e6
further read permission correction
ianayl 18ff8b1
test amendmnet of build permissions
ianayl cc29c23
Initial support for time ranges
ianayl 3b5454f
Fixed aggregate, improved logging
ianayl 6ed0361
Change repo used
ianayl f54e1d2
Resolve issue with using two action/checkout's
ianayl 47693f9
amend location of aggregate
ianayl f1d3a7f
amend location of aggregate
ianayl 652667f
fix timestamp format in common
ianayl be75574
fix missing $
ianayl 1200217
fix missing $
ianayl 97b2d4f
exit on error
ianayl 08da292
exit on error
ianayl 441bc10
update config to trigger new run
ianayl 8979115
update config to trigger new run
ianayl 7fa6a2e
Fix up typo
ianayl 1074e42
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl 21498b4
Revert permissions on previous files
ianayl 8506c20
Amend permissions to be more strict
ianayl c2835cd
Amend permissions on aggregate
ianayl 51cdaee
Fix bug with permissions
ianayl ef6a085
Revert amend
ianayl 2fd6b7b
Amend benchmarks permissions
ianayl 1d5c676
Make build permissions more restrictive
ianayl c20d75e
Amend benchmark permissions
ianayl a9dad80
Try new config file loading
ianayl 0c3e901
Fixed sed expression
ianayl 12326ce
trigger workflow
ianayl 4335bf9
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl ba29015
Added iteration options, changed build to each case
ianayl 90fe17f
Add debug prints
ianayl 59e38fe
Make changes to the debug prints
ianayl d212adc
Upped number of iterations
ianayl 321d83a
increase iterations
ianayl ba3c45c
Test PVC
ianayl 81fb277
Merge branch 'sycl' into benchmarking-workflow
ianayl e8178c5
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl 410666e
disable igc dev for now
ianayl c32ad36
fix benchmarking
ianayl b5fa113
fix benchmarking
ianayl 0ae396d
Introduce separating of results based on runners
ianayl 5d8f864
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl fda62fc
Fix merge fault
ianayl 0a083b8
undo change to build
ianayl e58248d
Redo changes to build
ianayl 8091ed0
expand build perms
ianayl d142575
propagate expanded permissions
ianayl c77f967
Give more perms to benchmark
ianayl c04ccaa
Remove write perms
ianayl e4897d5
remove unnecessary permission grant
ianayl a5b7e23
Remove further write perms
ianayl 6a12cf4
expand benchmark perms
ianayl f027f8e
Clean up some files before review
ianayl 08388fa
Enable more tests
ianayl 9f7b0ff
Remove non-sycl tests, clean up code
ianayl 30bd28c
Amend bad test case names
ianayl a3b0487
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl 0e4bb7f
Put benchmarking back into sycl-linux-run-tests
ianayl 74bd73c
add benchmark option to sycl-linux-run-tests
ianayl 0282c0a
parallelize aggregate again:
ianayl 66a51f3
Restore CI testing
ianayl 5173a0d
Conditional dependency on aggregate if benchmarking
ianayl d5a9468
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl 867fc5a
Attempt to correct syntax
ianayl 168325f
Add dependency on benchmark_aggregate
ianayl cf599c0
fix conditional for aggregate
ianayl 96ad8dd
try to trigger aggregate
ianayl a4f1d5e
try to trigger aggregate
ianayl 7bf79fd
try to trigger aggregate
ianayl 23a21e9
try to trigger aggregate
ianayl c1c7313
Enable nightly
ianayl 3bdf383
added extra debugging to sus out where the working directories are
ianayl e9425f5
Prepare workflows for git tokens, add comments
ianayl 6e889d4
Sanitize workflow config variables
ianayl e158a70
Figure out where aggregate runner paths are
ianayl bfedd09
Fix paths, update load_single_config
ianayl d5bfa08
Fix missing apostrophe
ianayl 02428d6
Fix cutoff format
ianayl 54b8fd4
fixed glaring python issues
ianayl acd1931
Add more documentation
ianayl 38c9bed
Fix bad merges from before
ianayl 6193059
Appease check formatting
ianayl fcbbe52
Change folder structure
ianayl e5a12b8
fix bad options in benchmark.sh
ianayl cf886e9
Apparently posix shell doesn't have herestrings
ianayl e434d74
Fix config
ianayl ec8b2f0
add extra debug prints
ianayl 3936328
fix bug
ianayl dff86d2
add debug for timestamp
ianayl 371097d
oops
ianayl 619c86b
Upload uncached results to artifactory
ianayl 792769e
Update artifacts
ianayl ec369cd
Fix bug
ianayl 3f1666f
Merge branch 'sycl' of https://github.com/intel/llvm into benchmarkin…
ianayl 07bca84
Fix repository secrets not propagating
ianayl 5d5c755
Improve artifacts
ianayl 40e8b9b
bug fixes
ianayl 7bf8043
needs newline
ianayl 3d366ae
forgot to load artifact path
ianayl 98b1acf
fix artifact path
ianayl 4c13ae7
Move configs out of scripts directory
ianayl ba9da64
Split config loading into constants and options
ianayl 798e16b
Remove old lines
ianayl 0dea393
Preliminary impl of python config loading, new configs, and changes r…
ianayl 3252b59
Fix typo
ianayl 37612f5
Fix bug
ianayl 6f5074f
Fix bug with timestamp
ianayl efef394
Sanitize tests conf
ianayl 93456e0
Amend config loading to python, split aggregate workflow
ianayl 625c72f
Fix bug
ianayl 0faada5
fix bug
ianayl c256b5c
Fix issue with double cloning
ianayl ab29ffc
Add missing arugment
ianayl 337c51e
fix bugs
ianayl cdea68d
fix bug
ianayl beb2942
fix bug
ianayl f4d8a3f
fix bug
ianayl 572ff7e
Shuffle testing to the end
ianayl 412449e
Hardcode all paths
ianayl 2951b37
apply clang-format
ianayl bce5229
Remove cutoff timestamp behavior for aggregate
ianayl 5c25a95
Fix typo
ianayl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.