-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench_extra.sh
More file actions
executable file
·41 lines (38 loc) · 2.13 KB
/
bench_extra.sh
File metadata and controls
executable file
·41 lines (38 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
# Bench V0 (baseline) + V6 (production) on the 5 newly-pulled matrices and
# verify every result against a CPU brute-force probe (--probe 32).
set -euo pipefail
ROOT="$(cd "$(dirname "$0")"/.. && pwd)"
BIN="$ROOT/build/sbfft"
mkdir -p "$ROOT/results"
OUT="$ROOT/results/bench_extra.csv"
echo "matrix,N,nnz,version,h2d_ms,plan_ms,step1_ms,step2_ms,other_ms,total_ms,peak,sum_sq,max_mag,parseval_rel,probe_max_abs,probe_max_rel" > "$OUT"
for m in bcsstk13 bcsstk16 nasa2910 nos5 s3rmt3m3; do
f="$ROOT/data/$m.mtx"
[ -f "$f" ] || { echo "missing $f"; continue; }
for ver in v0 v6; do
echo "[run] $m / $ver"
out=$("$BIN" --input "$f" --version "$ver" --probe 32 --probe-seed 42 2>&1) || {
echo "[fail] $m / $ver"; continue;
}
N=$(echo "$out" | awk -F'[=,]' '/^\[mtx\] N=/{gsub(" ","",$2); print $2; exit}')
nnz=$(echo "$out" | awk -F'[=,]' '/^\[mtx\] N=/{gsub(" ","",$4); print $4; exit}')
h2d=$(echo "$out" | awk '/H2D input/ {print $4}')
plan=$(echo "$out" | awk '/cuFFT plan/ {print $4}')
s1=$(echo "$out" | awk '/step1 \(row\)/ {print $4}')
s2=$(echo "$out" | awk '/step2 \(col\)/ {print $4}')
oth=$(echo "$out" | awk '/^ other/ {print $3}')
tot=$(echo "$out" | awk '/TOTAL wall/ {print $4}')
peak=$(echo "$out" | awk '/peak device/ {gsub(",",""); print $4 $5}')
sumsq=$(echo "$out" | awk -F': ' '/SIGMA\|Y\|/ {print $2}')
mx=$(echo "$out" | awk -F': ' '/max \|Y\|/{print $2}')
pe=$(echo "$out" | awk -F': ' '/Parseval err/{print $2}' | awk '{print $1}')
# probe lines are: " max abs err = X max rel err = Y worst probe @ (.,.)"
# Layout: " max abs err = X max rel err = Y worst probe @ (...)"
pmaxabs=$(echo "$out" | awk '/max abs err/ {for(i=1;i<=NF;i++) if($i=="abs") {print $(i+3); break}}')
pmaxrel=$(echo "$out" | awk '/max abs err/ {for(i=1;i<=NF;i++) if($i=="rel") {print $(i+3); break}}')
echo "$m,$N,$nnz,$ver,$h2d,$plan,$s1,$s2,$oth,$tot,$peak,$sumsq,$mx,$pe,$pmaxabs,$pmaxrel" >> "$OUT"
done
done
echo
column -t -s, "$OUT"