Skip to content

Commit

Permalink
add Dummy benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
KDr2 committed Jun 27, 2019
1 parent cc6ec0f commit b472691
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
19 changes: 19 additions & 0 deletions benchmarks/Dummy.run.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Turing, TuringBenchmarks

data = [0, 1, 0, 1, 1, 1, 1, 1, 1, 1]

@model constrained_test(obs) = begin
p ~ Beta(2,2)
for i = 1:length(obs)
obs[i] ~ Bernoulli(p)
end
p
end

bench_res = @tbenchmark(HMC(1000, 1.5, 3), constrained_test, data)

# bench_res[4].names = ["phi[1]", "phi[2]", "phi[3]", "phi[4]"]
logd = build_logd("Dummy-Benchmark", bench_res...)

print_log(logd)
send_log(logd)
5 changes: 5 additions & 0 deletions benchmarks/benchmark_list.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BENCHMARK_FILES = [
"Dummy.run.jl",
]

BENCHMARK_FILES = map(BENCHMARK_FILES) do x joinpath(@__DIR__, x) end
5 changes: 4 additions & 1 deletion benchmarks/runbenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ run(`git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'`)
run(`git fetch --all --unshallow`)

run(`git clone https://github.com/TuringLang/TuringBenchmarks.git ../TuringBenchmarks`)
run(`git -c ../TuringBenchmarks checkout -b external-bm origin/external-bm`) # remove this!

delete!(ENV, "JULIA_PROJECT")

Expand All @@ -37,7 +38,9 @@ pkg"add SpecialFunctions"
using TuringBenchmarks
"""

code_run = """using TuringBenchmarks.Runner
code_run = """using TuringBenchmarks
using TuringBenchmarks.Runner
TuringBenchmarks.set_benchmark_files("./benchmarks/benchmark_list.jl")
Runner.run_bm_on_travis("$BM_JOB_NAME", ("master", "$CURRENT_BRANCH"), "$COMMIT_SHA")
"""

Expand Down

0 comments on commit b472691

Please sign in to comment.