Skip to content
Snippets Groups Projects
Commit 2a24590f authored by olga's avatar olga
Browse files

Fixes and updates

parent ec73e490
No related branches found
No related tags found
1 merge request!8Fixes and updates
...@@ -27,7 +27,7 @@ stages: ...@@ -27,7 +27,7 @@ stages:
name: test/$CI_COMMIT_REF_NAME name: test/$CI_COMMIT_REF_NAME
script: [ "echo test" ] script: [ "echo test" ]
variables: variables:
BENCHMARK: "device" BENCHMARK: "all"
artifacts: artifacts:
paths: paths:
- jobs/ - jobs/
......
# 0.2.0 (June 16th 2020) # 0.2.0 (June 16th 2020)
FIXES:
* Using simpletrack device lists instead of clinfo.
FEATURES: FEATURES:
* Added "benchmark" mode to run and generate json output for the runs. * Added "benchmark" mode to run and generate json output for the runs.
* Generate yaml alongside the json summary.
# 0.1.0 (June 13th 2020) # 0.1.0 (June 13th 2020)
......
# Overview # Overview
Docker images containing Simpletrack benchmark built a selection of GPU/CPU targets: Docker images containing Simpletrack benchmark built for a selection of GPU/CPU targets:
- __Intel__: contains [GPU NEO runtime](https://github.com/intel/compute-runtime) and OneAPI version i.e. DPC++ and SYCL support contains only the [OpenCL CPU runtimes](https://software.intel.com/content/www/us/en/develop/articles/opencl-drivers.html). - __Intel__: contains [GPU NEO runtime](https://github.com/intel/compute-runtime) and OneAPI version i.e. DPC++ and SYCL support contains only the [OpenCL CPU runtimes](https://software.intel.com/content/www/us/en/develop/articles/opencl-drivers.html).
- __Nvidia__: contains OpenCL runtime from [this](https://nvidia.github.io/nvidia-container-runtime/) repository. - __Nvidia__: contains OpenCL runtime from [this](https://nvidia.github.io/nvidia-container-runtime/) repository.
......
...@@ -23,6 +23,21 @@ function gen_devices() { ...@@ -23,6 +23,21 @@ function gen_devices() {
done done
} }
#########################
function get_devices() {
#########################
info="$(python3 benchmark_opencl.py -s)"
devices=`echo "$info" | grep "Device" | cut -d"'" -f2`
for dev_id in $(seq 1 $(echo "$devices" | wc -l))
do
id=`echo "$info" | grep "Device" | cut -d"'" -f2 | head -n $dev_id | tail -1 | xargs`
platform=`echo "$info" | grep "Device" | cut -d":" -f2 | head -n $dev_id | tail -1 | xargs`
name=`echo "$info" | grep "Platform" | cut -d":" -f2 | head -n $dev_id | tail -1 | xargs`
echo "\"device_id\":\"$id\",\"name\":\"$name\",\"platform\":\"$platform\""
done
}
######################### #########################
function log() { function log() {
######################### #########################
...@@ -37,7 +52,7 @@ function log() { ...@@ -37,7 +52,7 @@ function log() {
########################## ##########################
function run_benchmark() { function run_benchmark() {
########################## ##########################
OUT=$(python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $1 2>&1 | tee $WORK_DIR/out.log) OUT=$(python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $1 2>&1 | tee -a $WORK_DIR/out.log)
RESULT=`echo "$OUT" | grep 'particles\*turns/seconds'` RESULT=`echo "$OUT" | grep 'particles\*turns/seconds'`
if [ "$RESULT" == "" ]; then log error "Failed to parse the output. Failed run?"; if [ "$RESULT" == "" ]; then log error "Failed to parse the output. Failed run?";
...@@ -48,7 +63,14 @@ function run_benchmark() { ...@@ -48,7 +63,14 @@ function run_benchmark() {
function get_json() { function get_json() {
########################## ##########################
dev_line=`echo "$DEVICES" | grep "\"device_id\":\"$1\""` dev_line=`echo "$DEVICES" | grep "\"device_id\":\"$1\""`
echo "{\"copies\":\"1\",\"threads_per_copy\":\"$TURNS\",\"events_per_thread\":\"$PARTICLES\",\"wl-scores\":{\"sim\":\"$2\"},\"device\":{$dev_line}}" echo "{\"copies\":\"1\",\"threads_per_copy\":\"$TURNS\",\"events_per_thread\":\"$PARTICLES\",\"wl-scores\":{\"simpletrack\":\"$2\"},\"device\":{$dev_line}}"
}
##########################
function get_yaml() {
##########################
dev_line=`echo "$DEVICES" | grep "\"device_id\":\"$1\""`
echo -e "- wl-scores: $2\n id: \"$1\"\n name: \"$(echo "$dev_line" | grep "device_id\":\"$1" | cut -d"\"" -f8)\"\n platform: \"$(echo "$dev_line" | grep "device_id\":\"$1" | cut -d"\"" -f12)\""
} }
################################### ###################################
...@@ -65,7 +87,9 @@ CLINFO_OUT=`echo "$(clinfo | tee $WORK_DIR/clinfo.log)"` ...@@ -65,7 +87,9 @@ CLINFO_OUT=`echo "$(clinfo | tee $WORK_DIR/clinfo.log)"`
if [ `echo $CLINFO_OUT | grep 'Number of platforms' | awk '{print $4}'` -eq 0 ]; then if [ `echo $CLINFO_OUT | grep 'Number of platforms' | awk '{print $4}'` -eq 0 ]; then
log error "No platforms found. Exiting.."; fi log error "No platforms found. Exiting.."; fi
DEVICES="$(gen_devices | tee $WORK_DIR/devices.log)" echo -e "args:\n number_of_particles: (p,$PARTICLES)\n number_of_turns: (t,$TURNS)\ndevice:" > $WORK_DIR/summary.yaml
DEVICES="$(get_devices | tee $WORK_DIR/devices.log)"
log silent "Devices found:\n$DEVICES" log silent "Devices found:\n$DEVICES"
case $BENCHMARK in case $BENCHMARK in
...@@ -73,10 +97,13 @@ case $BENCHMARK in ...@@ -73,10 +97,13 @@ case $BENCHMARK in
log info "Running benchmark for ${#list[@]} device(s)"; log info "Running benchmark for ${#list[@]} device(s)";
for dev in "${list[@]}" for dev in "${list[@]}"
do do
OUT=$(run_benchmark $dev); get_json $dev $OUT | tee -a $WORK_DIR/summary.json OUT=$(run_benchmark $dev);
done ;; get_json $dev $OUT | tee -a $WORK_DIR/summary.json;
get_yaml $dev $OUT >> $WORK_DIR/summary.yaml;
done ; cat $WORK_DIR/summary.yaml;;
device) log info "Running benchmark for $DEVICE device"; device) log info "Running benchmark for $DEVICE device";
OUT=$(run_benchmark $DEVICE); get_json $DEVICE $OUT | tee -a $WORK_DIR/summary.json ;; OUT=$(run_benchmark $DEVICE); get_json $DEVICE $OUT | tee -a $WORK_DIR/summary.json ;
get_yaml $DEVICE $OUT >> $WORK_DIR/summary.yaml ; cat $WORK_DIR/summary.yaml ;;
*) python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $DEVICE 2>&1 | tee -a $WORK_DIR/out.log; *) python3 benchmark_opencl.py -p $PARTICLES -t $TURNS -d $DEVICE 2>&1 | tee -a $WORK_DIR/out.log;
esac esac
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment