aboutsummaryrefslogtreecommitdiff
path: root/deeptagger/bench-interpret.sh
blob: ffad9c93eaf4ba39afff0daa0d4222ca08887df3 (plain)
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
#!/bin/sh -e
parse() {
	awk 'BEGIN {
		OFS = FS = "\t"
	} {
		name = $1
		path = $2
		cpu = $3 != ""
		batch = $4
		time = $5

		if (path ~ "/batch-")
			name = name " (batch)"
		else if (name ~ /^WD / && batch > 1)
			next
	} {
		group = name FS cpu FS batch
		if (lastgroup != group) {
			if (lastgroup)
				print lastgroup, mintime

			lastgroup = group
			mintime = time
		} else {
			if (mintime > time)
				mintime = time
		}
	} END {
		print lastgroup, mintime
	}' "${BENCH_LOG:-bench.out}"
}

cat <<END
GPU inference
~~~~~~~~~~~~~
[cols="<,>,>", options=header]
|===
|Model|Batch size|Time
$(parse | awk -F'\t' 'BEGIN { OFS = "|" }
	!$2 { print "", $1, $3, $4 " s" }' | sort -t'|' -nk4)
|===

CPU inference
~~~~~~~~~~~~~
[cols="<,>,>", options=header]
|===
|Model|Batch size|Time
$(parse | awk -F'\t' 'BEGIN { OFS = "|" }
	$2 { print "", $1, $3, $4 " s" }' | sort -t'|' -nk4)
|===
END