summaryrefslogtreecommitdiff
path: root/SCAN-RSS
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2023-06-02 15:28:54 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2023-06-02 15:28:54 +0200
commitff9304370fdd94e9b7e4c4262c59ac734f1a28fd (patch)
treeca8e1edf1fd99d9295686f151de2bb96d7116588 /SCAN-RSS
parent5a3652ed60704d2b45eb652639f9d712ea32e104 (diff)
SCAN-RSS: update dfatool port and add/update benchmark scripts
Diffstat (limited to 'SCAN-RSS')
-rw-r--r--SCAN-RSS/Makefile49
-rw-r--r--SCAN-RSS/baselines/cpu/Makefile13
-rw-r--r--SCAN-RSS/baselines/cpu/app_baseline.cpp10
-rwxr-xr-xSCAN-RSS/baselines/cpu/run-opti.sh9
-rwxr-xr-xSCAN-RSS/baselines/cpu/run.sh19
-rw-r--r--SCAN-RSS/host/app.c77
-rwxr-xr-xSCAN-RSS/run-paper-strong-full.sh19
-rwxr-xr-xSCAN-RSS/run-paper-strong-rank.sh20
-rwxr-xr-xSCAN-RSS/run-paper-weak.sh20
9 files changed, 164 insertions, 72 deletions
diff --git a/SCAN-RSS/Makefile b/SCAN-RSS/Makefile
index 4930e70..1216e14 100644
--- a/SCAN-RSS/Makefile
+++ b/SCAN-RSS/Makefile
@@ -1,46 +1,39 @@
-DPU_DIR := dpu
-HOST_DIR := host
-BUILDDIR ?= bin
NR_DPUS ?= 1
NR_TASKLETS ?= 16
BL ?= 10
TYPE ?= INT64
ENERGY ?= 0
-
-define conf_filename
- ${BUILDDIR}/.NR_DPUS_$(1)_NR_TASKLETS_$(2)_BL_$(3)_TYPE_$(4).conf
-endef
-CONF := $(call conf_filename,${NR_DPUS},${NR_TASKLETS},${BL},${TYPE})
-
-HOST_TARGET := ${BUILDDIR}/host_code
-DPU_TARGET := ${BUILDDIR}/dpu_code
+UNROLL ?= 1
COMMON_INCLUDES := support
-HOST_SOURCES := $(wildcard ${HOST_DIR}/*.c)
-DPU_SOURCES := $(wildcard ${DPU_DIR}/*.c)
+HOST_SOURCES := $(wildcard host/*.c)
+DPU_SOURCES := $(wildcard dpu/*.c)
-.PHONY: all clean test
+COMMON_FLAGS := -Wall -Wextra -g -I${COMMON_INCLUDES} -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DBL=${BL} -D${TYPE} -DUNROLL=${UNROLL}
+HOST_FLAGS := ${COMMON_FLAGS} -std=c11 -O3 `dpu-pkg-config --cflags --libs dpu` -DENERGY=${ENERGY}
+DPU_FLAGS := ${COMMON_FLAGS} -O2
-__dirs := $(shell mkdir -p ${BUILDDIR})
+QUIET = @
-COMMON_FLAGS := -Wall -Wextra -g -I${COMMON_INCLUDES}
-HOST_FLAGS := ${COMMON_FLAGS} -std=c11 -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DBL=${BL} -D${TYPE} -DENERGY=${ENERGY}
-DPU_FLAGS := ${COMMON_FLAGS} -O2 -DNR_TASKLETS=${NR_TASKLETS} -DBL=${BL} -D${TYPE}
+ifdef verbose
+ QUIET =
+endif
-all: ${HOST_TARGET} ${DPU_TARGET}
+all: bin/dpu_code bin/host_code
-${CONF}:
- $(RM) $(call conf_filename,*,*)
- touch ${CONF}
+bin:
+ ${QUIET}mkdir -p bin
-${HOST_TARGET}: ${HOST_SOURCES} ${COMMON_INCLUDES} ${CONF}
- $(CC) -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
+bin/host_code: ${HOST_SOURCES} ${COMMON_INCLUDES} bin
+ ${QUIET}${CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
-${DPU_TARGET}: ${DPU_SOURCES} ${COMMON_INCLUDES} ${CONF}
- dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES}
+bin/dpu_code: ${DPU_SOURCES} ${COMMON_INCLUDES} bin
+ ${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES}
clean:
- $(RM) -r $(BUILDDIR)
+ ${QUIET}rm -rf bin
test: all
- ./${HOST_TARGET}
+ ${QUIET}bin/host_code
+
+.PHONY: all clean test
diff --git a/SCAN-RSS/baselines/cpu/Makefile b/SCAN-RSS/baselines/cpu/Makefile
index 2765a1b..0bdedf6 100644
--- a/SCAN-RSS/baselines/cpu/Makefile
+++ b/SCAN-RSS/baselines/cpu/Makefile
@@ -1,5 +1,14 @@
-all:
+TYPE ?= UINT64
+
+all: scan
+
+scan: app_baseline.cpp
g++ -O2 app_baseline.cpp -fopenmp -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_OMP -lgomp -I/usr/local/cuda-8.0/include -lm -o scan -D${TYPE}
+run: scan
+ ./scan -i 1258291200 -t 4
+
clean:
- rm scan
+ rm -f scan
+
+.PHONY: all run clean
diff --git a/SCAN-RSS/baselines/cpu/app_baseline.cpp b/SCAN-RSS/baselines/cpu/app_baseline.cpp
index ba9b31f..66eced5 100644
--- a/SCAN-RSS/baselines/cpu/app_baseline.cpp
+++ b/SCAN-RSS/baselines/cpu/app_baseline.cpp
@@ -189,18 +189,14 @@ int main(int argc, char **argv) {
printf("[" ANSI_COLOR_GREEN "OK" ANSI_COLOR_RESET "] Outputs are equal\n");
if(rep >= p.n_warmup) {
- printf("[::] n_threads=%d e_type=%s n_elements=%d "
- "| throughput_cpu_ref_MBps=%f throughput_cpu_thrust_MBps=%f\n",
+ printf("[::] SCAN-RSS CPU | n_threads=%d e_type=%s n_elements=%d "
+ "| throughput_cpu_ref_MBps=%f throughput_cpu_thrust_MBps=%f",
nr_threads, XSTR(T), input_size,
input_size * sizeof(T) / timer.time[0],
input_size * sizeof(T) / timer.time[1]);
- printf("[::] n_threads=%d e_type=%s n_elements=%d "
- "| throughput_cpu_ref_MOpps=%f throughput_cpu_thrust_MOpps=%f\n",
- nr_threads, XSTR(T), input_size,
+ printf(" throughput_cpu_ref_MOpps=%f throughput_cpu_thrust_MOpps=%f",
input_size / timer.time[0],
input_size / timer.time[1]);
- printf("[::] n_threads=%d e_type=%s n_elements=%d | ",
- nr_threads, XSTR(T), input_size);
printall(&timer, 1);
}
} else {
diff --git a/SCAN-RSS/baselines/cpu/run-opti.sh b/SCAN-RSS/baselines/cpu/run-opti.sh
new file mode 100755
index 0000000..c9f6ce4
--- /dev/null
+++ b/SCAN-RSS/baselines/cpu/run-opti.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+HOST="$(hostname)"
+
+echo $HOST
+
+make -B TYPE=UINT64 verbose=1
+
+timeout --foreground -k 1m 30m ./scan -i 1258291200 -t 4 -w 0 -e 100 | sed 's/CPU/CPU Baseline/' | tee "${HOST}-baseline.txt"
diff --git a/SCAN-RSS/baselines/cpu/run.sh b/SCAN-RSS/baselines/cpu/run.sh
index dde3acd..10c13ac 100755
--- a/SCAN-RSS/baselines/cpu/run.sh
+++ b/SCAN-RSS/baselines/cpu/run.sh
@@ -2,16 +2,25 @@
set -e
+HOST="$(hostname)"
+
+echo $HOST
+
+(
+
echo "prim-benchmarks SCAN-RSS CPU/Thrust (dfatool edition)"
echo "Started at $(date)"
echo "Revision $(git describe --always)"
-for nr_threads in 1 2 4 6 8 12 16 20 24 32; do
- for i in 2048 4096 8192 16384 65536 262144 1048576 3932160 15728640 31457280 262144000 1258291200 2516582400; do
- for dt in UINT32 UINT64 INT32 INT64 FLOAT DOUBLE; do
- if make -B TYPE=${dt}; then
- timeout -k 1m 30m ./scan -i ${i} -w 0 -e 100 -t ${nr_threads} || true
+for nr_threads in 88 64 44 1 2 4 6 8 12 16 20 24 32; do
+ #for i in 2048 4096 8192 16384 65536 262144 1048576 3932160 15728640 31457280 262144000 1258291200 2516582400; do
+ for i in 1258291200; do
+ #for dt in UINT32 UINT64 INT32 INT64 FLOAT DOUBLE; do
+ for dt in UINT64; do
+ if make -B TYPE=${dt} verbose=1; then
+ timeout --foreground -k 1m 30m ./scan -i ${i} -w 0 -e 100 -t ${nr_threads} || true
fi
done
done
done
+) | tee "${HOST}-explore.txt"
diff --git a/SCAN-RSS/host/app.c b/SCAN-RSS/host/app.c
index 46cdd95..03cb055 100644
--- a/SCAN-RSS/host/app.c
+++ b/SCAN-RSS/host/app.c
@@ -22,6 +22,9 @@
#define DPU_BINARY "./bin/dpu_code"
#endif
+#define XSTR(x) STR(x)
+#define STR(x) #x
+
#if ENERGY
#include <dpu_probe.h>
#endif
@@ -34,7 +37,7 @@ static T* C2;
// Create input arrays
static void read_input(T* A, unsigned int nr_elements, unsigned int nr_elements_round) {
srand(0);
- printf("nr_elements\t%u\t", nr_elements);
+ //printf("nr_elements\t%u\t", nr_elements);
for (unsigned int i = 0; i < nr_elements; i++) {
A[i] = (T) (rand());
}
@@ -68,7 +71,7 @@ int main(int argc, char **argv) {
DPU_ASSERT(dpu_alloc(NR_DPUS, NULL, &dpu_set));
DPU_ASSERT(dpu_load(dpu_set, DPU_BINARY, NULL));
DPU_ASSERT(dpu_get_nr_dpus(dpu_set, &nr_of_dpus));
- printf("Allocated %d DPU(s)\n", nr_of_dpus);
+ //printf("Allocated %d DPU(s)\n", nr_of_dpus);
unsigned int i = 0;
T accum = 0;
@@ -91,21 +94,21 @@ int main(int argc, char **argv) {
// Timer declaration
Timer timer;
- printf("NR_TASKLETS\t%d\tBL\t%d\n", NR_TASKLETS, BL);
+ //printf("NR_TASKLETS\t%d\tBL\t%d\n", NR_TASKLETS, BL);
// Loop over main kernel
for(int rep = 0; rep < p.n_warmup + p.n_reps; rep++) {
// Compute output on CPU (performance comparison and verification purposes)
if(rep >= p.n_warmup)
- start(&timer, 0, rep - p.n_warmup);
+ start(&timer, 0, 0);
scan_host(C, A, input_size);
if(rep >= p.n_warmup)
stop(&timer, 0);
- printf("Load input data\n");
+ //printf("Load input data\n");
if(rep >= p.n_warmup)
- start(&timer, 1, rep - p.n_warmup);
+ start(&timer, 1, 0);
// Input arguments
const unsigned int input_size_dpu = input_size_dpu_round;
unsigned int kernel = 0;
@@ -123,10 +126,10 @@ int main(int argc, char **argv) {
if(rep >= p.n_warmup)
stop(&timer, 1);
- printf("Run program on DPU(s) \n");
+ //printf("Run program on DPU(s) \n");
// Run DPU kernel
if(rep >= p.n_warmup) {
- start(&timer, 2, rep - p.n_warmup);
+ start(&timer, 2, 0);
#if ENERGY
DPU_ASSERT(dpu_probe_start(&probe));
#endif
@@ -152,14 +155,14 @@ int main(int argc, char **argv) {
}
#endif
- printf("Retrieve results\n");
+ //printf("Retrieve results\n");
dpu_results_t results[nr_of_dpus];
T* results_scan = malloc(nr_of_dpus * sizeof(T));
i = 0;
accum = 0;
if(rep >= p.n_warmup)
- start(&timer, 3, rep - p.n_warmup);
+ start(&timer, 3, 0);
// PARALLEL RETRIEVE TRANSFER
dpu_results_t* results_retrieve[nr_of_dpus];
@@ -200,10 +203,10 @@ int main(int argc, char **argv) {
if(rep >= p.n_warmup)
stop(&timer, 3);
- printf("Run program on DPU(s) \n");
+ //printf("Run program on DPU(s) \n");
// Run DPU kernel
if(rep >= p.n_warmup) {
- start(&timer, 4, rep - p.n_warmup);
+ start(&timer, 4, 0);
#if ENERGY
DPU_ASSERT(dpu_probe_start(&probe));
#endif
@@ -227,9 +230,9 @@ int main(int argc, char **argv) {
}
#endif
- printf("Retrieve results\n");
+ //printf("Retrieve results\n");
if(rep >= p.n_warmup)
- start(&timer, 5, rep - p.n_warmup);
+ start(&timer, 5, 0);
i = 0;
// PARALLEL RETRIEVE TRANSFER
DPU_FOREACH(dpu_set, dpu, i) {
@@ -241,9 +244,37 @@ int main(int argc, char **argv) {
// Free memory
free(results_scan);
+
+ // Check output
+ bool status = true;
+ for (i = 0; i < input_size; i++) {
+ if(C[i] != bufferC[i]){
+ status = false;
+#if PRINT
+ printf("%d: %lu -- %lu\n", i, C[i], bufferC[i]);
+#endif
+ }
+ }
+ if (status) {
+ printf("[" ANSI_COLOR_GREEN "OK" ANSI_COLOR_RESET "] Outputs are equal\n");
+ printf("[::] SCAN-RSS NMC | n_dpus=%d n_tasklets=%d e_type=%s block_size_B=%d b_unroll=%d n_elements=%u "
+ "| throughput_cpu_MBps=%f throughput_pim_MBps=%f throughput_MBps=%f\n",
+ nr_of_dpus, NR_TASKLETS, XSTR(T), BLOCK_SIZE, UNROLL, input_size,
+ input_size * sizeof(T) / timer.time[0],
+ input_size * sizeof(T) / (timer.time[2] + timer.time[4]),
+ input_size * sizeof(T) / (timer.time[1] + timer.time[2] + timer.time[3] + timer.time[4] + timer.time[5]));
+ printf(" throughput_cpu_MOpps=%f throughput_pim_MOpps=%f throughput_MOpps=%f\n",
+ input_size / timer.time[0],
+ input_size / (timer.time[2] + timer.time[4]),
+ input_size / (timer.time[1] + timer.time[2] + timer.time[3] + timer.time[4] + timer.time[5]));
+ printall(&timer, 5);
+ } else {
+ printf("[" ANSI_COLOR_RED "ERROR" ANSI_COLOR_RESET "] Outputs differ!\n");
+ }
}
// Print timing results
+ /*
printf("CPU ");
print(&timer, 0, p.n_reps);
printf("CPU-DPU ");
@@ -256,6 +287,7 @@ int main(int argc, char **argv) {
print(&timer, 4, p.n_reps);
printf("DPU-CPU ");
print(&timer, 5, p.n_reps);
+ */
#if ENERGY
double energy;
@@ -264,21 +296,6 @@ int main(int argc, char **argv) {
#endif
- // Check output
- bool status = true;
- for (i = 0; i < input_size; i++) {
- if(C[i] != bufferC[i]){
- status = false;
-#if PRINT
- printf("%d: %lu -- %lu\n", i, C[i], bufferC[i]);
-#endif
- }
- }
- if (status) {
- printf("[" ANSI_COLOR_GREEN "OK" ANSI_COLOR_RESET "] Outputs are equal\n");
- } else {
- printf("[" ANSI_COLOR_RED "ERROR" ANSI_COLOR_RESET "] Outputs differ!\n");
- }
// Deallocation
free(A);
@@ -286,5 +303,5 @@ int main(int argc, char **argv) {
free(C2);
DPU_ASSERT(dpu_free(dpu_set));
- return status ? 0 : -1;
+ return 0;
}
diff --git a/SCAN-RSS/run-paper-strong-full.sh b/SCAN-RSS/run-paper-strong-full.sh
new file mode 100755
index 0000000..c418eeb
--- /dev/null
+++ b/SCAN-RSS/run-paper-strong-full.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+(
+
+echo "prim-benchmarks SCAN-RSS strong-full (dfatool edition)"
+echo "Started at $(date)"
+echo "Revision $(git describe --always)"
+
+for nr_dpus in 256 512 1024 2048; do
+ for nr_tasklets in 1 2 4 8 16; do
+ echo
+ if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 verbose=1; then
+ timeout --foreground -k 1m 30m bin/host_code -w 0 -e 100 -i 251658240 -x 1 || true
+ fi
+ done
+done
+) | tee log-paper-strong-full.txt
diff --git a/SCAN-RSS/run-paper-strong-rank.sh b/SCAN-RSS/run-paper-strong-rank.sh
new file mode 100755
index 0000000..669a706
--- /dev/null
+++ b/SCAN-RSS/run-paper-strong-rank.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+
+(
+
+echo "prim-benchmarks SCAN-RSS strong-rank (dfatool edition)"
+echo "Started at $(date)"
+echo "Revision $(git describe --always)"
+
+# 256 and 512 are not part of upstream config space
+for nr_dpus in 512 256 1 4 16 64; do
+ for nr_tasklets in 1 2 4 8 16; do
+ echo
+ if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 verbose=1; then
+ timeout --foreground -k 1m 30m bin/host_code -w 0 -e 100 -i 3932160 -x 1 || true
+ fi
+ done
+done
+) | tee log-paper-strong-rank.txt
diff --git a/SCAN-RSS/run-paper-weak.sh b/SCAN-RSS/run-paper-weak.sh
new file mode 100755
index 0000000..053d9a6
--- /dev/null
+++ b/SCAN-RSS/run-paper-weak.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+
+(
+
+echo "prim-benchmarks SCAN-RSS weak (dfatool edition)"
+echo "Started at $(date)"
+echo "Revision $(git describe --always)"
+
+# upstream does not include 256 and 512 in config space
+for nr_dpus in 512 256 1 4 16 64; do
+ for nr_tasklets in 1 2 4 8 16; do
+ echo
+ if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 verbose=1; then
+ timeout --foreground -k 1m 30m bin/host_code -w 0 -e 100 -i 3932160 -x 0 || true
+ fi
+ done
+done
+) | tee log-paper-weak.txt