Skip to content

Commit b472691

Browse files
author
KDr2
committed
add Dummy benchmarks
1 parent cc6ec0f commit b472691

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

benchmarks/Dummy.run.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Turing, TuringBenchmarks
2+
3+
data = [0, 1, 0, 1, 1, 1, 1, 1, 1, 1]
4+
5+
@model constrained_test(obs) = begin
6+
p ~ Beta(2,2)
7+
for i = 1:length(obs)
8+
obs[i] ~ Bernoulli(p)
9+
end
10+
p
11+
end
12+
13+
bench_res = @tbenchmark(HMC(1000, 1.5, 3), constrained_test, data)
14+
15+
# bench_res[4].names = ["phi[1]", "phi[2]", "phi[3]", "phi[4]"]
16+
logd = build_logd("Dummy-Benchmark", bench_res...)
17+
18+
print_log(logd)
19+
send_log(logd)

benchmarks/benchmark_list.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BENCHMARK_FILES = [
2+
"Dummy.run.jl",
3+
]
4+
5+
BENCHMARK_FILES = map(BENCHMARK_FILES) do x joinpath(@__DIR__, x) end

benchmarks/runbenchmarks.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ run(`git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'`)
2222
run(`git fetch --all --unshallow`)
2323

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

2627
delete!(ENV, "JULIA_PROJECT")
2728

@@ -37,7 +38,9 @@ pkg"add SpecialFunctions"
3738
using TuringBenchmarks
3839
"""
3940

40-
code_run = """using TuringBenchmarks.Runner
41+
code_run = """using TuringBenchmarks
42+
using TuringBenchmarks.Runner
43+
TuringBenchmarks.set_benchmark_files("./benchmarks/benchmark_list.jl")
4144
Runner.run_bm_on_travis("$BM_JOB_NAME", ("master", "$CURRENT_BRANCH"), "$COMMIT_SHA")
4245
"""
4346

0 commit comments

Comments
 (0)