-
Notifications
You must be signed in to change notification settings - Fork 2
/
evalbenchmarks.jl
63 lines (56 loc) · 2.22 KB
/
evalbenchmarks.jl
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
using Plots, StatsPlots
using DataFramesMeta
using DataFrames
using CSV
#=
run julia-benchmarks
=#
include("parsebenchmarks.jl")
using PkgBenchmark
using OMEinsum
benchmarkpkg("OMEinsum", "master", resultfile = "benchmarkfiles/juliabenchmarkmaster.json")
# benchmarkpkg("OMEinsum", "benchmark-einsumjl", resultfile = "benchmarkfiles/juliabenchmarkeinsumjl.json")
# isnothing(x) = x === nothing
# df = parsejuliajson(emptydf, "benchmarkfiles/juliabenchmarkeinsumjl.json", label = "einsumjl")
# df = parsepybenchjson(df, "benchmarkfiles/benchnumpy.json",label="numpy")
# df = parsepybenchjson(df, "benchmarkfiles/benchtorch.json",label="torch")
# df = parsepybenchjson(df, "benchmarkfiles/benchtorchgpu.json",label="torch-gpu")
# df = parsejuliajson(df, "benchmarkfiles/juliabenchmarkmaster.json",label="master")
# df = parsejuliajson(df, "benchmarkfiles/julibenchmarkgpu.json",label="julia-gpu")
# CSV.write("benchmarkdf.csv", df)
df = CSV.read("benchmarkdf.csv")
@df @where(df, :label .∈ Ref(("numpy","torch","master","einsumjl","julia-gpu","torch-gpu")),
:ttype .== "Float32",
:mtype .== "small") scatter(
:op,
:tmedian,
ylims = (1, 10^13),
group = :label,
legend = :topleft,
xrotation=35, xtickfont = font(8),
yscale=:log10)
mtypes = ["small", "medium", "large"]
ttypes = ["Float64", "Float32", "Complex{Float64}", "Complex{Float32}"]
for mtype in mtypes
for ttype in ttypes
tmpdf = @where(df, :ttype .== ttype, :mtype .== mtype,
:label .∈ Ref(("master", "numpy","torch","einsumjl","julia-gpu"#=,"torch-gpu"=#)),
)
tmax = maximum(tmpdf.tmin)
p = @df tmpdf scatter(
:op, :tmin, group = :label, yscale=:log10,
legend = :top,
marker = :auto,
title = lowercase(ttype),
ylabel = "ns",
ylims = (1, tmax * 10^4),
yticks = 10 .^ (0:13),
xrotation=35, xtickfont = font(8))
savefig(p, "plots/$(lowercase(ttype))-$(lowercase(mtype)).png")
end
end
scoresdf = benchmarkscores(
@where(df, :label .∈ Ref(("einsumjl","master","numpy", "torch","julia-gpu","torch-gpu")),
:ttype .== "Float64"),
"numpy")
CSV.write("scores.csv",scoresdf)