summaryrefslogtreecommitdiff
path: root/TRNS
diff options
context:
space:
mode:
Diffstat (limited to 'TRNS')
-rwxr-xr-xTRNS/benchmark-scripts/ccmcc25-sim.sh53
-rwxr-xr-xTRNS/benchmark-scripts/ccmcc25.sh71
-rw-r--r--TRNS/include/dfatool_host.ah16
3 files changed, 76 insertions, 64 deletions
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);
}
};