-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelp_man_tune_select.py
More file actions
executable file
·69 lines (61 loc) · 1.84 KB
/
help_man_tune_select.py
File metadata and controls
executable file
·69 lines (61 loc) · 1.84 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
'''
help_man_tune.py
1. Input: man_tune_res.log, the log file from rocblas-bench
2. Do:
(1) get the min_time from all the rocblas-bench (cmd, time) pair
(2) compare from rocblas (cmd, time) to best time from hipblaslt
3. Output: tuned-8.csv the manual tuned result of problem ('N', 'N', 28672, 65536, 7168) in tuned.csv format for further combination use
'''
import csv
path = '74.log'
file1 = open(path, 'r')
Lines = file1.readlines()
visited = set()
cur_min = float('inf')
cnt = 0
find = 0
track = list()
for line in Lines:
if find == 1:
find = 0
tmp = line.strip()
tmp = tmp.split(',')
track.append(float(tmp[-1]))
cnt += 1
if float(tmp[-1]) < cur_min:
cur_min = float(tmp[-1])
cur_idx = cnt
if 'hipblaslt-Gflops' in line.strip():
find = 1
print(cnt, cur_min)
for tc in track:
print(tc)
'''
if './rocblas-bench' in line.strip():
tmp = line.strip()
tmp = tmp.split()
solidx = int(tmp[-3])
'''
'''
libtype = 'rocblas'
with open('tuned_hip_only.csv', newline='') as csvfile:
reader = csv.reader(csvfile, delimiter=',')
for i, row in enumerate(reader):
if i > 0 and cur_min > float(row[-2]):
cur_idx = int(row[-3])
cur_min = float(row[-2])
libtype = 'hipblaslt'
'''
'''
with open('tuned-8.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile, delimiter=',')
row = ['','TA','TB','M','N','K','libtype','solidx','soltimems','dtype']
writer.writerow(row)
if libtype != 'rocblas':
row = ['0', 'N', 'N', 28672, 65536, 7168, 'rocblas', cur_idx, cur_min, 'torch.float16']
else:
row = ['0', 'N', 'N', 28672, 65536, 7168, 'hipblaslt', cur_idx, cur_min, 'torch.float16']
writer.writerow(row)
print('res=', cur_idx, cur_min)
'''