summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-05-14 16:03:27 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2025-05-14 16:09:20 +0200
commit55f2653aafa38ea1d53a43c104185218e0dad1f1 (patch)
tree9e550665102e5543be8186b259586a69e7c8b83f
parentc2819a30f6914267e5792b68ca8a500f0e06ce79 (diff)
Use benchmark-specific input descriptions rather than opaque "#elements"
-rw-r--r--BFS/include/dfatool_host.ah7
-rw-r--r--BS/include/dfatool_host.ah12
-rw-r--r--GEMV/include/dfatool_host.ah11
-rw-r--r--TRNS/include/dfatool_host.ah19
-rw-r--r--TS/include/dfatool_host.ah14
-rw-r--r--VA/Makefile2
-rw-r--r--VA/host/app.c4
-rw-r--r--VA/include/dfatool_host.ah12
-rw-r--r--include/dfatool_host_dpu.ah10
9 files changed, 57 insertions, 34 deletions
diff --git a/BFS/include/dfatool_host.ah b/BFS/include/dfatool_host.ah
index 592e6ec..b2677e1 100644
--- a/BFS/include/dfatool_host.ah
+++ b/BFS/include/dfatool_host.ah
@@ -5,6 +5,9 @@
aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long input_size;
+ unsigned int element_size;
+
virtual int getKernel() { return 1; }
DfatoolHostTiming() {
@@ -18,10 +21,10 @@ aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
advice call("% coo2csr(...)") : after() {
struct CSRGraph *g = tjp->result();
input_size = g->numNodes;
- printf("[--] BFS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[--] BFS | n_dpus=%u n_nodes=%lu\n", NR_DPUS, input_size);
}
advice execution("% main(...)") : after() {
- printf("[<<] BFS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[<<] BFS | n_dpus=%u n_nodes=%lu\n", NR_DPUS, input_size);
}
};
diff --git a/BS/include/dfatool_host.ah b/BS/include/dfatool_host.ah
index 2f55c40..19019a5 100644
--- a/BS/include/dfatool_host.ah
+++ b/BS/include/dfatool_host.ah
@@ -5,6 +5,9 @@
aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long n_elements, n_queries;
+ unsigned int element_size;
+
virtual int getKernel() { return 1; }
DfatoolHostTiming() {
@@ -13,15 +16,16 @@ aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
advice call("% input_params(...)"): after() {
Params* p = tjp->result();
- input_size = INPUT_SIZE + p->num_querys;
- printf("[>>] BS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ n_elements = INPUT_SIZE;
+ n_queries = p->num_querys;
+ printf("[>>] BS | n_dpus=%u n_elements=%lu n_queries=%lu\n", NR_DPUS, n_elements, n_queries);
}
advice call("% binarySearch(...)") : after() {
- printf("[--] BS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[--] BS | n_dpus=%u n_elements=%lu n_queries=%lu\n", NR_DPUS, n_elements, n_queries);
}
advice execution("% main(...)") : after() {
- printf("[<<] BS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[<<] BS | n_dpus=%u n_elements=%lu n_queries=%lu\n", NR_DPUS, n_elements, n_queries);
}
};
diff --git a/GEMV/include/dfatool_host.ah b/GEMV/include/dfatool_host.ah
index ce3a35c..84c1dd3 100644
--- a/GEMV/include/dfatool_host.ah
+++ b/GEMV/include/dfatool_host.ah
@@ -4,6 +4,8 @@
#include "dfatool_host_dpu.ah"
aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned int n_cols, n_rows;
+ unsigned int element_size;
virtual int getKernel() { return 1; }
@@ -13,15 +15,16 @@ aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
advice call("% input_params(...)") : after() {
Params* p = tjp->result();
- input_size = p->n_size * p->m_size;
- printf("[>>] GEMV | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ n_cols = p->n_size;
+ n_rows = p->m_size;
+ printf("[>>] GEMV | n_dpus=%u n_cols=%u n_rows=%u\n", NR_DPUS, n_cols, n_rows);
}
advice call("% gemv_host(...)") : after() {
- printf("[--] GEMV | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[--] GEMV | n_dpus=%u n_cols=%u n_rows=%u\n", NR_DPUS, n_cols, n_rows);
}
advice execution("% main(...)") : after() {
- printf("[<<] GEMV | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[<<] GEMV | n_dpus=%u n_cols=%u n_rows=%u\n", NR_DPUS, n_cols, n_rows);
}
};
diff --git a/TRNS/include/dfatool_host.ah b/TRNS/include/dfatool_host.ah
index 6bdd3b5..d9065d8 100644
--- a/TRNS/include/dfatool_host.ah
+++ b/TRNS/include/dfatool_host.ah
@@ -5,21 +5,32 @@
aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned int n_rows_f1, n_rows_f2, n_cols_f1, n_cols_f2;
+ unsigned int element_size;
+
+ virtual int getKernel() { return kernel; }
+
DfatoolHostTiming() {
element_size = sizeof(T);
}
advice call("% input_params(...)") : after() {
Params* p = tjp->result();
- input_size = p->M_ * p->m * p->N_ * p->n;
- printf("[>>] TRNS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ /*
+ * Input: (M_ * m) × (N_ * n) matrix
+ */
+ n_rows_f1 = p->M_;
+ n_rows_f2 = p->m;
+ n_cols_f1 = p->N_;
+ n_cols_f2 = p->n;
+ printf("[>>] TRNS | n_dpus=%u n_rows_f1=%u n_rows_f2=%u n_cols_f1=%u n_cols_f2=%u\n", NR_DPUS, n_rows_f1, n_rows_f2, n_cols_f1, n_cols_f2);
}
advice call("% trns_host(...)") : after() {
- printf("[--] TRNS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[--] TRNS | n_dpus=%u n_rows_f1=%u n_rows_f2=%u n_cols_f1=%u n_cols_f2=%u\n", NR_DPUS, n_rows_f1, n_rows_f2, n_cols_f1, n_cols_f2);
}
advice execution("% main(...)") : after() {
- printf("[<<] TRNS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[<<] TRNS | n_dpus=%u n_rows_f1=%u n_rows_f2=%u n_cols_f1=%u n_cols_f2=%u\n", NR_DPUS, n_rows_f1, n_rows_f2, n_cols_f1, n_cols_f2);
}
};
diff --git a/TS/include/dfatool_host.ah b/TS/include/dfatool_host.ah
index 2a45918..4192c73 100644
--- a/TS/include/dfatool_host.ah
+++ b/TS/include/dfatool_host.ah
@@ -5,21 +5,27 @@
aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long ts_size, query_length;
+ unsigned int element_size;
+
+ virtual int getKernel() { return kernel; }
+
DfatoolHostTiming() {
element_size = sizeof(DTYPE);
}
advice call("% input_params(...)") : after() {
Params* p = tjp->result();
- input_size = p->input_size_n;
- printf("[>>] TS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ ts_size = p->input_size_n;
+ query_length = p->input_size_m;
+ printf("[>>] TS | n_dpus=%u n_elements_ts=%lu n_elements_query=%lu\n", NR_DPUS, ts_size, query_length);
}
advice call("% streamp(...)") : before() {
- printf("[--] TS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[--] TS | n_dpus=%u n_elements_ts=%lu n_elements_query=%lu\n", NR_DPUS, ts_size, query_length);
}
advice execution("% main(...)") : after() {
- printf("[<<] TS | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[<<] TS | n_dpus=%u n_elements_ts=%lu n_elements_query=%lu\n", NR_DPUS, ts_size, query_length);
}
};
diff --git a/VA/Makefile b/VA/Makefile
index 5d2df1c..e0d392f 100644
--- a/VA/Makefile
+++ b/VA/Makefile
@@ -12,7 +12,7 @@ HOST_SOURCES := $(wildcard host/*.c)
DPU_SOURCES := $(wildcard dpu/*.c)
aspectc ?= 0
-aspectc_timing ?= *
+aspectc_timing ?= 0
dfatool_timing ?= 1
HOST_CC := ${CC}
diff --git a/VA/host/app.c b/VA/host/app.c
index 04f1971..27a64f2 100644
--- a/VA/host/app.c
+++ b/VA/host/app.c
@@ -47,8 +47,6 @@ static T *B;
static T *C;
static T *C2;
-unsigned int kernel;
-
// Create input arrays
static void read_input(T *A, T *B, unsigned long int nr_elements)
{
@@ -202,7 +200,7 @@ int main(int argc, char **argv)
start(&timer, 3, 0);
}
// Input arguments
- kernel = 0;
+ unsigned int kernel = 0;
dpu_arguments_t input_arguments[NR_DPUS];
for (i = 0; i < nr_of_dpus - 1; i++) {
input_arguments[i].size =
diff --git a/VA/include/dfatool_host.ah b/VA/include/dfatool_host.ah
index de781f3..e74f466 100644
--- a/VA/include/dfatool_host.ah
+++ b/VA/include/dfatool_host.ah
@@ -4,6 +4,10 @@
#include "dfatool_host_dpu.ah"
aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long n_rows;
+ unsigned int element_size;
+
+ virtual int getKernel() { return 1; }
DfatoolHostTiming() {
element_size = sizeof(T);
@@ -11,15 +15,15 @@ aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
advice call("% input_params(...)") : after() {
Params* p = tjp->result();
- input_size = p->input_size;
- printf("[>>] VA | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ n_rows = p->input_size;
+ printf("[>>] VA | n_dpus=%u n_rows=%lu\n", NR_DPUS, n_rows);
}
advice call("% vector_addition_host(...)") : after() {
- printf("[--] VA | n_dpus=%u n_elements=%lu\n", n_dpus, input_size);
+ printf("[--] VA | n_dpus=%u n_rows=%lu\n", n_dpus, n_rows);
}
advice execution("% main(...)") : after() {
- printf("[<<] VA | n_dpus=%u n_elements=%lu\n", NR_DPUS, input_size);
+ printf("[<<] VA | n_dpus=%u n_rows=%lu\n", NR_DPUS, n_rows);
}
};
diff --git a/include/dfatool_host_dpu.ah b/include/dfatool_host_dpu.ah
index 010c18c..c676f50 100644
--- a/include/dfatool_host_dpu.ah
+++ b/include/dfatool_host_dpu.ah
@@ -5,8 +5,6 @@
aspect DfatoolHostDPUTiming {
struct timeval starttime;
struct timeval stoptime;
- unsigned long input_size;
- unsigned int element_size;
uint32_t n_ranks = 0;
uint32_t n_dpus = 0;
@@ -77,16 +75,12 @@ aspect DfatoolHostDPUTiming {
tjp->proceed();
gettimeofday(&stoptime, NULL);
double latency_us = (stoptime.tv_sec - starttime.tv_sec) * 1000000.0 + (stoptime.tv_usec - starttime.tv_usec);
- printf("[::] dpu_launch @ %s:%d | n_dpus=%u n_ranks=%u e_kernel=kernel%d n_elements=%lu n_elements_per_dpu=%lu | latency_us=%f throughput_Mps=%f throughput_MiBps=%f\n",
+ printf("[::] dpu_launch @ %s:%d | n_dpus=%u n_ranks=%u e_kernel=kernel%d | latency_us=%f\n",
tjp->filename(),
tjp->line(),
n_dpus, n_ranks,
getKernel(),
- input_size,
- input_size / n_dpus,
- latency_us,
- input_size / latency_us,
- input_size * element_size / (latency_us * M_to_Mi)
+ latency_us
);
}