This repository has been archived by the owner on Dec 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_results.R
122 lines (111 loc) · 3.76 KB
/
plot_results.R
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
## This script provides graphics and tables for the bachelor thesis
library(tidyverse)
library(ggplot2)
library(reshape2)
library(kableExtra)
snps <- readRDS("snps_time.rds")
plot1 <- snps %>% melt() %>%
ggplot() +
theme_minimal() +
theme(legend.position=c(.85,.25), legend.text=element_text(size=10)) +
labs(#title=expression(paste(paste("Zeitmessung für die Berechnung von ", Z*Z^T), " bei 10000 Individuen")),
x ="Anzahl SNPs", y = "Zeit in Sekunden") +
geom_line(aes(x=Var1, y=value, col=Var2)) +
theme(legend.title=element_blank()) +
scale_y_continuous(labels=function(x) format(x, decimal.mark = ",", scientific = FALSE))
print(plot1)
ggsave(file="snps.pdf", width = 400/2, height = 230/2, units = "mm")
indivs <- readRDS("indivs_time.rds")
plot2 <- indivs %>% melt() %>%
ggplot() +
theme_minimal() +
theme(legend.position=c(.85,.25), legend.text=element_text(size=10)) +
labs(#title=expression(paste(paste("Zeitmessung für die Berechnung von ", Z*Z^T), " bei 10000 Individuen")),
x ="Anzahl Individuen", y = "Zeit in Sekunden") +
geom_line(aes(x=Var1, y=value, col=Var2)) +
theme(legend.title=element_blank()) +
scale_y_continuous(labels=function(x) format(x, decimal.mark = ",", scientific = FALSE))
print(plot2)
ggsave(file="indivs.pdf", width = 400/2, height = 230/2, units = "mm")
shapes <- c(
"64x64x512_32x32x512_75",
"64x128x512_32x64x512_75",
"128x64x512_64x32x512_75",
"64x256x512_64x64x512_75",
"256x64x512_64x64x512_75",
"128x128x512_64x64x512_75",
"128x256x512_64x64x512_75",
"256x128x512_64x64x512_75",
"64x128x1024_32x64x1024_80",
"128x64x1024_64x32x1024_80",
"64x64x1024_32x32x1024_80",
"64x64x512_32x32x512_80",
"64x128x512_32x64x512_80",
"128x64x512_64x32x512_80",
"64x256x512_64x64x512_80",
"256x64x512_64x64x512_80",
"128x128x512_64x64x512_80",
"128x256x512_64x64x512_80",
"256x128x512_64x64x512_80"
)
tile_time <- readRDS("tile_time.rds")[,,1] %>% round(digits = 3)
rownames(tile_time) <- shapes
tile_time[,1:ncol(tile_time)] %>%
kbl(
caption="Vergleich verschiedener Tilesizes und GEMM-shapes",
format="latex",
col.names = seq(512, by=256, to=2048),
align="r"
) %>%
kable_minimal(full_width = F)
shapes_old <- c(
"128x256x128_64x64x128",
"256x128x128_64x64x128",
"128x128x128_64x64x128",
"64x128x128_32x64x128",
"128x64x128_64x32x128",
"64x64x128_32x32x128"
)
tile_time_old <- readRDS("tile_time_old.rds")[,,1] %>% round(digits = 3)
rownames(tile_time_old) <- shapes_old
tile_time_old[,1:ncol(tile_time_old)] %>%
kbl(
caption="Vergleich verschiedener Tilesizes und GEMM-shapes",
format="latex",
col.names = seq(512, by=256, to=2048),
align="r"
) %>%
kable_minimal(full_width = F)
shapes_wmma <- c(
"64x64x512_32x32x512_75",
"64x128x512_32x64x512_75",
"128x64x512_64x32x512_75",
"64x256x512_64x64x512_75",
"256x64x512_64x64x512_75",
"128x128x512_64x64x512_75",
"128x256x512_64x64x512_75",
"256x128x512_64x64x512_75"
)
tile_time_wmma <- readRDS("tile_time_wmma.rds")[,,1] %>% round(digits = 3)
rownames(tile_time_wmma) <- shapes_wmma
tile_time_wmma[,1:ncol(tile_time_wmma)] %>%
kbl(
caption="Vergleich verschiedener Tilesizes und GEMM-shapes",
format="latex",
col.names = seq(512, by=256, to=2048),
align="r"
) %>%
kable_minimal(full_width = F)
my.min <- function(x) ifelse(!all(is.na(x)), min(x, na.rm=T), NA)
printf <- function(...) invisible(print(sprintf(...)))
# get best time
best <- which(tile_time == my.min(tile_time), arr.ind = TRUE)
print("Minimum MMA1Bit (mma)")
print(best)
best <- which(tile_time_wmma == my.min(tile_time_wmma), arr.ind = TRUE)
print("Minimum MMA1Bit (wmma)")
print(best)
best <- which(tile_time_old == my.min(tile_time_old), arr.ind = TRUE)
print("Minimum MMAGPU")
print(best)
# print(my.min(tile_time))