summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBFS/benchmark-scripts/ccmcc25-sim.sh27
-rwxr-xr-xBFS/benchmark-scripts/ccmcc25.sh27
-rw-r--r--BFS/host/app.c84
-rw-r--r--BFS/host/mram-management.h22
-rwxr-xr-xBS/benchmark-scripts/ccmcc25-sim.sh27
-rwxr-xr-xBS/benchmark-scripts/ccmcc25.sh25
-rwxr-xr-xGEMV/benchmark-scripts/ccmcc25-sim.sh26
-rwxr-xr-xGEMV/benchmark-scripts/ccmcc25.sh25
-rwxr-xr-xHST-L/benchmark-scripts/ccmcc25-sim.sh25
-rwxr-xr-xHST-L/benchmark-scripts/ccmcc25.sh31
-rw-r--r--HST-L/include/timer.h10
-rwxr-xr-xMLP/benchmark-scripts/ccmcc25-sim.sh26
-rwxr-xr-xMLP/benchmark-scripts/ccmcc25.sh29
-rwxr-xr-xMicrobenchmarks/CPU-DPU/splc25-alloc.sh35
-rwxr-xr-xMicrobenchmarks/CPU-DPU/splc25-transfer.sh36
-rw-r--r--NW/Makefile6
-rw-r--r--NW/include/timer.h118
-rw-r--r--README.md4
-rw-r--r--RED/Makefile33
-rwxr-xr-xRED/benchmark-scripts/ccmcc25-sim.sh25
-rwxr-xr-xRED/benchmark-scripts/ccmcc25.sh30
-rw-r--r--RED/dpu/task.c4
-rw-r--r--RED/host/app.c61
-rw-r--r--[-rwxr-xr-x]RED/include/common.h (renamed from RED/support/common.h)18
-rw-r--r--RED/include/cyclecount.h (renamed from RED/support/cyclecount.h)0
-rw-r--r--RED/include/dfatool_host.ah29
-rw-r--r--RED/include/params.h (renamed from RED/support/params.h)4
-rw-r--r--RED/include/timer.h5
-rwxr-xr-xRED/support/timer.h66
-rw-r--r--SCAN-RSS/Makefile34
-rwxr-xr-xSCAN-RSS/benchmark-scripts/ccmcc25-sim.sh25
-rwxr-xr-xSCAN-RSS/benchmark-scripts/ccmcc25.sh31
-rw-r--r--SCAN-RSS/dpu/task.c2
-rw-r--r--SCAN-RSS/host/app.c61
-rw-r--r--[-rwxr-xr-x]SCAN-RSS/include/common.h (renamed from SCAN-RSS/support/common.h)16
-rw-r--r--SCAN-RSS/include/dfatool_host.ah29
-rw-r--r--SCAN-RSS/include/params.h (renamed from SCAN-RSS/support/params.h)4
-rw-r--r--SCAN-RSS/include/timer.h5
-rwxr-xr-xSCAN-RSS/run-paper-strong-full.sh20
-rwxr-xr-xSCAN-RSS/run-paper-strong-rank.sh20
-rwxr-xr-xSCAN-RSS/run-paper-weak.sh20
-rwxr-xr-xSCAN-RSS/run.sh11
-rwxr-xr-xSCAN-RSS/support/timer.h66
-rw-r--r--SCAN-SSA/Makefile29
-rwxr-xr-xSCAN-SSA/benchmark-scripts/ccmcc25-sim.sh25
-rwxr-xr-xSCAN-SSA/benchmark-scripts/ccmcc25.sh31
-rw-r--r--SCAN-SSA/dpu/task.c2
-rw-r--r--SCAN-SSA/host/app.c47
-rw-r--r--SCAN-SSA/host/omp.c6
-rw-r--r--SCAN-SSA/include/common.h (renamed from SCAN-SSA/support/common.h)16
-rw-r--r--SCAN-SSA/include/dfatool_host.ah29
-rw-r--r--SCAN-SSA/include/params.h (renamed from SCAN-SSA/support/params.h)4
-rw-r--r--SCAN-SSA/include/timer.h5
-rwxr-xr-xSCAN-SSA/run-omp.sh23
-rwxr-xr-xSCAN-SSA/run.sh27
-rw-r--r--SCAN-SSA/support/timer.h64
-rw-r--r--SpMV/Makefile50
-rwxr-xr-xSpMV/benchmark-scripts/ccmcc25-sim.sh33
-rwxr-xr-xSpMV/benchmark-scripts/ccmcc25.sh40
-rw-r--r--SpMV/dpu/task.c2
-rw-r--r--SpMV/host/app.c79
-rw-r--r--SpMV/host/mram-management.h26
-rw-r--r--SpMV/include/common.h (renamed from SpMV/support/common.h)0
-rw-r--r--SpMV/include/dfatool_host.ah31
-rw-r--r--SpMV/include/matrix.h (renamed from SpMV/support/matrix.h)0
-rw-r--r--SpMV/include/params.h (renamed from SpMV/support/params.h)0
-rw-r--r--SpMV/include/timer.h (renamed from SpMV/support/timer.h)30
-rw-r--r--SpMV/include/utils.h (renamed from SpMV/support/utils.h)0
-rwxr-xr-xSpMV/run-paper-strong-full.sh29
-rwxr-xr-xSpMV/run-paper-strong-rank.sh23
-rwxr-xr-xSpMV/run-paper-weak.sh27
-rwxr-xr-xTRNS/benchmark-scripts/ccmcc25-sim.sh53
-rwxr-xr-xTRNS/benchmark-scripts/ccmcc25.sh71
-rw-r--r--TRNS/include/dfatool_host.ah16
-rw-r--r--TS/Makefile2
-rwxr-xr-xTS/benchmark-scripts/ccmcc25-sim.sh25
-rwxr-xr-xTS/benchmark-scripts/ccmcc25.sh23
-rw-r--r--TS/host/app.c30
-rwxr-xr-xTS/run-paper-strong-full.sh29
-rwxr-xr-xTS/run-paper-strong-rank.sh28
-rwxr-xr-xTS/run-paper-weak.sh29
-rw-r--r--VA/Makefile6
-rw-r--r--VA/baselines/cpu/Makefile2
-rw-r--r--VA/baselines/cpu/app_baseline.c10
-rwxr-xr-xVA/benchmark-scripts/ccmcc25-sim.sh25
-rwxr-xr-xVA/benchmark-scripts/ccmcc25.sh27
86 files changed, 1285 insertions, 971 deletions
diff --git a/BFS/benchmark-scripts/ccmcc25-sim.sh b/BFS/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..bcbe284
--- /dev/null
+++ b/BFS/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -f ${data} 2>&1
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks BFS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+# BFS does not support repeated kernel invocations → repeat it here
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 data={data} \
+ ::: i $(seq 0 4) \
+ ::: data data/roadNet-CA.txt data/loc-gowalla_edges.txt \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+>> ${fn}.txt
diff --git a/BFS/benchmark-scripts/ccmcc25.sh b/BFS/benchmark-scripts/ccmcc25.sh
index 436d2eb..0dcf4bb 100755
--- a/BFS/benchmark-scripts/ccmcc25.sh
+++ b/BFS/benchmark-scripts/ccmcc25.sh
@@ -1,9 +1,6 @@
#!/bin/bash
mkdir -p log/$(hostname)
-fn=log/$(hostname)/ccmcc25
-
-source /opt/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh
run_benchmark_nmc() {
local "$@"
@@ -16,12 +13,20 @@ run_benchmark_nmc() {
export -f run_benchmark_nmc
-echo "prim-benchmarks BFS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks BFS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ # BFS does not support repeated kernel invocations → repeat it here
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any data={data} \
+ ::: i $(seq 0 10) \
+ ::: data data/roadNet-CA.txt data/loc-gowalla_edges.txt \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ >> ${fn}.txt
-# BFS does not support repeated kernel invocations → repeat it here
-parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
- run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any data={data} \
- ::: i $(seq 0 10) \
- ::: data data/roadNet-CA.txt data/loc-gowalla_edges.txt \
- ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
->> ${fn}.txt
+done
diff --git a/BFS/host/app.c b/BFS/host/app.c
index 763ff7a..4431193 100644
--- a/BFS/host/app.c
+++ b/BFS/host/app.c
@@ -186,19 +186,27 @@ int main(int argc, char **argv)
PRINT_INFO(p.verbosity >= 2,
" Copying data to DPU");
startTimer(&timer, 2, t0ini++);
- copyToDPU(dpu, (uint8_t *) dpuNodePtrs_h, dpuNodePtrs_m,
- (dpuNumNodes + 1) * sizeof(uint32_t));
- copyToDPU(dpu, (uint8_t *) dpuNeighborIdxs_h,
- dpuNeighborIdxs_m,
- dpuNumNeighbors * sizeof(uint32_t));
- copyToDPU(dpu, (uint8_t *) dpuNodeLevel_h,
- dpuNodeLevel_m,
- dpuNumNodes * sizeof(uint32_t));
- copyToDPU(dpu, (uint8_t *) visited, dpuVisited_m,
- numNodes / 64 * sizeof(uint64_t));
- copyToDPU(dpu, (uint8_t *) nextFrontier,
- dpuNextFrontier_m,
- numNodes / 64 * sizeof(uint64_t));
+
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuNodePtrs_m, (uint8_t *) dpuNodePtrs_h,
+ ROUND_UP_TO_MULTIPLE_OF_8((dpuNumNodes + 1) * sizeof(uint32_t))));
+
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuNeighborIdxs_m, (uint8_t *) dpuNeighborIdxs_h,
+ ROUND_UP_TO_MULTIPLE_OF_8(dpuNumNeighbors * sizeof(uint32_t))));
+
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuNodeLevel_m, (uint8_t *) dpuNodeLevel_h,
+ ROUND_UP_TO_MULTIPLE_OF_8(dpuNumNodes * sizeof(uint32_t))));
+
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuVisited_m, (uint8_t *) visited,
+ ROUND_UP_TO_MULTIPLE_OF_8(numNodes / 64 * sizeof(uint64_t))));
+
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuNextFrontier_m, (uint8_t *) nextFrontier,
+ ROUND_UP_TO_MULTIPLE_OF_8(numNodes / 64 * sizeof(uint64_t))));
+
// NOTE: No need to copy current frontier because it is written before being read
stopTimer(&timer, 2);
//loadTime += getElapsedTime(timer);
@@ -208,8 +216,9 @@ int main(int argc, char **argv)
PRINT_INFO(p.verbosity >= 2,
" Copying parameters to DPU");
startTimer(&timer, 2, t1ini++);
- copyToDPU(dpu, (uint8_t *) & dpuParams[dpuIdx],
- dpuParams_m[dpuIdx], sizeof(struct DPUParams));
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams_m[dpuIdx], (uint8_t *) & dpuParams[dpuIdx],
+ ROUND_UP_TO_MULTIPLE_OF_8(sizeof(struct DPUParams))));
stopTimer(&timer, 2);
//loadTime += getElapsedTime(timer);
@@ -248,19 +257,15 @@ int main(int argc, char **argv)
uint32_t dpuNumNodes = dpuParams[dpuIdx].dpuNumNodes;
if (dpuNumNodes > 0) {
if (dpuIdx == 0) {
- copyFromDPU(dpu,
- dpuParams[dpuIdx].
- dpuNextFrontier_m,
- (uint8_t *) currentFrontier,
- numNodes / 64 *
- sizeof(uint64_t));
+ DPU_ASSERT(dpu_copy_from(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams[dpuIdx].dpuNextFrontier_m,
+ (uint8_t *) currentFrontier,
+ ROUND_UP_TO_MULTIPLE_OF_8(numNodes / 64 * sizeof(uint64_t))));
} else {
- copyFromDPU(dpu,
- dpuParams[dpuIdx].
- dpuNextFrontier_m,
- (uint8_t *) nextFrontier,
- numNodes / 64 *
- sizeof(uint64_t));
+ DPU_ASSERT(dpu_copy_from(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams[dpuIdx].dpuNextFrontier_m,
+ (uint8_t *) nextFrontier,
+ ROUND_UP_TO_MULTIPLE_OF_8(numNodes / 64 * sizeof(uint64_t))));
for (uint32_t i = 0; i < numNodes / 64;
++i) {
currentFrontier[i] |=
@@ -287,19 +292,15 @@ int main(int argc, char **argv)
dpuParams[dpuIdx].dpuNumNodes;
if (dpuNumNodes > 0) {
// Copy current frontier to all DPUs (place in next frontier and DPU will update visited and copy to current frontier)
- copyToDPU(dpu,
- (uint8_t *) currentFrontier,
- dpuParams[dpuIdx].
- dpuNextFrontier_m,
- numNodes / 64 *
- sizeof(uint64_t));
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams[dpuIdx].dpuNextFrontier_m,
+ (uint8_t *) currentFrontier,
+ ROUND_UP_TO_MULTIPLE_OF_8(numNodes / 64 * sizeof(uint64_t))));
// Copy new level to DPU
dpuParams[dpuIdx].level = level;
- copyToDPU(dpu,
- (uint8_t *) &
- dpuParams[dpuIdx],
- dpuParams_m[dpuIdx],
- sizeof(struct DPUParams));
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams_m[dpuIdx], (uint8_t *) &dpuParams[dpuIdx],
+ ROUND_UP_TO_MULTIPLE_OF_8(sizeof(struct DPUParams))));
++dpuIdx;
}
}
@@ -317,9 +318,10 @@ int main(int argc, char **argv)
uint32_t dpuNumNodes = dpuParams[dpuIdx].dpuNumNodes;
if (dpuNumNodes > 0) {
uint32_t dpuStartNodeIdx = dpuIdx * numNodesPerDPU;
- copyFromDPU(dpu, dpuParams[dpuIdx].dpuNodeLevel_m,
- (uint8_t *) (nodeLevel + dpuStartNodeIdx),
- dpuNumNodes * sizeof(float));
+ DPU_ASSERT(dpu_copy_from(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams[dpuIdx].dpuNodeLevel_m,
+ (uint8_t *) (nodeLevel + dpuStartNodeIdx),
+ ROUND_UP_TO_MULTIPLE_OF_8(dpuNumNodes * sizeof(float))));
}
++dpuIdx;
}
diff --git a/BFS/host/mram-management.h b/BFS/host/mram-management.h
index 61616da..a953d6a 100644
--- a/BFS/host/mram-management.h
+++ b/BFS/host/mram-management.h
@@ -1,6 +1,4 @@
-
-#ifndef _MRAM_MANAGEMENT_H_
-#define _MRAM_MANAGEMENT_H_
+#pragma once
#include "common.h"
#include "utils.h"
@@ -29,21 +27,3 @@ static uint32_t mram_heap_alloc(struct mram_heap_allocator_t *allocator,
}
return ret;
}
-
-static void copyToDPU(struct dpu_set_t dpu, uint8_t *hostPtr, uint32_t mramIdx,
- uint32_t size)
-{
- DPU_ASSERT(dpu_copy_to
- (dpu, DPU_MRAM_HEAP_POINTER_NAME, mramIdx, hostPtr,
- ROUND_UP_TO_MULTIPLE_OF_8(size)));
-}
-
-static void copyFromDPU(struct dpu_set_t dpu, uint32_t mramIdx,
- uint8_t *hostPtr, uint32_t size)
-{
- DPU_ASSERT(dpu_copy_from
- (dpu, DPU_MRAM_HEAP_POINTER_NAME, mramIdx, hostPtr,
- ROUND_UP_TO_MULTIPLE_OF_8(size)));
-}
-
-#endif
diff --git a/BS/benchmark-scripts/ccmcc25-sim.sh b/BS/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..05e7f87
--- /dev/null
+++ b/BS/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ INPUT_SIZE=${nr_elements} PROBLEM_SIZE=${nr_queries} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/bs_host -w 0 -e 5 2>&1
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks BS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 nr_elements={nr_elements} nr_queries={nr_queries} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: nr_elements $((2**18)) $((2**19)) $((2**20)) $((2**21)) $((2**22)) \
+ ::: nr_queries 512 1024 2048 4096 \
+>> ${fn}.txt
diff --git a/BS/benchmark-scripts/ccmcc25.sh b/BS/benchmark-scripts/ccmcc25.sh
index ad35240..186baf6 100755
--- a/BS/benchmark-scripts/ccmcc25.sh
+++ b/BS/benchmark-scripts/ccmcc25.sh
@@ -1,9 +1,6 @@
#!/bin/bash
mkdir -p log/$(hostname)
-fn=log/$(hostname)/ccmcc25
-
-source /opt/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh
run_benchmark_nmc() {
local "$@"
@@ -17,11 +14,19 @@ run_benchmark_nmc() {
export -f run_benchmark_nmc
-echo "prim-benchmarks BS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks BS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any nr_elements={nr_elements} nr_queries={nr_queries} \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: nr_elements $((2**20)) $((2**21)) $((2**22)) \
+ ::: nr_queries 524288 1048576 2097152 \
+ >> ${fn}.txt
-parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
- run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any nr_elements={nr_elements} nr_queries={nr_queries} \
- ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
- ::: nr_elements $((2**20)) $((2**21)) $((2**22)) \
- ::: nr_queries 524288 1048576 2097152 \
->> ${fn}.txt
+done
diff --git a/GEMV/benchmark-scripts/ccmcc25-sim.sh b/GEMV/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..3f88fcf
--- /dev/null
+++ b/GEMV/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/gemv_host -w 0 -e 5 -n ${nr_cols} -m ${nr_rows} 2>&1
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks GEMV $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 nr_cols={nr_cols} nr_rows={nr_rows} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: nr_cols 256 512 768 1024 1536 \
+ ::: nr_rows 512 68 1024 1536 2048 \
+>> ${fn}.txt
diff --git a/GEMV/benchmark-scripts/ccmcc25.sh b/GEMV/benchmark-scripts/ccmcc25.sh
index d0163f4..591a200 100755
--- a/GEMV/benchmark-scripts/ccmcc25.sh
+++ b/GEMV/benchmark-scripts/ccmcc25.sh
@@ -1,9 +1,6 @@
#!/bin/bash
mkdir -p log/$(hostname)
-fn=log/$(hostname)/ccmcc25
-
-source /opt/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh
run_benchmark_nmc() {
local "$@"
@@ -16,11 +13,19 @@ run_benchmark_nmc() {
export -f run_benchmark_nmc
-echo "prim-benchmarks GEMV $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks GEMV $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any nr_cols={nr_cols} nr_rows={nr_rows} \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: nr_cols 2048 4096 8192 \
+ ::: nr_rows 40960 81920 163840 \
+ >> ${fn}.txt
-parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
- run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any nr_cols={nr_cols} nr_rows={nr_rows} \
- ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
- ::: nr_cols 2048 4096 8192 \
- ::: nr_rows 40960 81920 163840 \
->> ${fn}.txt
+done
diff --git a/HST-L/benchmark-scripts/ccmcc25-sim.sh b/HST-L/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..34e841a
--- /dev/null
+++ b/HST-L/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ dfatool_timing=0 aspectc=1 aspectc_timing=1
+ bin/host_code -w 0 -e 5 -b ${bin_size} -i ${input_size}
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks HST-L $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} bin_size=256 \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: input_size $((256 * 256)) $((512 * 512)) $((768 * 768)) $((1024 * 1024)) \
+>> ${fn}.txt
diff --git a/HST-L/benchmark-scripts/ccmcc25.sh b/HST-L/benchmark-scripts/ccmcc25.sh
new file mode 100755
index 0000000..1c939f1
--- /dev/null
+++ b/HST-L/benchmark-scripts/ccmcc25.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ sudo limit_ranks_to_numa_node ${numa_rank}
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ dfatool_timing=0 aspectc=1 aspectc_timing=1
+ bin/host_code -w 0 -e 50 -b ${bin_size} -i ${input_size}
+}
+
+export -f run_benchmark_nmc
+
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks HST-L $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} bin_size=256 numa_rank={numa_rank} \
+ ::: numa_rank any \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: input_size $((1024 * 1024)) $((1536 * 1024)) $((2048 * 1024)) \
+ >> ${fn}.txt
+
+done
diff --git a/HST-L/include/timer.h b/HST-L/include/timer.h
index 5b8eba3..7b80823 100644
--- a/HST-L/include/timer.h
+++ b/HST-L/include/timer.h
@@ -1,5 +1,5 @@
-#pragma once
-
-#define N_TIMERS 7
-#include "../../include/timer_base.h"
-#undef N_TIMERS
+#pragma once
+
+#define N_TIMERS 7
+#include "../../include/timer_base.h"
+#undef N_TIMERS
diff --git a/MLP/benchmark-scripts/ccmcc25-sim.sh b/MLP/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..3abe82e
--- /dev/null
+++ b/MLP/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/mlp_host -w 0 -e 50 -m ${nr_rows} -n ${nr_cols}
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks MLP $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 nr_cols={nr_cols} nr_rows={nr_rows} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: nr_cols 1024 2048 3072 4096 \
+ ::: nr_rows 512 768 1024 2048 \
+>> ${fn}.txt
diff --git a/MLP/benchmark-scripts/ccmcc25.sh b/MLP/benchmark-scripts/ccmcc25.sh
index f7a69fa..02063b9 100755
--- a/MLP/benchmark-scripts/ccmcc25.sh
+++ b/MLP/benchmark-scripts/ccmcc25.sh
@@ -1,27 +1,32 @@
#!/bin/bash
mkdir -p log/$(hostname)
-fn=log/$(hostname)/ccmcc25
-
-source /opt/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh
run_benchmark_nmc() {
local "$@"
set -e
sudo limit_ranks_to_numa_node ${numa_rank}
make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
- dfatool_timing=0 aspectc=1 aspectc_timing=1
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
bin/mlp_host -w 0 -e 50 -m ${nr_rows} -n ${nr_cols}
}
export -f run_benchmark_nmc
-echo "prim-benchmarks MLP $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks MLP $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank={numa_rank} nr_cols={nr_cols} nr_rows={nr_rows} \
+ ::: numa_rank any \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: nr_cols 4096 8192 16384 \
+ ::: nr_rows 1024 2048 4096 \
+ >> ${fn}.txt
-parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
- run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank={numa_rank} nr_cols={nr_cols} nr_rows={nr_rows} \
- ::: numa_rank any \
- ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
- ::: nr_cols 4096 8192 16384 \
- ::: nr_rows 1024 2048 4096 \
->> ${fn}.txt
+done
diff --git a/Microbenchmarks/CPU-DPU/splc25-alloc.sh b/Microbenchmarks/CPU-DPU/splc25-alloc.sh
new file mode 100755
index 0000000..6f4f055
--- /dev/null
+++ b/Microbenchmarks/CPU-DPU/splc25-alloc.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ sudo limit_ranks_to_numa_node ${numa_rank}
+ ./make-size.sh ${size}
+ n_nops=$((size * 256))
+ if make -B NR_RANKS=${nr_ranks} NR_TASKLETS=1 BL=10 DPU_BINARY=\'\"bin/dpu_size\"\' NUMA=1; then
+ for l in $(seq 1 20); do
+ bin/host_code -c ${numa_cpu} -w 1 -e 0 -x 1 -i 65536 -N $n_nops -I $(size -A bin/dpu_size | awk '($1 == ".text") {print $2/8}')
+ done
+ fi
+ return $?
+}
+
+export -f run_benchmark_nmc
+
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+ fn=log/$(hostname)/splc25-alloc-${sdk}
+
+ parallel -j1 --eta --joblog ${fn}.1.joblog --resume --header : \
+ run_benchmark_nmc nr_ranks={nr_ranks} numa_rank={numa_rank} numa_cpu={numa_cpu} size={size} \
+ ::: i $(seq 1 5) \
+ ::: numa_rank -1 \
+ ::: numa_cpu 0 1 \
+ ::: nr_ranks $(seq 1 40) \
+ ::: size $(seq 0 15) \
+ >> ${fn}.txt
+
+done
diff --git a/Microbenchmarks/CPU-DPU/splc25-transfer.sh b/Microbenchmarks/CPU-DPU/splc25-transfer.sh
new file mode 100755
index 0000000..0227cab
--- /dev/null
+++ b/Microbenchmarks/CPU-DPU/splc25-transfer.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+./make-size.sh 0
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ sudo limit_ranks_to_numa_node ${numa_rank}
+ make -B NR_RANKS=${nr_ranks} NR_TASKLETS=1 BL=10 TRANSFER=PUSH NUMA=1
+ bin/host_code -a $numa_in -b $numa_out -c $numa_cpu -w 0 -e 5 -x 0 -N 0 -I $(size -A bin/dpu_code | awk '($1 == ".text") {print $2/8}') -i ${input_size}
+ return $?
+}
+
+export -f run_benchmark_nmc
+
+# The benchmark allocates 3 * 64 * nr_ranks * 8B * input_size (one array for input, one array for output).
+# With 1048576 elements (8 MiB per DPU), this gives a maximum allocation of 60 GiB, which will fit comfortably into system memory (128 GiB).
+# With 2097152 elements (16 MiB per DPU), we may encounter OoM conditions, since the UPMEM SDK also allocates some memory.
+
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+ fn=log/$(hostname)/splc25-transfer-${sdk}
+
+ parallel -j1 --eta --joblog ${fn}.1.joblog --resume --header : \
+ run_benchmark_nmc nr_ranks={nr_ranks} numa_rank={numa_rank} numa_in={numa_in} numa_out={numa_out} numa_cpu={numa_cpu} input_size={input_size} \
+ ::: i $(seq 1 10) \
+ ::: numa_rank -1 \
+ ::: numa_in 1 \
+ ::: numa_out 1 \
+ ::: numa_cpu 1 \
+ ::: nr_ranks $(seq 1 40) \
+ ::: input_size 1 1048576 \
+ >> ${fn}.txt
+done
diff --git a/NW/Makefile b/NW/Makefile
index 30353c9..10276b1 100644
--- a/NW/Makefile
+++ b/NW/Makefile
@@ -1,7 +1,7 @@
NR_TASKLETS ?= 13
-BL ?= 1024
-BL_IN ?= 4
-NR_DPUS ?= 1
+BL ?= 1024
+BL_IN ?= 4
+NR_DPUS ?= 1
ENERGY ?= 0
HOST_SOURCES := $(wildcard host/*.c)
diff --git a/NW/include/timer.h b/NW/include/timer.h
index efaefcd..2fc798f 100644
--- a/NW/include/timer.h
+++ b/NW/include/timer.h
@@ -1,59 +1,59 @@
-/*
- * Copyright (c) 2016 University of Cordoba and University of Illinois
- * All rights reserved.
- *
- * Developed by: IMPACT Research Group
- * University of Cordoba and University of Illinois
- * http://impact.crhc.illinois.edu/
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * with the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * > Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimers.
- * > Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimers in the
- * documentation and/or other materials provided with the distribution.
- * > Neither the names of IMPACT Research Group, University of Cordoba,
- * University of Illinois nor the names of its contributors may be used
- * to endorse or promote products derived from this Software without
- * specific prior written permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
- * THE SOFTWARE.
- *
- */
-
-#include <sys/time.h>
-
-typedef struct Timer{
-
- struct timeval startTime[5];
- struct timeval stopTime[5];
- double time[5];
-
-}Timer;
-
-void start(Timer *timer, int i, int rep) {
- if(rep == 0) {
- timer->time[i] = 0.0;
- }
- gettimeofday(&timer->startTime[i], NULL);
-}
-
-void stop(Timer *timer, int i) {
- gettimeofday(&timer->stopTime[i], NULL);
- timer->time[i] += (timer->stopTime[i].tv_sec - timer->startTime[i].tv_sec) * 1000000.0 +
- (timer->stopTime[i].tv_usec - timer->startTime[i].tv_usec);
-}
-
-void print(Timer *timer, int i, int REP) { printf("Time (ms): %f\t", timer->time[i] / (1000 * REP)); }
+/*
+ * Copyright (c) 2016 University of Cordoba and University of Illinois
+ * All rights reserved.
+ *
+ * Developed by: IMPACT Research Group
+ * University of Cordoba and University of Illinois
+ * http://impact.crhc.illinois.edu/
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * with the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * > Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimers.
+ * > Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimers in the
+ * documentation and/or other materials provided with the distribution.
+ * > Neither the names of IMPACT Research Group, University of Cordoba,
+ * University of Illinois nor the names of its contributors may be used
+ * to endorse or promote products derived from this Software without
+ * specific prior written permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
+ * THE SOFTWARE.
+ *
+ */
+
+#include <sys/time.h>
+
+typedef struct Timer{
+
+ struct timeval startTime[5];
+ struct timeval stopTime[5];
+ double time[5];
+
+}Timer;
+
+void start(Timer *timer, int i, int rep) {
+ if(rep == 0) {
+ timer->time[i] = 0.0;
+ }
+ gettimeofday(&timer->startTime[i], NULL);
+}
+
+void stop(Timer *timer, int i) {
+ gettimeofday(&timer->stopTime[i], NULL);
+ timer->time[i] += (timer->stopTime[i].tv_sec - timer->startTime[i].tv_sec) * 1000000.0 +
+ (timer->stopTime[i].tv_usec - timer->startTime[i].tv_usec);
+}
+
+void print(Timer *timer, int i, int REP) { printf("Time (ms): %f\t", timer->time[i] / (1000 * REP)); }
diff --git a/README.md b/README.md
index 307008e..4f1c8c4 100644
--- a/README.md
+++ b/README.md
@@ -80,9 +80,9 @@ CPU and DPU benchmarks in this repository have been adjusted as follows:
* NW: A
* RED: DLN
* SCAN-SSA: D
-* SCAN-RSS: DLN
+* SCAN-RSS: ADLN
* SEL: DLN
-* SpMV: DL
+* SpMV: ADL
* TRNS: ABDLN
* TS: ADLN
* UNI: DL
diff --git a/RED/Makefile b/RED/Makefile
index f20e1f7..c65df94 100644
--- a/RED/Makefile
+++ b/RED/Makefile
@@ -8,17 +8,34 @@ WITH_ALLOC_OVERHEAD ?= 0
WITH_LOAD_OVERHEAD ?= 0
WITH_FREE_OVERHEAD ?= 0
-COMMON_INCLUDES := support
HOST_SOURCES := $(wildcard host/*.c)
DPU_SOURCES := $(wildcard dpu/*.c)
-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} -DPERF=${PERF} -DWITH_ALLOC_OVERHEAD=${WITH_ALLOC_OVERHEAD} -DWITH_LOAD_OVERHEAD=${WITH_LOAD_OVERHEAD} -DWITH_FREE_OVERHEAD=${WITH_FREE_OVERHEAD}
+aspectc ?= 0
+aspectc_timing ?= 0
+dfatool_timing ?= 1
+
+HOST_CC := ${CC}
+
+COMMON_FLAGS := -Wall -Wextra -g -Iinclude
+HOST_FLAGS := ${COMMON_FLAGS} -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DBL=${BL} -D${TYPE} -DENERGY=${ENERGY} -DPERF=${PERF} -DWITH_ALLOC_OVERHEAD=${WITH_ALLOC_OVERHEAD} -DWITH_LOAD_OVERHEAD=${WITH_LOAD_OVERHEAD} -DWITH_FREE_OVERHEAD=${WITH_FREE_OVERHEAD} -DASPECTC=${aspectc} -DDFATOOL_TIMING=${dfatool_timing}
DPU_FLAGS := ${COMMON_FLAGS} -O2 -DNR_TASKLETS=${NR_TASKLETS} -DBL=${BL} -D${TYPE} -DPERF=${PERF}
+ifeq (${aspectc_timing}, 1)
+ ASPECTC_HOST_FLAGS += -ainclude/dfatool_host_dpu.ah -ainclude/dfatool_host.ah
+endif
+
+ASPECTC_HOST_FLAGS ?= -a0
+
+ifeq (${aspectc}, 1)
+ HOST_CC = ag++ -r repo.acp -v 0 ${ASPECTC_HOST_FLAGS} --c_compiler ${UPMEM_HOME}/bin/clang++ -p . --Xcompiler
+else
+ HOST_FLAGS += -std=c11
+endif
+
QUIET = @
-ifdef verbose
+ifeq (${verbose}, 1)
QUIET =
endif
@@ -27,10 +44,12 @@ all: bin/host_code bin/dpu_code
bin:
${QUIET}mkdir -p bin
-bin/host_code: ${HOST_SOURCES} ${COMMON_INCLUDES} bin
- ${QUIET}${CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
+bin/host_code: ${HOST_SOURCES} include bin
+ ${QUIET}cp ../include/dfatool_host_dpu.ah include
+ ${QUIET}${HOST_CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
+ ${QUIET}rm -f include/dfatool_host_dpu.ah
-bin/dpu_code: ${DPU_SOURCES} ${COMMON_INCLUDES} bin
+bin/dpu_code: ${DPU_SOURCES} include bin
${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES}
clean:
diff --git a/RED/benchmark-scripts/ccmcc25-sim.sh b/RED/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..bc97344
--- /dev/null
+++ b/RED/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 5 -i ${nr_elements} 2>&1
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks BS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 nr_elements={nr_elements} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: nr_elements $((2**20)) $((2**21)) $((2**22)) \
+>> ${fn}.txt
diff --git a/RED/benchmark-scripts/ccmcc25.sh b/RED/benchmark-scripts/ccmcc25.sh
new file mode 100755
index 0000000..074933d
--- /dev/null
+++ b/RED/benchmark-scripts/ccmcc25.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ sudo limit_ranks_to_numa_node ${numa_rank}
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 5 -i ${nr_elements} 2>&1
+}
+
+export -f run_benchmark_nmc
+
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks RED $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any nr_elements={nr_elements} \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: nr_elements $((2**27)) $((2**28)) $((2**29)) \
+ >> ${fn}.txt
+
+done
diff --git a/RED/dpu/task.c b/RED/dpu/task.c
index 5536d4d..90386b2 100644
--- a/RED/dpu/task.c
+++ b/RED/dpu/task.c
@@ -11,8 +11,8 @@
#include <handshake.h>
#include <barrier.h>
-#include "../support/common.h"
-#include "../support/cyclecount.h"
+#include "common.h"
+#include "cyclecount.h"
__host dpu_arguments_t DPU_INPUT_ARGUMENTS;
__host dpu_results_t DPU_RESULTS[NR_TASKLETS];
diff --git a/RED/host/app.c b/RED/host/app.c
index 204f056..cb7a6ac 100644
--- a/RED/host/app.c
+++ b/RED/host/app.c
@@ -7,15 +7,31 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
+
+#if ASPECTC
+extern "C" {
+#endif
+
#include <dpu.h>
#include <dpu_log.h>
+#include <dpu_management.h>
+#include <dpu_target_macros.h>
+
+#if ENERGY
+#include <dpu_probe.h>
+#endif
+
+#if ASPECTC
+}
+#endif
+
#include <unistd.h>
#include <getopt.h>
#include <assert.h>
-#include "../support/common.h"
-#include "../support/timer.h"
-#include "../support/params.h"
+#include "common.h"
+#include "timer.h"
+#include "params.h"
// Define the DPU Binary path as DPU_BINARY here
#ifndef DPU_BINARY
@@ -25,13 +41,6 @@
#define XSTR(x) STR(x)
#define STR(x) #x
-#if ENERGY
-#include <dpu_probe.h>
-#endif
-
-#include <dpu_management.h>
-#include <dpu_target_macros.h>
-
// Pointer declaration
static T* A;
@@ -70,17 +79,17 @@ int main(int argc, char **argv) {
// Allocate DPUs and load binary
#if !WITH_ALLOC_OVERHEAD
DPU_ASSERT(dpu_alloc(NR_DPUS, NULL, &dpu_set));
- timer.time[0] = 0; // alloc
+ zero(&timer, 0); // alloc
#endif
#if !WITH_LOAD_OVERHEAD
DPU_ASSERT(dpu_load(dpu_set, DPU_BINARY, NULL));
DPU_ASSERT(dpu_get_nr_dpus(dpu_set, &nr_of_dpus));
DPU_ASSERT(dpu_get_nr_ranks(dpu_set, &nr_of_ranks));
assert(nr_of_dpus == NR_DPUS);
- timer.time[1] = 0; // load
+ zero(&timer, 1); // load
#endif
#if !WITH_FREE_OVERHEAD
- timer.time[6] = 0; // free
+ zero(&timer, 6); // free
#endif
#if ENERGY
@@ -102,7 +111,7 @@ int main(int argc, char **argv) {
((input_size_dpu * sizeof(T)) % 8) != 0 ? roundup(input_size_dpu, 8) : input_size_dpu; // Input size per DPU (max.), 8-byte aligned
// Input/output allocation
- A = malloc(input_size_dpu_8bytes * NR_DPUS * sizeof(T));
+ A = (T*)malloc(input_size_dpu_8bytes * NR_DPUS * sizeof(T));
T *bufferA = A;
T count = 0;
T count_host = 0;
@@ -168,12 +177,12 @@ int main(int argc, char **argv) {
// Input arguments
unsigned int kernel = 0;
dpu_arguments_t input_arguments[NR_DPUS];
- for(i=0; i<NR_DPUS-1; i++) {
- input_arguments[i].size=input_size_dpu_8bytes * sizeof(T);
- input_arguments[i].kernel=kernel;
+ for(int j=0; j<NR_DPUS-1; j++) {
+ input_arguments[j].size=input_size_dpu_8bytes * sizeof(T);
+ input_arguments[j].kernel=(enum kernels)kernel;
}
input_arguments[NR_DPUS-1].size=(input_size_8bytes - input_size_dpu_8bytes * (NR_DPUS-1)) * sizeof(T);
- input_arguments[NR_DPUS-1].kernel=kernel;
+ input_arguments[NR_DPUS-1].kernel=(enum kernels)kernel;
// Copy input arrays
i = 0;
DPU_FOREACH(dpu_set, dpu, i) {
@@ -218,7 +227,7 @@ int main(int argc, char **argv) {
//printf("Retrieve results\n");
dpu_results_t results[NR_DPUS];
- T* results_count = malloc(NR_DPUS * sizeof(T));
+ T* results_count = (T*)malloc(NR_DPUS * sizeof(T));
if(rep >= p.n_warmup)
start(&timer, 5, 0);
i = 0;
@@ -302,11 +311,11 @@ int main(int argc, char **argv) {
if (status) {
printf("[" ANSI_COLOR_GREEN "OK" ANSI_COLOR_RESET "] Outputs are equal\n");
if (rep >= p.n_warmup) {
- printf("[::] RED UPMEM | n_dpus=%d n_ranks=%d n_tasklets=%d e_type=%s block_size_B=%d n_elements=%d",
+ dfatool_printf("[::] RED UPMEM | n_dpus=%d n_ranks=%d n_tasklets=%d e_type=%s block_size_B=%d n_elements=%d",
NR_DPUS, nr_of_ranks, NR_TASKLETS, XSTR(T), BLOCK_SIZE, input_size);
- printf(" b_with_alloc_overhead=%d b_with_load_overhead=%d b_with_free_overhead=%d numa_node_rank=%d ",
+ dfatool_printf(" b_with_alloc_overhead=%d b_with_load_overhead=%d b_with_free_overhead=%d numa_node_rank=%d ",
WITH_ALLOC_OVERHEAD, WITH_LOAD_OVERHEAD, WITH_FREE_OVERHEAD, numa_node_rank);
- printf("| latency_alloc_us=%f latency_load_us=%f latency_cpu_us=%f latency_write_us=%f latency_kernel_us=%f latency_read_us=%f latency_free_us=%f",
+ dfatool_printf("| latency_alloc_us=%f latency_load_us=%f latency_cpu_us=%f latency_write_us=%f latency_kernel_us=%f latency_read_us=%f latency_free_us=%f",
timer.time[0],
timer.time[1],
timer.time[2],
@@ -314,19 +323,19 @@ int main(int argc, char **argv) {
timer.time[4],
timer.time[5],
timer.time[6]);
- printf(" throughput_cpu_MBps=%f throughput_upmem_kernel_MBps=%f throughput_upmem_total_MBps=%f",
+ dfatool_printf(" throughput_cpu_MBps=%f throughput_upmem_kernel_MBps=%f throughput_upmem_total_MBps=%f",
input_size * sizeof(T) / timer.time[2],
input_size * sizeof(T) / (timer.time[4]),
input_size * sizeof(T) / (timer.time[0] + timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6]));
- printf(" throughput_upmem_wxr_MBps=%f throughput_upmem_lwxr_MBps=%f throughput_upmem_alwxr_MBps=%f",
+ dfatool_printf(" throughput_upmem_wxr_MBps=%f throughput_upmem_lwxr_MBps=%f throughput_upmem_alwxr_MBps=%f",
input_size * sizeof(T) / (timer.time[3] + timer.time[4] + timer.time[5]),
input_size * sizeof(T) / (timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5]),
input_size * sizeof(T) / (timer.time[0] + timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5]));
- printf(" throughput_cpu_MOpps=%f throughput_upmem_kernel_MOpps=%f throughput_upmem_total_MOpps=%f",
+ dfatool_printf(" throughput_cpu_MOpps=%f throughput_upmem_kernel_MOpps=%f throughput_upmem_total_MOpps=%f",
input_size / timer.time[2],
input_size / (timer.time[4]),
input_size / (timer.time[0] + timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6]));
- printf(" throughput_upmem_wxr_MOpps=%f throughput_upmem_lwxr_MOpps=%f throughput_upmem_alwxr_MOpps=%f\n",
+ dfatool_printf(" throughput_upmem_wxr_MOpps=%f throughput_upmem_lwxr_MOpps=%f throughput_upmem_alwxr_MOpps=%f\n",
input_size / (timer.time[3] + timer.time[4] + timer.time[5]),
input_size / (timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5]),
input_size / (timer.time[0] + timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5]));
diff --git a/RED/support/common.h b/RED/include/common.h
index 121bf31..6cc1ae2 100755..100644
--- a/RED/support/common.h
+++ b/RED/include/common.h
@@ -38,19 +38,21 @@
#define DIV 1 // Shift right to divide by sizeof(T)
#endif
+enum kernels {
+ kernel1 = 0,
+ nr_kernels = 1,
+};
+
// Structures used by both the host and the dpu to communicate information
typedef struct {
- uint32_t size;
- enum kernels {
- kernel1 = 0,
- nr_kernels = 1,
- } kernel;
- T t_count;
+ uint32_t size;
+ enum kernels kernel;
+ T t_count;
} dpu_arguments_t;
typedef struct {
- uint64_t cycles;
- T t_count;
+ uint64_t cycles;
+ T t_count;
} dpu_results_t;
#ifndef PERF
diff --git a/RED/support/cyclecount.h b/RED/include/cyclecount.h
index c4247b5..c4247b5 100644
--- a/RED/support/cyclecount.h
+++ b/RED/include/cyclecount.h
diff --git a/RED/include/dfatool_host.ah b/RED/include/dfatool_host.ah
new file mode 100644
index 0000000..88dfbd8
--- /dev/null
+++ b/RED/include/dfatool_host.ah
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <sys/time.h>
+#include "dfatool_host_dpu.ah"
+
+aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long n_elements;
+ unsigned int element_size;
+
+ virtual int getKernel() { return 1; }
+
+ DfatoolHostTiming() {
+ element_size = sizeof(T);
+ }
+
+ advice call("% input_params(...)") : after() {
+ Params* p = tjp->result();
+ n_elements = p->input_size;
+ printf("[>>] RED | n_dpus=%u n_elements=%lu\n", NR_DPUS, n_elements);
+ }
+
+ advice call("% reduction_host(...)") : after() {
+ printf("[--] RED | n_dpus=%u n_elements=%lu\n", n_dpus, n_elements);
+ }
+
+ advice execution("% main(...)") : after() {
+ printf("[<<] RED | n_dpus=%u n_elements=%lu\n", NR_DPUS, n_elements);
+ }
+};
diff --git a/RED/support/params.h b/RED/include/params.h
index 97bc50a..ee90908 100644
--- a/RED/support/params.h
+++ b/RED/include/params.h
@@ -18,7 +18,7 @@ static void usage() {
"\n -h help"
"\n -w <W> # of untimed warmup iterations (default=1)"
"\n -e <E> # of timed repetition iterations (default=3)"
- "\n -x <X> Weak (0) or strong (1) scaling (default=0)"
+ "\n -x <X> Weak (0) or strong (1) scaling (default=1)"
"\n"
"\nBenchmark-specific options:"
"\n -i <I> input size (default=6553600 elements)"
@@ -30,7 +30,7 @@ struct Params input_params(int argc, char **argv) {
p.input_size = 6553600;
p.n_warmup = 1;
p.n_reps = 3;
- p.exp = 0;
+ p.exp = 1;
int opt;
while((opt = getopt(argc, argv, "hi:w:e:x:")) >= 0) {
diff --git a/RED/include/timer.h b/RED/include/timer.h
new file mode 100644
index 0000000..7b80823
--- /dev/null
+++ b/RED/include/timer.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#define N_TIMERS 7
+#include "../../include/timer_base.h"
+#undef N_TIMERS
diff --git a/RED/support/timer.h b/RED/support/timer.h
deleted file mode 100755
index 4d597b9..0000000
--- a/RED/support/timer.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2016 University of Cordoba and University of Illinois
- * All rights reserved.
- *
- * Developed by: IMPACT Research Group
- * University of Cordoba and University of Illinois
- * http://impact.crhc.illinois.edu/
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * with the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * > Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimers.
- * > Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimers in the
- * documentation and/or other materials provided with the distribution.
- * > Neither the names of IMPACT Research Group, University of Cordoba,
- * University of Illinois nor the names of its contributors may be used
- * to endorse or promote products derived from this Software without
- * specific prior written permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
- * THE SOFTWARE.
- *
- */
-
-#include <sys/time.h>
-
-typedef struct Timer{
-
- struct timeval startTime[7];
- struct timeval stopTime[7];
- double time[7];
-
-}Timer;
-
-void start(Timer *timer, int i, int rep) {
- if(rep == 0) {
- timer->time[i] = 0.0;
- }
- gettimeofday(&timer->startTime[i], NULL);
-}
-
-void stop(Timer *timer, int i) {
- gettimeofday(&timer->stopTime[i], NULL);
- timer->time[i] += (timer->stopTime[i].tv_sec - timer->startTime[i].tv_sec) * 1000000.0 +
- (timer->stopTime[i].tv_usec - timer->startTime[i].tv_usec);
-}
-
-void print(Timer *timer, int i, int REP) { printf("Time (ms): %f\t", timer->time[i] / (1000 * REP)); }
-
-void printall(Timer *timer, int maxt) {
- for (int i = 0; i <= maxt; i++) {
- printf(" timer%d_us=%f", i, timer->time[i]);
- }
- printf("\n");
-}
diff --git a/SCAN-RSS/Makefile b/SCAN-RSS/Makefile
index f1975e8..d55eb07 100644
--- a/SCAN-RSS/Makefile
+++ b/SCAN-RSS/Makefile
@@ -8,17 +8,34 @@ WITH_ALLOC_OVERHEAD ?= 0
WITH_LOAD_OVERHEAD ?= 0
WITH_FREE_OVERHEAD ?= 0
-COMMON_INCLUDES := support
HOST_SOURCES := $(wildcard host/*.c)
DPU_SOURCES := $(wildcard dpu/*.c)
-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} -DWITH_ALLOC_OVERHEAD=${WITH_ALLOC_OVERHEAD} -DWITH_LOAD_OVERHEAD=${WITH_LOAD_OVERHEAD} -DWITH_FREE_OVERHEAD=${WITH_FREE_OVERHEAD}
+aspectc ?= 0
+aspectc_timing ?= 0
+dfatool_timing ?= 1
+
+HOST_CC := ${CC}
+
+COMMON_FLAGS := -Wall -Wextra -g -Iinclude -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DBL=${BL} -D${TYPE} -DUNROLL=${UNROLL}
+HOST_FLAGS := ${COMMON_FLAGS} -O3 `dpu-pkg-config --cflags --libs dpu` -DENERGY=${ENERGY} -DWITH_ALLOC_OVERHEAD=${WITH_ALLOC_OVERHEAD} -DWITH_LOAD_OVERHEAD=${WITH_LOAD_OVERHEAD} -DWITH_FREE_OVERHEAD=${WITH_FREE_OVERHEAD} -DDFATOOL_TIMING=${dfatool_timing} -DASPECTC=${aspectc}
DPU_FLAGS := ${COMMON_FLAGS} -O2
+ifeq (${aspectc_timing}, 1)
+ ASPECTC_HOST_FLAGS += -ainclude/dfatool_host_dpu.ah -ainclude/dfatool_host.ah
+endif
+
+ASPECTC_HOST_FLAGS ?= -a0
+
+ifeq (${aspectc}, 1)
+ HOST_CC = ag++ -r repo.acp -v 0 ${ASPECTC_HOST_FLAGS} --c_compiler ${UPMEM_HOME}/bin/clang++ -p . --Xcompiler
+else
+ HOST_FLAGS += -std=c11
+endif
+
QUIET = @
-ifdef verbose
+ifeq (${verbose}, 1)
QUIET =
endif
@@ -27,10 +44,13 @@ all: bin/dpu_code bin/host_code
bin:
${QUIET}mkdir -p bin
-bin/host_code: ${HOST_SOURCES} ${COMMON_INCLUDES} bin
- ${QUIET}${CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
+# cp/rm are needed to work around AspectC++ not liking symlinks
+bin/host_code: ${HOST_SOURCES} include bin
+ ${QUIET}cp ../include/dfatool_host_dpu.ah include
+ ${QUIET}${HOST_CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
+ ${QUIET}rm -f include/dfatool_host_dpu.ah
-bin/dpu_code: ${DPU_SOURCES} ${COMMON_INCLUDES} bin
+bin/dpu_code: ${DPU_SOURCES} include bin
${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES}
clean:
diff --git a/SCAN-RSS/benchmark-scripts/ccmcc25-sim.sh b/SCAN-RSS/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..2715db7
--- /dev/null
+++ b/SCAN-RSS/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 5 -i ${input_size}
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks SCAN-RSS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: input_size $((2**22)) $((2**23)) $((2**24)) \
+>> ${fn}.txt
diff --git a/SCAN-RSS/benchmark-scripts/ccmcc25.sh b/SCAN-RSS/benchmark-scripts/ccmcc25.sh
new file mode 100755
index 0000000..ff0a31e
--- /dev/null
+++ b/SCAN-RSS/benchmark-scripts/ccmcc25.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ sudo limit_ranks_to_numa_node ${numa_rank}
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 50 -i ${input_size}
+}
+
+export -f run_benchmark_nmc
+
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks SCAN-RSS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} numa_rank={numa_rank} \
+ ::: numa_rank any \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: input_size $((2**27)) $((2**28)) $((2**29)) \
+ >> ${fn}.txt
+
+done
diff --git a/SCAN-RSS/dpu/task.c b/SCAN-RSS/dpu/task.c
index 7a4b029..afc42c7 100644
--- a/SCAN-RSS/dpu/task.c
+++ b/SCAN-RSS/dpu/task.c
@@ -11,7 +11,7 @@
#include <handshake.h>
#include <barrier.h>
-#include "../support/common.h"
+#include "common.h"
__host dpu_arguments_t DPU_INPUT_ARGUMENTS;
__host dpu_results_t DPU_RESULTS[NR_TASKLETS];
diff --git a/SCAN-RSS/host/app.c b/SCAN-RSS/host/app.c
index 6771207..ffcc2cf 100644
--- a/SCAN-RSS/host/app.c
+++ b/SCAN-RSS/host/app.c
@@ -7,15 +7,31 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
+
+#if ASPECTC
+extern "C" {
+#endif
+
#include <dpu.h>
#include <dpu_log.h>
+#include <dpu_management.h>
+#include <dpu_target_macros.h>
+
+#if ENERGY
+#include <dpu_probe.h>
+#endif
+
+#if ASPECTC
+}
+#endif
+
#include <unistd.h>
#include <getopt.h>
#include <assert.h>
-#include "../support/common.h"
-#include "../support/timer.h"
-#include "../support/params.h"
+#include "common.h"
+#include "timer.h"
+#include "params.h"
// Define the DPU Binary path as DPU_BINARY here
#ifndef DPU_BINARY
@@ -25,12 +41,7 @@
#define XSTR(x) STR(x)
#define STR(x) #x
-#if ENERGY
-#include <dpu_probe.h>
-#endif
-
-#include <dpu_management.h>
-#include <dpu_target_macros.h>
+unsigned int kernel;
// Pointer declaration
static T* A;
@@ -78,17 +89,17 @@ int main(int argc, char **argv) {
// Allocate DPUs and load binary
#if !WITH_ALLOC_OVERHEAD
DPU_ASSERT(dpu_alloc(NR_DPUS, NULL, &dpu_set));
- timer.time[0] = 0; // alloc
+ zero(&timer, 0);
#endif
#if !WITH_LOAD_OVERHEAD
DPU_ASSERT(dpu_load(dpu_set, DPU_BINARY, NULL));
DPU_ASSERT(dpu_get_nr_dpus(dpu_set, &nr_of_dpus));
DPU_ASSERT(dpu_get_nr_ranks(dpu_set, &nr_of_ranks));
assert(nr_of_dpus == NR_DPUS);
- timer.time[1] = 0; // load
+ zero(&timer, 1);
#endif
#if !WITH_FREE_OVERHEAD
- timer.time[6] = 0; // free
+ zero(&timer, 6);
#endif
unsigned int i = 0;
@@ -100,8 +111,8 @@ int main(int argc, char **argv) {
(input_size_dpu_ % (NR_TASKLETS * REGS) != 0) ? roundup(input_size_dpu_, (NR_TASKLETS * REGS)) : input_size_dpu_; // Input size per DPU (max.), 8-byte aligned
// Input/output allocation
- A = malloc(input_size_dpu_round * NR_DPUS * sizeof(T));
- C = malloc(input_size_dpu_round * NR_DPUS * sizeof(T));
+ A = (T*) malloc(input_size_dpu_round * NR_DPUS * sizeof(T));
+ C = (T*) malloc(input_size_dpu_round * NR_DPUS * sizeof(T));
T *bufferA = A;
T *bufferC = C;
@@ -167,8 +178,8 @@ int main(int argc, char **argv) {
}
// Input arguments
const unsigned int input_size_dpu = input_size_dpu_round;
- unsigned int kernel = 0;
- dpu_arguments_t input_arguments = {input_size_dpu * sizeof(T), kernel, 0};
+ kernel = 0;
+ dpu_arguments_t input_arguments = {(uint32_t)(input_size_dpu * sizeof(T)), (enum kernels)kernel, 0};
// Copy input arrays
i = 0;
DPU_FOREACH(dpu_set, dpu, i) {
@@ -214,7 +225,7 @@ int main(int argc, char **argv) {
//printf("Retrieve results\n");
dpu_results_t results[nr_of_dpus];
- T* results_scan = malloc(nr_of_dpus * sizeof(T));
+ T* results_scan = (T*) malloc(nr_of_dpus * sizeof(T));
i = 0;
accum = 0;
@@ -251,7 +262,7 @@ int main(int argc, char **argv) {
dpu_arguments_t input_arguments_2[NR_DPUS];
for(i=0; i<nr_of_dpus; i++) {
input_arguments_2[i].size=input_size_dpu * sizeof(T);
- input_arguments_2[i].kernel=kernel;
+ input_arguments_2[i].kernel=(enum kernels)kernel;
input_arguments_2[i].t_count=results_scan[i];
}
DPU_FOREACH(dpu_set, dpu, i) {
@@ -332,11 +343,11 @@ int main(int argc, char **argv) {
}
if (status) {
printf("[" ANSI_COLOR_GREEN "OK" ANSI_COLOR_RESET "] Outputs are equal\n");
- printf("[::] SCAN-RSS UPMEM | n_dpus=%d n_ranks=%d n_tasklets=%d e_type=%s block_size_B=%d b_unroll=%d n_elements=%d",
+ dfatool_printf("[::] SCAN-RSS-UPMEM | n_dpus=%d n_ranks=%d n_tasklets=%d e_type=%s block_size_B=%d b_unroll=%d n_elements=%d",
NR_DPUS, nr_of_ranks, NR_TASKLETS, XSTR(T), BLOCK_SIZE, UNROLL, input_size);
- printf(" b_with_alloc_overhead=%d b_with_load_overhead=%d b_with_free_overhead=%d numa_node_rank=%d ",
+ dfatool_printf(" b_with_alloc_overhead=%d b_with_load_overhead=%d b_with_free_overhead=%d numa_node_rank=%d ",
WITH_ALLOC_OVERHEAD, WITH_LOAD_OVERHEAD, WITH_FREE_OVERHEAD, numa_node_rank);
- printf("| latency_alloc_us=%f latency_load_us=%f latency_cpu_us=%f latency_write_us=%f latency_kernel_us=%f latency_sync_us=%f latency_read_us=%f latency_free_us=%f",
+ dfatool_printf("| latency_alloc_us=%f latency_load_us=%f latency_cpu_us=%f latency_write_us=%f latency_kernel_us=%f latency_sync_us=%f latency_read_us=%f latency_free_us=%f",
timer.time[0],
timer.time[1],
timer.time[2],
@@ -345,20 +356,20 @@ int main(int argc, char **argv) {
timer.time[5], // sync
timer.time[7], // read
timer.time[8]);
- printf(" throughput_cpu_MBps=%f throughput_upmem_kernel_MBps=%f throughput_upmem_total_MBps=%f",
+ dfatool_printf(" throughput_cpu_MBps=%f throughput_upmem_kernel_MBps=%f throughput_upmem_total_MBps=%f",
input_size * sizeof(T) / timer.time[2],
input_size * sizeof(T) / (timer.time[4] + timer.time[5] + timer.time[6]),
input_size * sizeof(T) / (timer.time[0] + timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6] + timer.time[7] + timer.time[8]));
- printf(" throughput_upmem_s_MBps=%f throughput_upmem_wxsxr_MBps=%f throughput_upmem_lwxsxr_MBps=%f throughput_upmem_alwxsxr_MBps=%f",
+ dfatool_printf(" throughput_upmem_s_MBps=%f throughput_upmem_wxsxr_MBps=%f throughput_upmem_lwxsxr_MBps=%f throughput_upmem_alwxsxr_MBps=%f",
input_size * sizeof(T) / (timer.time[5]),
input_size * sizeof(T) / (timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6] + timer.time[7]),
input_size * sizeof(T) / (timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6] + timer.time[7]),
input_size * sizeof(T) / (timer.time[0] + timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6] + timer.time[7]));
- printf(" throughput_cpu_MOpps=%f throughput_upmem_kernel_MOpps=%f throughput_upmem_total_MOpps=%f",
+ dfatool_printf(" throughput_cpu_MOpps=%f throughput_upmem_kernel_MOpps=%f throughput_upmem_total_MOpps=%f",
input_size / timer.time[2],
input_size / (timer.time[4] + timer.time[5] + timer.time[6]),
input_size / (timer.time[0] + timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6] + timer.time[7] + timer.time[8]));
- printf(" throughput_upmem_s_MOpps=%f throughput_upmem_wxsxr_MOpps=%f throughput_upmem_lwxsxr_MOpps=%f throughput_upmem_alwxsxr_MOpps=%f\n",
+ dfatool_printf(" throughput_upmem_s_MOpps=%f throughput_upmem_wxsxr_MOpps=%f throughput_upmem_lwxsxr_MOpps=%f throughput_upmem_alwxsxr_MOpps=%f\n",
input_size / (timer.time[5]),
input_size / (timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6] + timer.time[7]),
input_size / (timer.time[1] + timer.time[3] + timer.time[4] + timer.time[5] + timer.time[6] + timer.time[7]),
diff --git a/SCAN-RSS/support/common.h b/SCAN-RSS/include/common.h
index be19a8c..859a3fe 100755..100644
--- a/SCAN-RSS/support/common.h
+++ b/SCAN-RSS/include/common.h
@@ -40,15 +40,17 @@
#define REGS (BLOCK_SIZE >> DIV)
+enum kernels {
+ kernel1 = 0,
+ kernel2 = 1,
+ nr_kernels = 2,
+};
+
// Structures used by both the host and the dpu to communicate information
typedef struct {
- uint32_t size;
- enum kernels {
- kernel1 = 0,
- kernel2 = 1,
- nr_kernels = 2,
- } kernel;
- T t_count;
+ uint32_t size;
+ enum kernels kernel;
+ T t_count;
} dpu_arguments_t;
typedef struct {
diff --git a/SCAN-RSS/include/dfatool_host.ah b/SCAN-RSS/include/dfatool_host.ah
new file mode 100644
index 0000000..6d2fad5
--- /dev/null
+++ b/SCAN-RSS/include/dfatool_host.ah
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <sys/time.h>
+#include "dfatool_host_dpu.ah"
+
+aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long n_elements;
+ unsigned int element_size;
+
+ virtual int getKernel() { return 1; }
+
+ DfatoolHostTiming() {
+ element_size = sizeof(T);
+ }
+
+ advice call("% input_params(...)") : after() {
+ Params* p = tjp->result();
+ n_elements = p->input_size;
+ printf("[>>] SCAN-RSS | n_dpus=%u n_elements=%lu\n", NR_DPUS, n_elements);
+ }
+
+ advice call("% scan_host(...)") : after() {
+ printf("[--] SCAN-RSS | n_dpus=%u n_elements=%lu\n", n_dpus, n_elements);
+ }
+
+ advice execution("% main(...)") : after() {
+ printf("[<<] SCAN-RSS | n_dpus=%u n_elements=%lu\n", NR_DPUS, n_elements);
+ }
+};
diff --git a/SCAN-RSS/support/params.h b/SCAN-RSS/include/params.h
index 9f6aacc..a96b33f 100644
--- a/SCAN-RSS/support/params.h
+++ b/SCAN-RSS/include/params.h
@@ -18,7 +18,7 @@ static void usage() {
"\n -h help"
"\n -w <W> # of untimed warmup iterations (default=1)"
"\n -e <E> # of timed repetition iterations (default=3)"
- "\n -x <X> Weak (0) or strong (1) scaling (default=0)"
+ "\n -x <X> Weak (0) or strong (1) scaling (default=1)"
"\n"
"\nBenchmark-specific options:"
"\n -i <I> input size (default=3932160 elements)"
@@ -30,7 +30,7 @@ struct Params input_params(int argc, char **argv) {
p.input_size = 3932160;
p.n_warmup = 1;
p.n_reps = 3;
- p.exp = 0;
+ p.exp = 1;
int opt;
while((opt = getopt(argc, argv, "hi:w:e:x:")) >= 0) {
diff --git a/SCAN-RSS/include/timer.h b/SCAN-RSS/include/timer.h
new file mode 100644
index 0000000..313151d
--- /dev/null
+++ b/SCAN-RSS/include/timer.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#define N_TIMERS 9
+#include "../../include/timer_base.h"
+#undef N_TIMERS
diff --git a/SCAN-RSS/run-paper-strong-full.sh b/SCAN-RSS/run-paper-strong-full.sh
deleted file mode 100755
index a00e96d..0000000
--- a/SCAN-RSS/run-paper-strong-full.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-set -e
-
-(
-
-echo "prim-benchmarks SCAN-RSS strong-full (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-# >2048 is not part of upstream
-for nr_dpus in 2543 2304 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
deleted file mode 100755
index 3391a1b..0000000
--- a/SCAN-RSS/run-paper-strong-rank.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-set -e
-
-(
-
-echo "prim-benchmarks SCAN-RSS strong-rank (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-# >64 are not part of upstream config space
-for nr_dpus in 128 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
deleted file mode 100755
index 053d9a6..0000000
--- a/SCAN-RSS/run-paper-weak.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/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
diff --git a/SCAN-RSS/run.sh b/SCAN-RSS/run.sh
deleted file mode 100755
index 1c39f7c..0000000
--- a/SCAN-RSS/run.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-for i in 2048 4096 8192 16384 65536 262144 1048576 3932160
-do
- NR_DPUS=1 NR_TASKLETS=16 BL=10 VERSION=SINGLE make all
- wait
- ./bin/host_code -w 10 -e 100 -i ${i} > profile/out${i}_tl16_bl10_dpu11
- wait
- make clean
- wait
-done
diff --git a/SCAN-RSS/support/timer.h b/SCAN-RSS/support/timer.h
deleted file mode 100755
index 3ec6d87..0000000
--- a/SCAN-RSS/support/timer.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2016 University of Cordoba and University of Illinois
- * All rights reserved.
- *
- * Developed by: IMPACT Research Group
- * University of Cordoba and University of Illinois
- * http://impact.crhc.illinois.edu/
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * with the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * > Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimers.
- * > Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimers in the
- * documentation and/or other materials provided with the distribution.
- * > Neither the names of IMPACT Research Group, University of Cordoba,
- * University of Illinois nor the names of its contributors may be used
- * to endorse or promote products derived from this Software without
- * specific prior written permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
- * THE SOFTWARE.
- *
- */
-
-#include <sys/time.h>
-
-typedef struct Timer{
-
- struct timeval startTime[9];
- struct timeval stopTime[9];
- double time[9];
-
-}Timer;
-
-void start(Timer *timer, int i, int rep) {
- if(rep == 0) {
- timer->time[i] = 0.0;
- }
- gettimeofday(&timer->startTime[i], NULL);
-}
-
-void stop(Timer *timer, int i) {
- gettimeofday(&timer->stopTime[i], NULL);
- timer->time[i] += (timer->stopTime[i].tv_sec - timer->startTime[i].tv_sec) * 1000000.0 +
- (timer->stopTime[i].tv_usec - timer->startTime[i].tv_usec);
-}
-
-void print(Timer *timer, int i, int REP) { printf("Time (ms): %f\t", timer->time[i] / (1000 * REP)); }
-
-void printall(Timer *timer, int maxt) {
- for (int i = 0; i <= maxt; i++) {
- printf(" timer%d_us=%f", i, timer->time[i]);
- }
- printf("\n");
-}
diff --git a/SCAN-SSA/Makefile b/SCAN-SSA/Makefile
index 319f2da..c741138 100644
--- a/SCAN-SSA/Makefile
+++ b/SCAN-SSA/Makefile
@@ -9,14 +9,31 @@ HOST_SOURCES := $(wildcard host/app.c)
OMP_SOURCES := $(wildcard host/omp.c)
DPU_SOURCES := $(wildcard dpu/*.c)
-COMMON_INCLUDES := support
-COMMON_FLAGS = -Wall -Wextra -O2 -I${COMMON_INCLUDES} -DNR_DPUS=${NR_DPUS} -DNR_TASKLETS=${NR_TASKLETS} -DBL=${BL} -D${TYPE} -DUNROLL=${UNROLL}
-HOST_FLAGS = ${COMMON_FLAGS} -std=c11 `dpu-pkg-config --cflags --libs dpu`
+aspectc ?= 0
+aspectc_timing ?= 0
+dfatool_timing ?= 1
+
+HOST_CC := ${CC}
+
+COMMON_FLAGS = -Wall -Wextra -O2 -Iinclude -DNR_DPUS=${NR_DPUS} -DNR_TASKLETS=${NR_TASKLETS} -DBL=${BL} -D${TYPE} -DUNROLL=${UNROLL}
+HOST_FLAGS = ${COMMON_FLAGS} `dpu-pkg-config --cflags --libs dpu` -DDFATOOL_TIMING=${dfatool_timing} -DASPECTC=${aspectc}
DPU_FLAGS = ${COMMON_FLAGS}
+ifeq (${aspectc_timing}, 1)
+ ASPECTC_HOST_FLAGS += -ainclude/dfatool_host_dpu.ah -ainclude/dfatool_host.ah
+endif
+
+ASPECTC_HOST_FLAGS ?= -a0
+
+ifeq (${aspectc}, 1)
+ HOST_CC = ag++ -r repo.acp -v 0 ${ASPECTC_HOST_FLAGS} --c_compiler ${UPMEM_HOME}/bin/clang++ -p . --Xcompiler
+else
+ HOST_FLAGS += -std=c11
+endif
+
QUIET = @
-ifdef verbose
+ifeq (${verbose}, 1)
QUIET =
endif
@@ -29,7 +46,9 @@ bin/dpu_code: ${DPU_SOURCES} bin
${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} ${DPU_SOURCES} -o $@
bin/host_code: ${HOST_SOURCES} bin
- ${QUIET}${CC} ${HOST_FLAGS} ${HOST_SOURCES} -o $@
+ ${QUIET}cp ../include/dfatool_host_dpu.ah include
+ ${QUIET}${HOST_CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
+ ${QUIET}rm -f include/dfatool_host_dpu.ah
bin/omp_code: ${OMP_SOURCES}
${QUIET}${CC} ${HOST_FLAGS} -fopenmp ${OMP_SOURCES} -o $@
diff --git a/SCAN-SSA/benchmark-scripts/ccmcc25-sim.sh b/SCAN-SSA/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..2715db7
--- /dev/null
+++ b/SCAN-SSA/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 5 -i ${input_size}
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks SCAN-RSS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: input_size $((2**22)) $((2**23)) $((2**24)) \
+>> ${fn}.txt
diff --git a/SCAN-SSA/benchmark-scripts/ccmcc25.sh b/SCAN-SSA/benchmark-scripts/ccmcc25.sh
new file mode 100755
index 0000000..c9655c8
--- /dev/null
+++ b/SCAN-SSA/benchmark-scripts/ccmcc25.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ sudo limit_ranks_to_numa_node ${numa_rank}
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 50 -i ${input_size}
+}
+
+export -f run_benchmark_nmc
+
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks SCAN-SSA $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} numa_rank={numa_rank} \
+ ::: numa_rank any \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: input_size $((2**27)) $((2**28)) $((2**29)) \
+ >> ${fn}.txt
+
+done
diff --git a/SCAN-SSA/dpu/task.c b/SCAN-SSA/dpu/task.c
index 15411a4..76f393d 100644
--- a/SCAN-SSA/dpu/task.c
+++ b/SCAN-SSA/dpu/task.c
@@ -11,7 +11,7 @@
#include <handshake.h>
#include <barrier.h>
-#include "../support/common.h"
+#include "common.h"
__host dpu_arguments_t DPU_INPUT_ARGUMENTS;
__host dpu_results_t DPU_RESULTS[NR_TASKLETS];
diff --git a/SCAN-SSA/host/app.c b/SCAN-SSA/host/app.c
index 25471fe..8675f17 100644
--- a/SCAN-SSA/host/app.c
+++ b/SCAN-SSA/host/app.c
@@ -7,15 +7,29 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
+
+#if ASPECTC
+extern "C" {
+#endif
+
#include <dpu.h>
#include <dpu_log.h>
+
+#if ENERGY
+#include <dpu_probe.h>
+#endif
+
+#if ASPECTC
+}
+#endif
+
#include <unistd.h>
#include <getopt.h>
#include <assert.h>
-#include "../support/common.h"
-#include "../support/timer.h"
-#include "../support/params.h"
+#include "common.h"
+#include "timer.h"
+#include "params.h"
// Define the DPU Binary path as DPU_BINARY here
#ifndef DPU_BINARY
@@ -25,15 +39,13 @@
#define XSTR(x) STR(x)
#define STR(x) #x
-#if ENERGY
-#include <dpu_probe.h>
-#endif
-
// Pointer declaration
static T* A;
static T* C;
static T* C2;
+unsigned int kernel;
+
// Create input arrays
static void read_input(T* A, unsigned int nr_elements, unsigned int nr_elements_round) {
srand(0);
@@ -95,9 +107,9 @@ int main(int argc, char **argv) {
(input_size_dpu_ % (NR_TASKLETS * REGS) != 0) ? roundup(input_size_dpu_, (NR_TASKLETS * REGS)) : input_size_dpu_; // Input size per DPU (max.), 8-byte aligned
// Input/output allocation
- A = malloc(input_size_dpu_round * nr_of_dpus * sizeof(T));
- C = malloc(input_size_dpu_round * nr_of_dpus * sizeof(T));
- C2 = malloc(input_size_dpu_round * nr_of_dpus * sizeof(T));
+ A = (T*) malloc(input_size_dpu_round * nr_of_dpus * sizeof(T));
+ C = (T*) malloc(input_size_dpu_round * nr_of_dpus * sizeof(T));
+ C2 = (T*) malloc(input_size_dpu_round * nr_of_dpus * sizeof(T));
T *bufferA = A;
T *bufferC = C2;
@@ -124,8 +136,8 @@ int main(int argc, char **argv) {
start(&timer, 1, 0);
// Input arguments
const unsigned int input_size_dpu = input_size_dpu_round;
- unsigned int kernel = 0;
- dpu_arguments_t input_arguments = {input_size_dpu * sizeof(T), kernel, 0};
+ kernel = 0;
+ dpu_arguments_t input_arguments = {(uint32_t)(input_size_dpu * sizeof(T)), (enum kernels)kernel, 0};
// Copy input arrays
i = 0;
DPU_FOREACH(dpu_set, dpu, i) {
@@ -170,7 +182,7 @@ int main(int argc, char **argv) {
//printf("Retrieve results\n");
dpu_results_t results[nr_of_dpus];
- T* results_scan = malloc(nr_of_dpus * sizeof(T));
+ T* results_scan = (T*) malloc(nr_of_dpus * sizeof(T));
i = 0;
accum = 0;
@@ -207,7 +219,7 @@ int main(int argc, char **argv) {
dpu_arguments_t input_arguments_2[NR_DPUS];
for(i=0; i<nr_of_dpus; i++) {
input_arguments_2[i].size=input_size_dpu * sizeof(T);
- input_arguments_2[i].kernel=kernel;
+ input_arguments_2[i].kernel=(enum kernels)kernel;
input_arguments_2[i].t_count=results_scan[i];
}
DPU_FOREACH(dpu_set, dpu, i) {
@@ -272,17 +284,16 @@ int main(int argc, char **argv) {
}
if (status) {
printf("[" ANSI_COLOR_GREEN "OK" ANSI_COLOR_RESET "] Outputs are equal\n");
- printf("[::] SCAN-SSA 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",
+ dfatool_printf("[::] SCAN-SSA 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",
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[3] + 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",
+ dfatool_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[3] + 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");
}
diff --git a/SCAN-SSA/host/omp.c b/SCAN-SSA/host/omp.c
index efa5360..3e722dc 100644
--- a/SCAN-SSA/host/omp.c
+++ b/SCAN-SSA/host/omp.c
@@ -12,9 +12,9 @@
#include <getopt.h>
#include <assert.h>
-#include "../support/common.h"
-#include "../support/timer.h"
-#include "../support/params.h"
+#include "common.h"
+#include "timer.h"
+#include "params.h"
#define XSTR(x) STR(x)
#define STR(x) #x
diff --git a/SCAN-SSA/support/common.h b/SCAN-SSA/include/common.h
index 0bdf7ca..f395cc5 100644
--- a/SCAN-SSA/support/common.h
+++ b/SCAN-SSA/include/common.h
@@ -40,15 +40,17 @@
#define REGS (BLOCK_SIZE >> DIV)
+enum kernels {
+ kernel1 = 0,
+ kernel2 = 1,
+ nr_kernels = 2,
+};
+
// Structures used by both the host and the dpu to communicate information
typedef struct {
- uint32_t size;
- enum kernels {
- kernel1 = 0,
- kernel2 = 1,
- nr_kernels = 2,
- } kernel;
- T t_count;
+ uint32_t size;
+ enum kernels kernel;
+ T t_count;
} dpu_arguments_t;
typedef struct {
diff --git a/SCAN-SSA/include/dfatool_host.ah b/SCAN-SSA/include/dfatool_host.ah
new file mode 100644
index 0000000..6d2fad5
--- /dev/null
+++ b/SCAN-SSA/include/dfatool_host.ah
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <sys/time.h>
+#include "dfatool_host_dpu.ah"
+
+aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long n_elements;
+ unsigned int element_size;
+
+ virtual int getKernel() { return 1; }
+
+ DfatoolHostTiming() {
+ element_size = sizeof(T);
+ }
+
+ advice call("% input_params(...)") : after() {
+ Params* p = tjp->result();
+ n_elements = p->input_size;
+ printf("[>>] SCAN-RSS | n_dpus=%u n_elements=%lu\n", NR_DPUS, n_elements);
+ }
+
+ advice call("% scan_host(...)") : after() {
+ printf("[--] SCAN-RSS | n_dpus=%u n_elements=%lu\n", n_dpus, n_elements);
+ }
+
+ advice execution("% main(...)") : after() {
+ printf("[<<] SCAN-RSS | n_dpus=%u n_elements=%lu\n", NR_DPUS, n_elements);
+ }
+};
diff --git a/SCAN-SSA/support/params.h b/SCAN-SSA/include/params.h
index 9f6aacc..a96b33f 100644
--- a/SCAN-SSA/support/params.h
+++ b/SCAN-SSA/include/params.h
@@ -18,7 +18,7 @@ static void usage() {
"\n -h help"
"\n -w <W> # of untimed warmup iterations (default=1)"
"\n -e <E> # of timed repetition iterations (default=3)"
- "\n -x <X> Weak (0) or strong (1) scaling (default=0)"
+ "\n -x <X> Weak (0) or strong (1) scaling (default=1)"
"\n"
"\nBenchmark-specific options:"
"\n -i <I> input size (default=3932160 elements)"
@@ -30,7 +30,7 @@ struct Params input_params(int argc, char **argv) {
p.input_size = 3932160;
p.n_warmup = 1;
p.n_reps = 3;
- p.exp = 0;
+ p.exp = 1;
int opt;
while((opt = getopt(argc, argv, "hi:w:e:x:")) >= 0) {
diff --git a/SCAN-SSA/include/timer.h b/SCAN-SSA/include/timer.h
new file mode 100644
index 0000000..5b8eba3
--- /dev/null
+++ b/SCAN-SSA/include/timer.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#define N_TIMERS 7
+#include "../../include/timer_base.h"
+#undef N_TIMERS
diff --git a/SCAN-SSA/run-omp.sh b/SCAN-SSA/run-omp.sh
deleted file mode 100755
index ccbb1bd..0000000
--- a/SCAN-SSA/run-omp.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# T: data type
-# -w: number of un-timed warmup iterations
-# -e: number of timed iterations
-# -i: input size (number of elements, not number of bytes!)
-
-echo "prim-benchmarks SCAN-SSA (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; do
- for dt in UINT32 UINT64 INT32 INT64 FLOAT DOUBLE; do
- echo
- if make -B TYPE=${dt} bin/omp_code; then
- OMP_NUM_THREADS=$nr_threads timeout -k 1m 30m bin/omp_code -w 0 -e 100 -i ${i} || true
- fi
- done
- done
-done
diff --git a/SCAN-SSA/run.sh b/SCAN-SSA/run.sh
deleted file mode 100755
index 54d5f93..0000000
--- a/SCAN-SSA/run.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module
-# T: data type
-# -w: number of un-timed warmup iterations
-# -e: number of timed iterations
-# -i: input size (number of elements, not number of bytes!)
-
-echo "prim-benchmarks SCAN-SSA (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-for nr_dpus in 1 2 4 8 16 32 64 128 256 512; do
- for nr_tasklets in 1 2 3 4 6 8 10 12 16 20 24; do
- for i in 2048 4096 8192 16384 65536 262144 1048576 3932160; do
- for dt in UINT32 UINT64 INT32 INT64 FLOAT DOUBLE; do
- echo
- if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 TYPE=${dt} UNROLL=1 \
- || make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 TYPE=${dt} UNROLL=0; then
- timeout -k 1m 30m bin/host_code -w 0 -e 100 -i ${i} || true
- fi
- done
- done
- done
-done
diff --git a/SCAN-SSA/support/timer.h b/SCAN-SSA/support/timer.h
deleted file mode 100644
index 5411254..0000000
--- a/SCAN-SSA/support/timer.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2016 University of Cordoba and University of Illinois
- * All rights reserved.
- *
- * Developed by: IMPACT Research Group
- * University of Cordoba and University of Illinois
- * http://impact.crhc.illinois.edu/
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * with the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * > Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimers.
- * > Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimers in the
- * documentation and/or other materials provided with the distribution.
- * > Neither the names of IMPACT Research Group, University of Cordoba,
- * University of Illinois nor the names of its contributors may be used
- * to endorse or promote products derived from this Software without
- * specific prior written permission.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH
- * THE SOFTWARE.
- *
- */
-
-#include <sys/time.h>
-
-typedef struct Timer{
-
- struct timeval startTime[7];
- struct timeval stopTime[7];
- double time[7];
-
-}Timer;
-
-void start(Timer *timer, int i, int rep) {
- if(rep == 0) {
- timer->time[i] = 0.0;
- }
- gettimeofday(&timer->startTime[i], NULL);
-}
-
-void stop(Timer *timer, int i) {
- gettimeofday(&timer->stopTime[i], NULL);
- timer->time[i] += (timer->stopTime[i].tv_sec - timer->startTime[i].tv_sec) * 1000000.0 +
- (timer->stopTime[i].tv_usec - timer->startTime[i].tv_usec);
-}
-
-void printall(Timer *timer, int maxt) {
- for (int i = 0; i <= maxt; i++) {
- printf(" timer%d_us=%f", i, timer->time[i]);
- }
- printf("\n");
-}
diff --git a/SpMV/Makefile b/SpMV/Makefile
index 0e7a70c..c2d9d50 100644
--- a/SpMV/Makefile
+++ b/SpMV/Makefile
@@ -1,21 +1,31 @@
NR_TASKLETS ?= 16
NR_DPUS ?= 1
-COMMON_INCLUDES := support
-HOST_SOURCES := $(wildcard host/*.c)
-DPU_SOURCES := $(wildcard dpu/*.c)
-CPU_BASE_SOURCES := $(wildcard baselines/cpu/*.c)
-GPU_BASE_SOURCES := $(wildcard baselines/gpu/*.cu)
-
-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}
+aspectc ?= 0
+aspectc_timing ?= 0
+dfatool_timing ?= 1
+
+HOST_CC := ${CC}
+
+COMMON_FLAGS := -Wall -Wextra -g -Iinclude
+HOST_FLAGS := ${COMMON_FLAGS} -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DASPECTC=${aspectc} -DDFATOOL_TIMING=${dfatool_timing}
DPU_FLAGS := ${COMMON_FLAGS} -O2 -DNR_TASKLETS=${NR_TASKLETS}
-CPU_BASE_FLAGS := -O3 -fopenmp
-GPU_BASE_FLAGS := -O3
+
+ifeq (${aspectc_timing}, 1)
+ ASPECTC_HOST_FLAGS += -ainclude/dfatool_host_dpu.ah -ainclude/dfatool_host.ah
+endif
+
+ASPECTC_HOST_FLAGS ?= -a0
+
+ifeq (${aspectc}, 1)
+ HOST_CC = ag++ -r repo.acp -v 0 ${ASPECTC_HOST_FLAGS} --c_compiler ${UPMEM_HOME}/bin/clang++ -p . --Xcompiler
+else
+ HOST_FLAGS += -std=c11
+endif
QUIET = @
-ifdef verbose
+ifeq (${verbose}, 1)
QUIET =
endif
@@ -24,19 +34,13 @@ all: bin/host_code bin/dpu_code
bin:
${QUIET}mkdir -p bin
-gpu: bin/gpu_baseline
-
-bin/host_code: ${HOST_SOURCES} ${COMMON_INCLUDES} bin
- ${QUIET}${CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
-
-bin/dpu_code: ${DPU_SOURCES} ${COMMON_INCLUDES} bin
- ${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES}
-
-bin/cpu_baseline: ${CPU_BASE_SOURCES}
- ${QUIET}${CC} -o $@ ${CPU_BASE_SOURCES} ${CPU_BASE_FLAGS}
+bin/host_code: host/app.c include bin
+ ${QUIET}cp ../include/dfatool_host_dpu.ah include
+ ${QUIET}${HOST_CC} -o $@ host/app.c ${HOST_FLAGS}
+ ${QUIET}rm -f include/dfatool_host_dpu.ah
-bin/gpu_baseline: ${GPU_BASE_SOURCES}
- ${QUIET}nvcc -o $@ ${GPU_BASE_SOURCES} ${GPU_BASE_FLAGS}
+bin/dpu_code: dpu/task.c include bin
+ ${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ dpu/task.c
clean:
${QUIET}rm -rf bin
diff --git a/SpMV/benchmark-scripts/ccmcc25-sim.sh b/SpMV/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..9d1af4e
--- /dev/null
+++ b/SpMV/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -v 0 -f data/${data} 2>&1
+}
+
+export -f run_benchmark_nmc
+
+cd data/generate
+for i in 4 8 16; do
+ ./replicate ../bcsstk30.mtx $i ../bcsstk30.${i}.mtx
+done
+cd ../..
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks SpMV $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 data={data} \
+ ::: data bcsstk30.mtx bcsstk30.4.mtx bcsstk30.8.mtx bcsstk30.16.mtx \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+>> ${fn}.txt
+
+rm -f data/bcsstk30.*.mtx
diff --git a/SpMV/benchmark-scripts/ccmcc25.sh b/SpMV/benchmark-scripts/ccmcc25.sh
new file mode 100755
index 0000000..176ea99
--- /dev/null
+++ b/SpMV/benchmark-scripts/ccmcc25.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ sudo limit_ranks_to_numa_node ${numa_rank}
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -v 0 -f data/${data} 2>&1
+}
+
+export -f run_benchmark_nmc
+
+cd data/generate
+for i in 8 32 64; do
+ ./replicate ../bcsstk30.mtx $i ../bcsstk30.${i}.mtx
+done
+cd ../..
+
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks SpMV $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 data={data} numa_rank={numa_rank} \
+ ::: i $(seq 0 10) \
+ ::: data bcsstk30.mtx bcsstk30.8.mtx bcsstk30.32.mtx bcsstk30.64.mtx \
+ ::: numa_rank any \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ >> ${fn}.txt
+
+done
+
+rm -f data/bcsstk30.*.mtx
diff --git a/SpMV/dpu/task.c b/SpMV/dpu/task.c
index 501a62a..305a645 100644
--- a/SpMV/dpu/task.c
+++ b/SpMV/dpu/task.c
@@ -11,7 +11,7 @@
#include <perfcounter.h>
#include <seqread.h>
-#include "../support/common.h"
+#include "common.h"
#define PRINT_ERROR(fmt, ...) printf("\033[0;31mERROR:\033[0m "fmt"\n", ##__VA_ARGS__)
diff --git a/SpMV/host/app.c b/SpMV/host/app.c
index ffccb70..6cf2861 100644
--- a/SpMV/host/app.c
+++ b/SpMV/host/app.c
@@ -3,9 +3,24 @@
* SpMV Host Application Source File
*
*/
+#if ASPECTC
+extern "C" {
+#endif
+
#include <dpu.h>
#include <dpu_log.h>
+#ifndef ENERGY
+#define ENERGY 0
+#endif
+#if ENERGY
+#include <dpu_probe.h>
+#endif
+
+#if ASPECTC
+}
+#endif
+
#include <assert.h>
#include <getopt.h>
#include <stdio.h>
@@ -14,24 +29,17 @@
#include <unistd.h>
#include "mram-management.h"
-#include "../support/common.h"
-#include "../support/matrix.h"
-#include "../support/params.h"
-#include "../support/timer.h"
-#include "../support/utils.h"
+#include "common.h"
+#include "matrix.h"
+#include "params.h"
+#include "timer.h"
+#include "utils.h"
#define DPU_BINARY "./bin/dpu_code"
#define XSTR(x) STR(x)
#define STR(x) #x
-#ifndef ENERGY
-#define ENERGY 0
-#endif
-#if ENERGY
-#include <dpu_probe.h>
-#endif
-
// Main of the Host Application
int main(int argc, char **argv)
{
@@ -78,10 +86,10 @@ int main(int argc, char **argv)
uint32_t *rowPtrs = csrMatrix.rowPtrs;
struct Nonzero *nonzeros = csrMatrix.nonzeros;
float *inVector =
- malloc(ROUND_UP_TO_MULTIPLE_OF_8(numCols * sizeof(float)));
+ (float*)malloc(ROUND_UP_TO_MULTIPLE_OF_8(numCols * sizeof(float)));
initVector(inVector, numCols);
float *outVector =
- malloc(ROUND_UP_TO_MULTIPLE_OF_8(numRows * sizeof(float)));
+ (float*)malloc(ROUND_UP_TO_MULTIPLE_OF_8(numRows * sizeof(float)));
// Partition data structure across DPUs
uint32_t numRowsPerDPU =
@@ -158,22 +166,25 @@ int main(int argc, char **argv)
PRINT_INFO(p.verbosity >= 2,
" Copying data to DPU");
startTimer(&timer);
- copyToDPU(dpu, (uint8_t *) dpuRowPtrs_h, dpuRowPtrs_m,
- (dpuNumRows + 1) * sizeof(uint32_t));
- copyToDPU(dpu, (uint8_t *) dpuNonzeros_h, dpuNonzeros_m,
- dpuNumNonzeros * sizeof(struct Nonzero));
- copyToDPU(dpu, (uint8_t *) inVector, dpuInVector_m,
- numCols * sizeof(float));
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuRowPtrs_m, (uint8_t *) dpuRowPtrs_h,
+ ROUND_UP_TO_MULTIPLE_OF_8((dpuNumRows + 1) * sizeof(uint32_t))));
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuNonzeros_m, (uint8_t *) dpuNonzeros_h,
+ ROUND_UP_TO_MULTIPLE_OF_8(dpuNumNonzeros * sizeof(struct Nonzero))));
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuInVector_m, (uint8_t *) inVector,
+ ROUND_UP_TO_MULTIPLE_OF_8(numCols * sizeof(float))));
stopTimer(&timer);
writeTime += getElapsedTime(timer);
-
}
// Send parameters to DPU
PRINT_INFO(p.verbosity >= 2,
" Copying parameters to DPU");
startTimer(&timer);
- copyToDPU(dpu, (uint8_t *) & dpuParams[dpuIdx], dpuParams_m,
- sizeof(struct DPUParams));
+ DPU_ASSERT(dpu_copy_to(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams_m, (uint8_t *) & dpuParams[dpuIdx],
+ ROUND_UP_TO_MULTIPLE_OF_8(sizeof(struct DPUParams))));
stopTimer(&timer);
writeTime += getElapsedTime(timer);
@@ -204,13 +215,15 @@ int main(int argc, char **argv)
PRINT_INFO(p.verbosity >= 1, "Copying back the result");
startTimer(&timer);
dpuIdx = 0;
+
DPU_FOREACH(dpu_set, dpu) {
unsigned int dpuNumRows = dpuParams[dpuIdx].dpuNumRows;
if (dpuNumRows > 0) {
uint32_t dpuStartRowIdx = dpuIdx * numRowsPerDPU;
- copyFromDPU(dpu, dpuParams[dpuIdx].dpuOutVector_m,
- (uint8_t *) (outVector + dpuStartRowIdx),
- dpuNumRows * sizeof(float));
+ DPU_ASSERT(dpu_copy_from(dpu, DPU_MRAM_HEAP_POINTER_NAME,
+ dpuParams[dpuIdx].dpuOutVector_m,
+ (uint8_t *) (outVector + dpuStartRowIdx),
+ ROUND_UP_TO_MULTIPLE_OF_8(dpuNumRows * sizeof(float))));
}
++dpuIdx;
}
@@ -220,7 +233,7 @@ int main(int argc, char **argv)
// Calculating result on CPU
PRINT_INFO(p.verbosity >= 1, "Calculating result on CPU");
- float *outVectorReference = malloc(numRows * sizeof(float));
+ float *outVectorReference = (float*)malloc(numRows * sizeof(float));
for (uint32_t rowIdx = 0; rowIdx < numRows; ++rowIdx) {
float sum = 0.0f;
for (uint32_t i = rowPtrs[rowIdx]; i < rowPtrs[rowIdx + 1]; ++i) {
@@ -254,22 +267,22 @@ int main(int argc, char **argv)
freeTime += getElapsedTime(timer);
if (status) {
- printf
+ dfatool_printf
("[::] SpMV UPMEM | n_dpus=%d n_ranks=%d n_tasklets=%d e_type=%s n_elements=%d ",
numDPUs, numRanks, NR_TASKLETS, "float",
csrMatrix.numNonzeros);
- printf
+ dfatool_printf
("| latency_alloc_us=%f latency_load_us=%f latency_write_us=%f latency_kernel_us=%f latency_read_us=%f latency_free_us=%f",
allocTime, loadTime, writeTime, dpuTime, readTime,
freeTime);
- printf
+ dfatool_printf
(" throughput_upmem_kernel_MBps=%f throughput_upmem_total_MBps=%f",
// coomatrix / csrmatrix use uint32_t indexes and float values, so all 32bit
csrMatrix.numNonzeros * sizeof(float) / (dpuTime * 1e6),
csrMatrix.numNonzeros * sizeof(float) /
((allocTime + loadTime + writeTime + dpuTime + readTime +
freeTime) * 1e6));
- printf
+ dfatool_printf
(" throughput_upmem_wxr_MBps=%f throughput_upmem_lwxr_MBps=%f throughput_upmem_alwxr_MBps=%f",
csrMatrix.numNonzeros * sizeof(float) /
((writeTime + dpuTime + readTime) * 1e6),
@@ -278,14 +291,14 @@ int main(int argc, char **argv)
csrMatrix.numNonzeros * sizeof(float) /
((allocTime + loadTime + writeTime + dpuTime +
readTime) * 1e6));
- printf
+ dfatool_printf
(" throughput_upmem_kernel_MOpps=%f throughput_upmem_total_MOpps=%f",
// coomatrix / csrmatrix use uint32_t indexes and float values, so all 32bit
csrMatrix.numNonzeros / (dpuTime * 1e6),
csrMatrix.numNonzeros /
((allocTime + loadTime + writeTime + dpuTime + readTime +
freeTime) * 1e6));
- printf
+ dfatool_printf
(" throughput_upmem_wxr_MOpps=%f throughput_upmem_lwxr_MOpps=%f throughput_upmem_alwxr_MOpps=%f\n",
csrMatrix.numNonzeros / ((writeTime + dpuTime + readTime) *
1e6),
diff --git a/SpMV/host/mram-management.h b/SpMV/host/mram-management.h
index f2ee031..a953d6a 100644
--- a/SpMV/host/mram-management.h
+++ b/SpMV/host/mram-management.h
@@ -1,9 +1,7 @@
+#pragma once
-#ifndef _MRAM_MANAGEMENT_H_
-#define _MRAM_MANAGEMENT_H_
-
-#include "../support/common.h"
-#include "../support/utils.h"
+#include "common.h"
+#include "utils.h"
#define DPU_CAPACITY (64 << 20) // A DPU's capacity is 64 MiB
@@ -29,21 +27,3 @@ static uint32_t mram_heap_alloc(struct mram_heap_allocator_t *allocator,
}
return ret;
}
-
-static void copyToDPU(struct dpu_set_t dpu, uint8_t *hostPtr, uint32_t mramIdx,
- uint32_t size)
-{
- DPU_ASSERT(dpu_copy_to
- (dpu, DPU_MRAM_HEAP_POINTER_NAME, mramIdx, hostPtr,
- ROUND_UP_TO_MULTIPLE_OF_8(size)));
-}
-
-static void copyFromDPU(struct dpu_set_t dpu, uint32_t mramIdx,
- uint8_t *hostPtr, uint32_t size)
-{
- DPU_ASSERT(dpu_copy_from
- (dpu, DPU_MRAM_HEAP_POINTER_NAME, mramIdx, hostPtr,
- ROUND_UP_TO_MULTIPLE_OF_8(size)));
-}
-
-#endif
diff --git a/SpMV/support/common.h b/SpMV/include/common.h
index 6118814..6118814 100644
--- a/SpMV/support/common.h
+++ b/SpMV/include/common.h
diff --git a/SpMV/include/dfatool_host.ah b/SpMV/include/dfatool_host.ah
new file mode 100644
index 0000000..91d44bd
--- /dev/null
+++ b/SpMV/include/dfatool_host.ah
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <sys/time.h>
+#include "dfatool_host_dpu.ah"
+
+aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
+ unsigned long n_rows, n_cols, n_nonzero;
+ unsigned int element_size;
+
+ virtual int getKernel() { return 1; }
+
+ DfatoolHostTiming() {
+ element_size = sizeof(float);
+ }
+
+ advice call("% input_params(...)"): after() {
+ printf("[>>] SpMV | n_dpus=%u\n", NR_DPUS);
+ }
+
+ advice call("% readCOOMatrix(...)") : after() {
+ struct COOMatrix* c = tjp->result();
+ n_rows = c->numRows;
+ n_cols = c->numCols;
+ n_nonzero = c->numNonzeros;
+ printf("[--] SpMV | n_dpus=%u n_rows=%lu n_cols=%lu n_nonzero=%lu\n", NR_DPUS, n_rows, n_cols, n_nonzero);
+ }
+
+ advice execution("% main(...)") : after() {
+ printf("[<<] SpMV | n_dpus=%u n_rows=%lu n_cols=%lu n_nonzero=%lu\n", NR_DPUS, n_rows, n_cols, n_nonzero);
+ }
+};
diff --git a/SpMV/support/matrix.h b/SpMV/include/matrix.h
index ce8745e..ce8745e 100644
--- a/SpMV/support/matrix.h
+++ b/SpMV/include/matrix.h
diff --git a/SpMV/support/params.h b/SpMV/include/params.h
index bf60e79..bf60e79 100644
--- a/SpMV/support/params.h
+++ b/SpMV/include/params.h
diff --git a/SpMV/support/timer.h b/SpMV/include/timer.h
index 7367b11..cb513cb 100644
--- a/SpMV/support/timer.h
+++ b/SpMV/include/timer.h
@@ -1,10 +1,12 @@
-
-#ifndef _TIMER_H_
-#define _TIMER_H_
+#pragma once
#include <stdio.h>
#include <sys/time.h>
+#if DFATOOL_TIMING
+
+#define dfatool_printf(fmt, ...) do { printf(fmt, __VA_ARGS__); } while (0)
+
typedef struct Timer {
struct timeval startTime;
struct timeval endTime;
@@ -27,4 +29,26 @@ static double getElapsedTime(Timer timer)
timer.startTime.tv_usec) / 1.0e6));
}
+#else
+
+#define dfatool_printf(fmt, ...) do {} while (0)
+
+typedef int Timer;
+
+static void startTimer(Timer* timer)
+{
+ (void)timer;
+}
+
+static void stopTimer(Timer* timer)
+{
+ (void)timer;
+}
+
+static double getElapsedTime(Timer timer)
+{
+ (void)timer;
+ return 0.0;
+}
+
#endif
diff --git a/SpMV/support/utils.h b/SpMV/include/utils.h
index ccd8fbd..ccd8fbd 100644
--- a/SpMV/support/utils.h
+++ b/SpMV/include/utils.h
diff --git a/SpMV/run-paper-strong-full.sh b/SpMV/run-paper-strong-full.sh
deleted file mode 100755
index 09b7085..0000000
--- a/SpMV/run-paper-strong-full.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-set -e
-
-(
-
-echo "prim-benchmarks SpMV strong-full (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-cd data/generate
-./replicate ../bcsstk30.mtx 64 ../bcsstk30.mtx.64.mtx
-cd ../..
-
-# >2048 is not in upstream
-for nr_dpus in 2543 2304 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} verbose=1; then
- # repetition is not part of upstream setup
- for i in `seq 1 50`; do
- timeout --foreground -k 1m 3m bin/host_code -v 0 -f data/bcsstk30.mtx.64.mtx || true
- done
- fi
- done
-done
-) | tee log-paper-strong-full.txt
-
-rm -f data/bcsstk30.mtx.64.mtx
diff --git a/SpMV/run-paper-strong-rank.sh b/SpMV/run-paper-strong-rank.sh
deleted file mode 100755
index c73a6a0..0000000
--- a/SpMV/run-paper-strong-rank.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-set -e
-
-(
-
-echo "prim-benchmarks SpMV strong-rank (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-# >64 are not part of upstream
-for nr_dpus in 128 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} verbose=1; then
- # repetition is not part of upstream setup
- for i in `seq 1 50`; do
- timeout --foreground -k 1m 3m bin/host_code -v 0 || true
- done
- fi
- done
-done
-) | tee log-paper-strong-rank.txt
diff --git a/SpMV/run-paper-weak.sh b/SpMV/run-paper-weak.sh
deleted file mode 100755
index 74683cc..0000000
--- a/SpMV/run-paper-weak.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-set -e
-
-(
-
-echo "prim-benchmarks SpMV weak (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-for nr_dpus in 1 4 16 64; do
- cd data/generate
- make
- ./replicate ../bcsstk30.mtx ${nr_dpus} /tmp/bcsstk30.mtx.${nr_dpus}.mtx
- cd ../..
- for nr_tasklets in 1 2 4 8 16; do
- echo
- if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} verbose=1; then
- # repetition is not part of upstream setup
- for i in `seq 1 50`; do
- timeout --foreground -k 1m 3m bin/host_code -v 0 -f /tmp/bcsstk30.mtx.${nr_dpus}.mtx || true
- done
- fi
- done
- rm -f /tmp/bcsstk30.mtx.${nr_dpus}.mtx
-done |
-) tee log-paper-weak.txt
diff --git a/TRNS/benchmark-scripts/ccmcc25-sim.sh b/TRNS/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..a7aa79c
--- /dev/null
+++ b/TRNS/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+# Args: -m m -n n -o M_ -p N_
+#
+# Input: (M_ * m) × (N_ * n) matrix
+# Output: (N_* n) × (M_ * m) matrix
+# Step 1: transpose (M_ * m) × N_ matrix that consists of tiles of size n
+# CPU version: explicit
+# DPU version: implicit (M_ * m write operations of #DPUs * n elements to DPUs)
+# Step 2: transpose m × n matrix; this happens N_ * M_ times.
+# DPU version: Each tasklet transposes a single m × n matrix / tile.
+# (16 × 8 tile takes up 1 KiB WRAM)
+# Step 3: Transpose M_ × n matrix that consists of tiles of size m.
+#
+# Note for DPU version: if M_ > #DPUs, steps 1 through 3 are repeated.
+# Number of repetitions == ceil(M_ / #DPUS)
+# For Hetsim benchmarks, we set M_ == #DPUs to simplify the task graph (no repetitions that depend on the number of available DPUs).
+# Just in case, there is also a configuration with M_ == 2048 independent of #DPUs
+#
+# input size: uint64(DPU)/double(CPU) * M_ * m * N_ * n
+# output size: uint64(DPU)/double(CPU) * M_ * m * N_ * n -- on DPU only; CPU version operates in-place
+# Upstream DPU version uses int64_t, -p 2048 -o 12288 -x 1 [implicit -m 16 -n 8]
+# Upstream CPU version uses double, -p 2556 -o 4096 -m 16 -n 8 and fails with -o 12288 (allocation error)
+#
+# -p 2048 -o 2048 -m 16 -n 8 -> matrix size: 4 GiB
+# -p [64 .. 2304] -o 2048 -m 16 -n 8 -> matrix size: 128 MiB .. 4.5 GiB
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 2 -p ${cols} -o ${rows} -m ${tile_rows} -n ${tile_cols}
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks TRNS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 cols={cols} rows={rows} tile_cols={tile_cols} tile_rows={tile_rows} \
+ ::: nr_dpus 1 4 16 32 64 \
+ ::: rows 64 128 256 512 \
+ ::: cols 64 128 256 512 \
+ ::: tile_rows 16 \
+ ::: tile_cols 8 \
+>> ${fn}.txt
diff --git a/TRNS/benchmark-scripts/ccmcc25.sh b/TRNS/benchmark-scripts/ccmcc25.sh
index 751566b..7c66306 100755
--- a/TRNS/benchmark-scripts/ccmcc25.sh
+++ b/TRNS/benchmark-scripts/ccmcc25.sh
@@ -1,73 +1,32 @@
#!/bin/bash
-mkdir -p log/$(hostname) baselines/cpu/log/$(hostname)
-fn=log/$(hostname)/ccmcc25
-
-source /opt/upmem/upmem-2025.2.0-Linux-x86_64/upmem_env.sh
-
-# Args: -m m -n n -o M_ -p N_
-#
-# Input: (M_ * m) × (N_ * n) matrix
-# Output: (N_* n) × (M_ * m) matrix
-# Step 1: transpose (M_ * m) × N_ matrix that consists of tiles of size n
-# CPU version: explicit
-# DPU version: implicit (M_ * m write operations of #DPUs * n elements to DPUs)
-# Step 2: transpose m × n matrix; this happens N_ * M_ times.
-# DPU version: Each tasklet transposes a single m × n matrix / tile.
-# (16 × 8 tile takes up 1 KiB WRAM)
-# Step 3: Transpose M_ × n matrix that consists of tiles of size m.
-#
-# Note for DPU version: if M_ > #DPUs, steps 1 through 3 are repeated.
-# Number of repetitions == ceil(M_ / #DPUS)
-# For Hetsim benchmarks, we set M_ == #DPUs to simplify the task graph (no repetitions that depend on the number of available DPUs).
-# Just in case, there is also a configuration with M_ == 2048 independent of #DPUs
-#
-# input size: uint64(DPU)/double(CPU) * M_ * m * N_ * n
-# output size: uint64(DPU)/double(CPU) * M_ * m * N_ * n -- on DPU only; CPU version operates in-place
-# Upstream DPU version uses int64_t, -p 2048 -o 12288 -x 1 [implicit -m 16 -n 8]
-# Upstream CPU version uses double, -p 2556 -o 4096 -m 16 -n 8 and fails with -o 12288 (allocation error)
-#
-# -p 2048 -o 2048 -m 16 -n 8 -> matrix size: 4 GiB
-# -p [64 .. 2304] -o 2048 -m 16 -n 8 -> matrix size: 128 MiB .. 4.5 GiB
+mkdir -p log/$(hostname)
run_benchmark_nmc() {
local "$@"
set -e
sudo limit_ranks_to_numa_node ${numa_rank}
make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} dfatool_timing=0 aspectc=1 aspectc_timing=1
- bin/host_code -w 0 -e 40 -p ${p} -o 2048 -m 16 -n 8
+ bin/host_code -w 0 -e 4 -p ${cols} -o ${rows} -m ${tile_rows} -n ${tile_cols}
}
export -f run_benchmark_nmc
-(
-
-echo "NMC single-node operation (1/4)" >&2
-
-parallel -j1 --eta --joblog ${fn}.1.joblog --resume --header : \
- run_benchmark_nmc p={nr_dpus} nr_dpus={nr_dpus} nr_tasklets=16 numa_rank={numa_rank} \
- ::: numa_rank 0 1 \
- ::: nr_dpus 64 128 256 512 768 1024
-
-echo "NMC multi-node operation (2/4)" >&2
-
-parallel -j1 --eta --joblog ${fn}.2.joblog --resume --header : \
- run_benchmark_nmc p={nr_dpus} nr_dpus={nr_dpus} nr_tasklets=16 numa_rank={numa_rank} \
- ::: numa_rank any \
- ::: nr_dpus 1536 2048 2304
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
-echo "NMC single-node operation (3/4)" >&2
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
-parallel -j1 --eta --joblog ${fn}.3.joblog --resume --header : \
- run_benchmark_nmc p=2048 nr_dpus={nr_dpus} nr_tasklets=16 numa_rank={numa_rank} \
- ::: numa_rank 0 1 \
- ::: nr_dpus 64 128 256 512 768 1024
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
-echo "NMC multi-node operation (4/4)" >&2
+ echo "prim-benchmarks TRNS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
-parallel -j1 --eta --joblog ${fn}.4.joblog --resume --header : \
- run_benchmark_nmc p=2048 nr_dpus={nr_dpus} nr_tasklets=16 numa_rank={numa_rank} \
- ::: numa_rank any \
- ::: nr_dpus 1536 2048 2304
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 numa_rank=any cols={cols} rows={rows} tile_cols={tile_cols} tile_rows={tile_rows} \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: rows 1024 2048 4096 \
+ ::: cols 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: tile_rows 16 \
+ ::: tile_cols 8 \
+ >> ${fn}.txt
-) >> ${fn}.txt
+done
diff --git a/TRNS/include/dfatool_host.ah b/TRNS/include/dfatool_host.ah
index d9065d8..72978cc 100644
--- a/TRNS/include/dfatool_host.ah
+++ b/TRNS/include/dfatool_host.ah
@@ -5,7 +5,7 @@
aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
- unsigned int n_rows_f1, n_rows_f2, n_cols_f1, n_cols_f2;
+ unsigned int n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile;
unsigned int element_size;
virtual int getKernel() { return kernel; }
@@ -19,18 +19,18 @@ aspect DfatoolHostTiming : public DfatoolHostDPUTiming {
/*
* 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);
+ n_rows_outer = p->M_;
+ n_rows_tile = p->m;
+ n_cols_outer = p->N_;
+ n_cols_tile = p->n;
+ printf("[>>] TRNS | n_dpus=%u n_rows_outer=%u n_rows_tile=%u n_cols_outer=%u n_cols_tile=%u\n", NR_DPUS, n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile);
}
advice call("% trns_host(...)") : after() {
- 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);
+ printf("[--] TRNS | n_dpus=%u n_rows_outer=%u n_rows_tile=%u n_cols_outer=%u n_cols_tile=%u\n", NR_DPUS, n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile);
}
advice execution("% main(...)") : after() {
- 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);
+ printf("[<<] TRNS | n_dpus=%u n_rows_outer=%u n_rows_tile=%u n_cols_outer=%u n_cols_tile=%u\n", NR_DPUS, n_rows_outer, n_rows_tile, n_cols_outer, n_cols_tile);
}
};
diff --git a/TS/Makefile b/TS/Makefile
index 8eedaf9..2fce611 100644
--- a/TS/Makefile
+++ b/TS/Makefile
@@ -12,6 +12,8 @@ aspectc ?= 0
aspectc_timing ?= 0
dfatool_timing ?= 1
+HOST_CC := ${CC}
+
COMMON_FLAGS := -Wall -Wextra -g -Iinclude -DBL=${BL}
HOST_FLAGS := ${COMMON_FLAGS} -O3 `dpu-pkg-config --cflags --libs dpu` -DNR_TASKLETS=${NR_TASKLETS} -DNR_DPUS=${NR_DPUS} -DWITH_ALLOC_OVERHEAD=${WITH_ALLOC_OVERHEAD} -DWITH_LOAD_OVERHEAD=${WITH_LOAD_OVERHEAD} -DWITH_FREE_OVERHEAD=${WITH_FREE_OVERHEAD} -DDFATOOL_TIMING=${dfatool_timing} -DASPECTC=${aspectc} -lm
DPU_FLAGS := ${COMMON_FLAGS} -O2 -DNR_TASKLETS=${NR_TASKLETS}
diff --git a/TS/benchmark-scripts/ccmcc25-sim.sh b/TS/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..0df03d9
--- /dev/null
+++ b/TS/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=8 \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/ts_host -w 0 -e 5 -n ${ts_size} 2>&1
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks TS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=8 ts_size={ts_size} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: ts_size 2048 4096 8192 16384 32768 \
+>> ${fn}.txt
diff --git a/TS/benchmark-scripts/ccmcc25.sh b/TS/benchmark-scripts/ccmcc25.sh
index c7f93c3..74c8371 100755
--- a/TS/benchmark-scripts/ccmcc25.sh
+++ b/TS/benchmark-scripts/ccmcc25.sh
@@ -1,9 +1,6 @@
#!/bin/bash
mkdir -p log/$(hostname)
-fn=log/$(hostname)/ccmcc25
-
-source /opt/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh
run_benchmark_nmc() {
local "$@"
@@ -16,10 +13,18 @@ run_benchmark_nmc() {
export -f run_benchmark_nmc
-echo "prim-benchmarks TS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks TS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=8 numa_rank=any ts_size={ts_size} \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: ts_size 8388608 16777216 33554432 67108864 \
+ >> ${fn}.txt
-parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
- run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=8 numa_rank=any ts_size={ts_size} \
- ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
- ::: ts_size 8388608 16777216 33554432 67108864 \
->> ${fn}.txt
+done
diff --git a/TS/host/app.c b/TS/host/app.c
index a75cfe9..bfa14df 100644
--- a/TS/host/app.c
+++ b/TS/host/app.c
@@ -224,6 +224,15 @@ int main(int argc, char **argv)
for (int rep = 0; rep < p.n_warmup + p.n_reps; rep++) {
+ if (rep >= p.n_warmup) {
+ start(&timer, 6, 0);
+ }
+ streamp(tSeries, AMean, ASigma, ts_size - query_length - 1,
+ query, query_length, query_mean, query_std);
+ if (rep >= p.n_warmup) {
+ stop(&timer, 6);
+ }
+
#if WITH_ALLOC_OVERHEAD
if (rep >= p.n_warmup) {
start(&timer, 0, 0);
@@ -250,16 +259,10 @@ int main(int argc, char **argv)
start(&timer, 2, 0);
}
uint32_t i = 0;
-
- DPU_FOREACH(dpu_set, dpu) {
- input_arguments.exclusion_zone = 0;
-
- DPU_ASSERT(dpu_copy_to
- (dpu, "DPU_INPUT_ARGUMENTS", 0,
- (const void *)&input_arguments,
- sizeof(input_arguments)));
- i++;
+ DPU_FOREACH(dpu_set, dpu, i) {
+ DPU_ASSERT(dpu_prepare_xfer(dpu, &input_arguments));
}
+ DPU_ASSERT(dpu_push_xfer(dpu_set, DPU_XFER_TO_DPU, "DPU_INPUT_ARGUMENTS", 0, sizeof(input_arguments), DPU_XFER_DEFAULT));
i = 0;
mem_offset = 0;
@@ -402,15 +405,6 @@ int main(int argc, char **argv)
#endif
#endif
- if (rep >= p.n_warmup) {
- start(&timer, 6, 0);
- }
- streamp(tSeries, AMean, ASigma, ts_size - query_length - 1,
- query, query_length, query_mean, query_std);
- if (rep >= p.n_warmup) {
- stop(&timer, 6);
- }
-
int status = (minHost == result.minValue);
if (status) {
printf("[" ANSI_COLOR_GREEN "OK" ANSI_COLOR_RESET
diff --git a/TS/run-paper-strong-full.sh b/TS/run-paper-strong-full.sh
deleted file mode 100755
index 5b7656d..0000000
--- a/TS/run-paper-strong-full.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module
-# T: data type
-# -w: number of un-timed warmup iterations
-# -e: number of timed iterations
-# -i; ignored, always uses 262144 elements
-
-(
-
-echo "prim-benchmarks TS strong-full (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-# >2048 is not part of upstream
-# 12 tasklets are not part of upstream (code does not work with 16…)
-for nr_dpus in 2543 2304 256 512 1024 2048; do
- for nr_tasklets in 1 2 4 8 12 16; do
- echo
- # upstream code did not respect $BL in the makefile and used 256B (BL=8) instead.
- # This appears to be faster than BL=10.
- if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=8; then
- timeout --foreground -k 1m 30m bin/ts_host -w 0 -e 100 -n 33554432 || true
- fi
- done
-done
-) | tee log-paper-strong-full.txt
diff --git a/TS/run-paper-strong-rank.sh b/TS/run-paper-strong-rank.sh
deleted file mode 100755
index 58ad641..0000000
--- a/TS/run-paper-strong-rank.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module
-# T: data type
-# -w: number of un-timed warmup iterations
-# -e: number of timed iterations
-# -i; ignored, always uses 262144 elements
-
-(
-
-echo "prim-benchmarks TS strong-rank (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-# >64 are not part of upstream config space
-for nr_dpus in 128 1 4 16 64; do
- for nr_tasklets in 1 2 4 8 16; do
- echo
- # upstream code did not respect $BL in the makefile and used 256B (BL=8) instead.
- # BL=10 appears to be slightly faster.
- if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10; then
- timeout --foreground -k 1m 60m bin/ts_host -w 0 -e 50 -n 524288 || true
- fi
- done
-done
-) | tee log-paper-strong-rank.txt
diff --git a/TS/run-paper-weak.sh b/TS/run-paper-weak.sh
deleted file mode 100755
index 64892f4..0000000
--- a/TS/run-paper-weak.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# BL: use 2^(BL) B blocks for MRAM <-> WRAM transfers on PIM module
-# T: data type
-# -w: number of un-timed warmup iterations
-# -e: number of timed iterations
-# -i; ignored, always uses 262144 elements
-
-(
-
-echo "prim-benchmarks TS weak (dfatool edition)"
-echo "Started at $(date)"
-echo "Revision $(git describe --always)"
-
-# 256 and 512 are not part of upstream
-for nr_dpus in 1 4 16 64; do
- for nr_tasklets in 1 2 4 8 16; do
- echo
- # upstream code did not respect $BL in the makefile and used 256B (BL=8) instead.
- # BL=10 appears to be slightly faster.
- if make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=8; then
- i=$(( nr_dpus * 524288 ))
- timeout --foreground -k 1m 30m bin/ts_host -w 0 -e 100 -n $i || true
- fi
- done
-done
-) | tee log-paper-weak.txt
diff --git a/VA/Makefile b/VA/Makefile
index e0d392f..a67c600 100644
--- a/VA/Makefile
+++ b/VA/Makefile
@@ -35,7 +35,7 @@ endif
QUIET = @
-ifdef verbose
+ifeq (${verbose}, 1)
QUIET =
endif
@@ -45,12 +45,12 @@ bin:
${QUIET}mkdir -p bin
# cp/rm are needed to work around AspectC++ not liking symlinks
-bin/host_code: ${HOST_SOURCES} ${COMMON_INCLUDES} bin
+bin/host_code: ${HOST_SOURCES} include bin
${QUIET}cp ../include/dfatool_host_dpu.ah include
${QUIET}${HOST_CC} -o $@ ${HOST_SOURCES} ${HOST_FLAGS}
${QUIET}rm -f include/dfatool_host_dpu.ah
-bin/dpu_code: ${DPU_SOURCES} ${COMMON_INCLUDES} bin
+bin/dpu_code: ${DPU_SOURCES} include bin
${QUIET}dpu-upmem-dpurte-clang ${DPU_FLAGS} -o $@ ${DPU_SOURCES}
clean:
diff --git a/VA/baselines/cpu/Makefile b/VA/baselines/cpu/Makefile
index 04aacb6..279b0f3 100644
--- a/VA/baselines/cpu/Makefile
+++ b/VA/baselines/cpu/Makefile
@@ -5,7 +5,7 @@ nop_sync ?= 0
numa ?= 0
numa_memcpy ?= 0
-CFLAGS =
+CFLAGS = -DDFATOOL_TIMING=1
LDFLAGS =
ifeq (${debug}, 1)
diff --git a/VA/baselines/cpu/app_baseline.c b/VA/baselines/cpu/app_baseline.c
index 7975200..fe5125d 100644
--- a/VA/baselines/cpu/app_baseline.c
+++ b/VA/baselines/cpu/app_baseline.c
@@ -15,7 +15,7 @@
#include <omp.h>
#if WITH_BENCHMARK
-#include "../../support/timer.h"
+#include "../../include/timer.h"
#else
#define start(...)
#define stop(...)
@@ -109,7 +109,7 @@ struct Params input_params(int argc, char **argv)
p.n_warmup = 1;
p.n_reps = 3;
p.exp = 1;
- p.n_threads = 5;
+ p.n_threads = 8;
#if NUMA
p.bitmask_in = NULL;
p.bitmask_out = NULL;
@@ -213,9 +213,11 @@ int main(int argc, char **argv)
C = (T *) malloc(input_size * sizeof(T));
#endif
+ omp_set_num_threads(p.n_threads);
+ #pragma omp parallel for
for (unsigned long i = 0; i < input_size; i++) {
- A[i] = (T) (rand());
- B[i] = (T) (rand());
+ A[i] = (T) i % (1<<31) + 5;
+ B[i] = (T) i % (1<<31) + 6;
}
#if NUMA
diff --git a/VA/benchmark-scripts/ccmcc25-sim.sh b/VA/benchmark-scripts/ccmcc25-sim.sh
new file mode 100755
index 0000000..386cf90
--- /dev/null
+++ b/VA/benchmark-scripts/ccmcc25-sim.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+mkdir -p log/$(hostname)
+
+run_benchmark_nmc() {
+ local "$@"
+ set -e
+ make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
+ bin/host_code -w 0 -e 5 -i ${input_size}
+}
+
+export -f run_benchmark_nmc
+
+fn=log/$(hostname)/ccmcc25-sim
+
+source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator
+
+echo "prim-benchmarks VA $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} \
+ ::: nr_dpus 1 2 4 8 16 32 48 64 \
+ ::: input_size 327680 655360 1310720 2621440 \
+>> ${fn}.txt
diff --git a/VA/benchmark-scripts/ccmcc25.sh b/VA/benchmark-scripts/ccmcc25.sh
index ac0e066..f6d441d 100755
--- a/VA/benchmark-scripts/ccmcc25.sh
+++ b/VA/benchmark-scripts/ccmcc25.sh
@@ -1,24 +1,31 @@
#!/bin/bash
mkdir -p log/$(hostname)
-fn=log/$(hostname)/ccmcc25
-
-source /opt/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh
run_benchmark_nmc() {
local "$@"
set -e
sudo limit_ranks_to_numa_node ${numa_rank}
make -B NR_DPUS=${nr_dpus} NR_TASKLETS=${nr_tasklets} BL=10 \
- dfatool_timing=0 aspectc=1 aspectc_timing=1
+ aspectc=1 aspectc_timing=1 dfatool_timing=0
bin/host_code -w 0 -e 50 -i ${input_size}
}
export -f run_benchmark_nmc
-parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
- run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} numa_rank={numa_rank} \
- ::: numa_rank any \
- ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
- ::: input_size 83886080 167772160 335544320 671088640 \
->> ${fn}.txt
+for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do
+
+ fn=log/$(hostname)/ccmcc25-sdk${sdk}
+
+ source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh
+
+ echo "prim-benchmarks VA $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt
+
+ parallel -j1 --eta --joblog ${fn}.joblog --resume --header : \
+ run_benchmark_nmc nr_dpus={nr_dpus} nr_tasklets=16 input_size={input_size} numa_rank={numa_rank} \
+ ::: numa_rank any \
+ ::: nr_dpus 64 128 256 512 768 1024 1536 2048 2304 \
+ ::: input_size 83886080 167772160 335544320 671088640 \
+ >> ${fn}.txt
+
+done