aboutsummaryrefslogtreecommitdiff
path: root/deeptagger/bench-interpret.sh
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2024-01-18 18:16:18 +0100
committerPřemysl Eric Janouch <p@janouch.name>2024-01-18 18:31:10 +0100
commit77e988365d1c3a5ee67301c99c8992fbed7ce7bd (patch)
treefdae4f1c9f4bffa022802bf1c2ac55dbd1442136 /deeptagger/bench-interpret.sh
parent8df76dbaab2912e86059f8c7d8e4d2abf350a5d3 (diff)
downloadgallery-77e988365d1c3a5ee67301c99c8992fbed7ce7bd.tar.gz
gallery-77e988365d1c3a5ee67301c99c8992fbed7ce7bd.tar.xz
gallery-77e988365d1c3a5ee67301c99c8992fbed7ce7bd.zip
Add some benchmarks and information
Diffstat (limited to 'deeptagger/bench-interpret.sh')
-rwxr-xr-xdeeptagger/bench-interpret.sh51
1 files changed, 51 insertions, 0 deletions
diff --git a/deeptagger/bench-interpret.sh b/deeptagger/bench-interpret.sh
new file mode 100755
index 0000000..ffad9c9
--- /dev/null
+++ b/deeptagger/bench-interpret.sh
@@ -0,0 +1,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