-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun_sample.sh
executable file
·43 lines (33 loc) · 1.41 KB
/
run_sample.sh
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
42
43
# Copyright 2023. All Rights Reserved.
# Author: Bruce-Lee-LY
# Date: 20:42:28 on Sun, Feb 12, 2023
#
# Description: run sample script
#!/bin/bash
set -euo pipefail
WORK_PATH=$(cd $(dirname $0) && pwd) && cd $WORK_PATH
rm -rf log ncu && mkdir -p log ncu
# $1: N, $2: K
evaluate_hgemv() {
echo "Evaluating $1 * $2"
$WORK_PATH/output/bin/hgemv -N=$1 -K=$2 -warmup_iterations=1 -profiling_iterations=10 -sleep_duration=100 -enable_check=false > log/hgemv_${1}_${2}.log 2>&1
sleep 3
}
# $1: N, $2: K
ncu_hgemv() {
echo "NCU $1 * $2"
sudo ncu --set full --target-processes all --force-overwrite -o ncu/hgemv_${1}_${2} $WORK_PATH/output/bin/hgemv -N=$1 -K=$2 -warmup_iterations=1 -profiling_iterations=1 -sleep_duration=100 -enable_check=false > log/ncu_hgemv_${1}_${2}.log 2>&1
sleep 3
}
benchmark_hgemv() {
N_dims=(1 2 4 8 16 32 64 128 256 512 768 1024 1536 2048 3072 4096)
K=128
for N in ${N_dims[@]};
do
evaluate_hgemv $N $K
# ncu_hgemv $N $K
done
}
nohup $WORK_PATH/output/bin/hgemv -N=256 -K=128 -warmup_iterations=1 -profiling_iterations=10 -sleep_duration=100 -enable_check=true > log/hgemv_256_128.log 2>&1 &
# sudo ncu --set full --target-processes all --force-overwrite -o ncu/hgemv_256_128 $WORK_PATH/output/bin/hgemv -N=256 -K=128 -warmup_iterations=1 -profiling_iterations=1 -sleep_duration=100 -enable_check=false > log/ncu_hgemv_256_128.log 2>&1
# benchmark_hgemv