Skip to content

Commit 7ff795b

Browse files
committed
Fix benchmark
1 parent 58243a8 commit 7ff795b

File tree

6 files changed

+16
-28
lines changed

6 files changed

+16
-28
lines changed

benchmark/benchmarks.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ seed!(rng, 19260817)
1010
using Logging
1111
Logging.disable_logging(Logging.Warn)
1212

13-
include("scalar.jl")
14-
include("mlp.jl")
15-
include("taylor_expansion.jl")
16-
include("pinn.jl")
13+
include("groups/scalar.jl")
14+
include("groups/mlp.jl")
15+
include("groups/taylor_expansion.jl")
16+
include("groups/pinn.jl")
1717

1818
scalar = create_benchmark_scalar_function(sin, 0.1)
1919
mlp = create_benchmark_mlp((2, 16), [2.0, 3.0], [1.0, 1.0])
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

benchmark/runbenchmarks.jl

+12-24
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,29 @@ import JSON: lower, json
88
using Dates
99
using HTTP: put
1010

11-
struct BenchmarkContext
12-
datetime::DateTime
13-
commit::String
14-
branch::String
15-
tag::String
16-
end
17-
1811
dict(x) = Dict(name => lower(getfield(x, name)) for name in fieldnames(typeof(x)))
19-
2012
lower(results::BenchmarkResults) = dict(results)
2113
function lower(group::BenchmarkGroup)
2214
Dict(:tags => group.tags,
23-
:data => Dict(key => lower(value) for (key, value) in group.data))
15+
:data => [Dict(lower(value)..., "name" => key) for (key, value) in group.data])
2416
end
2517
lower(trial::Trial) = lower(minimum(trial))
2618
lower(estimate::TrialEstimate) = dict(estimate)
2719
lower(parameters::Parameters) = dict(parameters)
28-
lower(context::BenchmarkContext) = dict(context)
2920

3021
getenv(name::String) = String(strip(ENV[name]))
3122

32-
context = if "BUILDKITE" in keys(ENV)
33-
BenchmarkContext(now(), # datetime
34-
getenv("BUILDKITE_COMMIT"), # commit
35-
getenv("BUILDKITE_BRANCH"), # branch
36-
getenv("BUILDKITE_TAG"))
23+
body = Dict("name" => "TaylorDiff.jl", "datetime" => now())
24+
if "BUILDKITE" in keys(ENV)
25+
body["commit"] = getenv("BUILDKITE_COMMIT")
26+
body["branch"] = getenv("BUILDKITE_BRANCH")
27+
body["tag"] = getenv("BUILDKITE_TAG")
3728
else
38-
BenchmarkContext(now(), "abcdef123456", "dummy", "dummy")
29+
body["commit"] = "abcdef123456"
30+
body["branch"] = "dummy"
3931
end
40-
display(context)
4132

42-
results = benchmarkpkg(TaylorDiff)
43-
(; benchmarkgroup, benchmarkconfig) = results
44-
reconstructed = Dict("context" => context,
45-
"suite" => benchmarkgroup,
46-
"config" => benchmarkconfig)
47-
put("https://benchmark-data.tansongchen.workers.dev/TaylorDiff.jl";
48-
body = json(reconstructed))
33+
(; benchmarkgroup, benchmarkconfig) = benchmarkpkg(TaylorDiff)
34+
body["config"] = benchmarkconfig
35+
body["result"] = lower(benchmarkgroup)[:data]
36+
put("https://benchmark-data.tansongchen.workers.dev"; body = json(body))

0 commit comments

Comments
 (0)