-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathspmv-system-comp.plot.jsonata
68 lines (64 loc) · 1.7 KB
/
spmv-system-comp.plot.jsonata
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
(
"Select the format:";
$format := "splib_coo";
$data_hip := content[dataset.system = "RadeonVII" and dataset.executor = "hip"]^(problem.id);
$data_cuda := content[dataset.system = "V100" and dataset.executor = "cuda"]^(problem.id);
$getColor := function ($num_colors, $id) {
"hsl(" & $floor(360 * $id / $num_colors) & ",40%,55%)"
};
$turn_format := function ($str, $lib) {
$replace($str, /sparselib|splib|cusp|hipsp/, $lib)
};
$format_hip := $turn_format($format, "hipsp");
$format_cuda := $turn_format($format, "cusp");
$data := $zip($data_hip, $data_cuda);
$plot_data := $map($data, function ($v) {
{
"x": $v[0].problem.nonzeros,
"y": ($v[0].problem.group = $v[1].problem.group and $v[0].problem.name = $v[1].problem.name) ? ($v[1].spmv~> $lookup($format_cuda)).time / ($v[0].spmv~> $lookup($format_hip)).time: null
}
});
{
"type": "scatter",
"data": {
"datasets": [
{
"label": "RadeonVII is faster",
"data": $plot_data[y >= 1],
"backgroundColor": "hsl(0,40%,55%)"
},
{
"label": "V100 is faster",
"data": $plot_data[y < 1],
"backgroundColor": "hsl(120,40%,55%)"
}
]
},
"options": {
"title": {
"display": true,
"text": $turn_format($format, "splib") & " : Speedup vs Nonzero Count"
},
"tooltips": {
"mode": "index",
"intersect": true
},
"scales": {
"xAxes": [{
"type": "logarithmic",
"scaleLabel": {
"display": true,
"labelString": "Nonzero Count"
}
}],
"yAxes": [{
"type": "logarithmic",
"scaleLabel": {
"display": true,
"labelString": "Speedup"
}
}]
}
}
}
)