-
Notifications
You must be signed in to change notification settings - Fork 0
/
SEER_data_collect_cudnn.sh
54 lines (46 loc) · 2.17 KB
/
SEER_data_collect_cudnn.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
44
45
46
47
48
49
50
51
52
53
54
src_data_set_path=data/src/
tmp_results_path=data/tmp_results/
profile_result_path=data/profiled/
log_file=data_collect_log
exe_file=./cuDNN/collect_with_algo
repeat_times=5
# Generate runnable kernel configurations
for algo in "algo0" "algo1" "algo2" "algo4" "algo5" "algo6" "algo7" "algo5-ctree"
do
python3 ./cuDNN/generate_ops.py $algo $src_data_set_path $exe_file 2>&1 | tee -a $log_file
done
# Collect Benchmark dataset & Test-set-I
for algo in "algo0" "algo1" "algo2" "algo6" "algo7"
do
for i in $(seq 0 $[${repeat_times}-1])
do
# collect execution time, repeated several times to calculate average time.
echo "======> collecting data for ${algo} ($[${i}+1]/${repeat_times}) ......"
nvprof --print-gpu-trace --log-file ${tmp_results_path}nvprof_trace_${algo}_${i} ./cuDNN/collect_with_algo ${src_data_set_path}prof-ops-${algo}.txt
done
# collect metrics, only profile once.
nvprof --print-gpu-trace --metrics inst_fp_32,dram_read_transactions,dram_write_transactions,single_precision_fu_utilization,dram_utilization --log-file ${tmp_results_path}nvprof_metrics_${algo} ./cuDNN/collect_with_algo ${src_data_set_path}prof-ops-${algo}.txt
done
for algo in "algo4" "algo5"
do
for i in $(seq 0 ${repeat_times})
do
echo "======> collecting data for ${algo} (${i}/${repeat_times}) ......"
./cuDNN/collect_with_algo ${src_data_set_path}prof-ops-${algo}.txt > ${tmp_results_path}time_results_${algo}_${i}
done
done
# ctree for Algo5
algo="algo5-ctree"
echo "======> collecting data for ${algo} ......"
nvprof --print-gpu-trace --metrics single_precision_fu_utilization,dram_utilization --log-file ${tmp_results_path}nvprof_metrics_${algo} ./cuDNN/collect_with_algo ${src_data_set_path}prof-ops-${algo}.txt
# # Test-set-II
# ./cuDNN/collect_without_algo ${src_data_set_path}Test-set-II.txt > ${tmp_results_path}Test-set-II
# Algo-pick-set
echo "======> collecting Algo-pick-set ......"
./cuDNN/collect_without_algo > ${tmp_results_path}Algo-pick-set
# data parsing
for algo in "algo0" "algo1" "algo2" "algo4" "algo5" "algo6" "algo7" "algo2-pre-kernel" "algo7-pre-kernel" "algo5-ctree" "Algo-pick-set"
do
echo "======> parsing data for ${algo} ....."
python3 parse_src_data.py ${algo} 2>&1 | tee -a $log_file
done