diff options
46 files changed, 550 insertions, 564 deletions
diff --git a/BFS/benchmark-scripts/ccmcc25-sim.sh b/BFS/benchmark-scripts/ccmcc25-sim.sh index 25c04b3..bcbe284 100755 --- a/BFS/benchmark-scripts/ccmcc25-sim.sh +++ b/BFS/benchmark-scripts/ccmcc25-sim.sh @@ -23,5 +23,5 @@ 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 64 \ + ::: nr_dpus 1 2 4 8 16 32 48 64 \ >> ${fn}.txt diff --git a/BS/benchmark-scripts/ccmcc25-sim.sh b/BS/benchmark-scripts/ccmcc25-sim.sh index badda8c..05e7f87 100755 --- a/BS/benchmark-scripts/ccmcc25-sim.sh +++ b/BS/benchmark-scripts/ccmcc25-sim.sh @@ -13,7 +13,7 @@ run_benchmark_nmc() { export -f run_benchmark_nmc -fn=log/$(hostname)/ccmcc25-sdk${sdk}-sim +fn=log/$(hostname)/ccmcc25-sim source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator @@ -21,7 +21,7 @@ echo "prim-benchmarks BS $(git describe --all --long) $(git rev-parse HEAD) 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 64 \ - ::: nr_elements $((2**20)) $((2**21)) $((2**22)) \ + ::: 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/GEMV/benchmark-scripts/ccmcc25-sim.sh b/GEMV/benchmark-scripts/ccmcc25-sim.sh index 1b095e4..3f88fcf 100755 --- a/GEMV/benchmark-scripts/ccmcc25-sim.sh +++ b/GEMV/benchmark-scripts/ccmcc25-sim.sh @@ -5,7 +5,6 @@ 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/gemv_host -w 0 -e 5 -n ${nr_cols} -m ${nr_rows} 2>&1 @@ -13,19 +12,15 @@ run_benchmark_nmc() { 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}-sim - fn=log/$(hostname)/ccmcc25-sdk${sdk} +source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator - 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 - 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 - -done +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/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/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/RED/benchmark-scripts/ccmcc25.sh b/RED/benchmark-scripts/ccmcc25.sh index bbafe99..074933d 100755 --- a/RED/benchmark-scripts/ccmcc25.sh +++ b/RED/benchmark-scripts/ccmcc25.sh @@ -6,21 +6,25 @@ 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 \ + 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 +for sdk in 2023.2.0 2024.1.0 2024.2.0 2025.1.0; do -source ~/lib/local/upmem/upmem-2025.1.0-Linux-x86_64/upmem_env.sh simulator + fn=log/$(hostname)/ccmcc25-sdk${sdk} -echo "prim-benchmarks BS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt + source /opt/upmem/upmem-${sdk}-Linux-x86_64/upmem_env.sh -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 + 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/include/timer.h b/RED/include/timer.h index 5b8eba3..7b80823 100644 --- a/RED/include/timer.h +++ b/RED/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/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/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-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/benchmark-scripts/ccmcc25-sim.sh b/SpMV/benchmark-scripts/ccmcc25-sim.sh index dcf6f9f..9d1af4e 100755 --- a/SpMV/benchmark-scripts/ccmcc25-sim.sh +++ b/SpMV/benchmark-scripts/ccmcc25-sim.sh @@ -18,14 +18,12 @@ for i in 4 8 16; do 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 BFS $(git describe --all --long) $(git rev-parse HEAD) $(date -R)" >> ${fn}.txt +echo "prim-benchmarks SpMV $(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} \ ::: data bcsstk30.mtx bcsstk30.4.mtx bcsstk30.8.mtx bcsstk30.16.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/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 index 4e4828b..a7aa79c 100755 --- a/TRNS/benchmark-scripts/ccmcc25-sim.sh +++ b/TRNS/benchmark-scripts/ccmcc25-sim.sh @@ -32,7 +32,7 @@ run_benchmark_nmc() { 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 -p ${cols} -o ${rows} -m ${tile_rows} -n ${tile_cols} + bin/host_code -w 0 -e 2 -p ${cols} -o ${rows} -m ${tile_rows} -n ${tile_cols} } export -f run_benchmark_nmc @@ -44,7 +44,8 @@ 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 : \ - ::: nr_dpus 1 2 4 8 16 32 48 64 \ + 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 \ 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/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/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 |
