Skip to content

Commit 964d02d

Browse files
authored
Merge pull request #19 from TensorBFS/mrv/test-benchmark
Run benchmarks in CI and push results to TensorBFS/TensorInference-data
2 parents ab5b049 + eedcf6f commit 964d02d

File tree

7 files changed

+100
-12
lines changed

7 files changed

+100
-12
lines changed

.github/workflows/benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install dependencies
1616
run: julia -e 'using Pkg; pkg"add PkgBenchmark BenchmarkCI@0.1"'
1717
- name: Run benchmarks
18-
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge(baseline="origin/main")'
18+
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge(baseline = "origin/main")'
1919
- name: Post results
2020
run: julia -e 'using BenchmarkCI; BenchmarkCI.postjudge()'
2121
env:
@@ -29,4 +29,4 @@ jobs:
2929
'
3030
env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
SSH_KEY: ${{ secrets.DATA_SSH_KEY }}
32+
SSH_KEY: ${{ secrets.DOCUMENTER_KEY }}

benchmark/Artifacts.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[MAR_prob]
2+
git-tree-sha1 = "4dd2447ab2b8eeb8fbfc35d0c7416b5f01ff9711"
3+
4+
[[MAR_prob.download]]
5+
sha256 = "857f8b6706dad46698c6e90a1804e1b40633d87f6eb3d82b5f29929bb6f5155a"
6+
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/MAR_prob.tar.gz"
7+
8+
[MAR_sol]
9+
git-tree-sha1 = "8a86826145efa6b7d7d9c837acd80e33d1368f37"
10+
11+
[[MAR_sol.download]]
12+
sha256 = "d8616ebfc1ab538c2957919f8bb47bd9c1fb86392dd025585cde041bc4e0e934"
13+
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/MAR_sol.tar.gz"
14+
15+
[MMAP_UAI2014]
16+
git-tree-sha1 = "869778bbf5214cbff2169ecc2f3e67e2cb1b6a7a"
17+
18+
[[MMAP_UAI2014.download]]
19+
sha256 = "0080c4851e23c17a42262cdaf4cb1a7aa4b80674435756d0d1ade76d80b9f33f"
20+
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/MMAP_UAI2014.tar.gz"
21+
22+
[PR_prob]
23+
git-tree-sha1 = "a9baff14cc5f64a5d95920928581e2b4eb82acd3"
24+
25+
[[PR_prob.download]]
26+
sha256 = "20b38d43a0718ab555988f041069380a30bbb68881e60d07ebf004054eb9f14f"
27+
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/PR_prob.tar.gz"
28+
29+
[PR_sol]
30+
git-tree-sha1 = "e6643155c4ee433d20ddb7e58441b33b35ecacb8"
31+
32+
[[PR_sol.download]]
33+
sha256 = "86b37c0e7c83f6ff162c88d48250e0bf2b7dd73d44441074ae93a81986238436"
34+
url = "https://personal.utdallas.edu/~vibhav.gogate/uai14-competition/files/PR_sol.tar.gz"

benchmark/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[deps]
22
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
33
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
4+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
45
TensorInference = "c2297e78-99bd-40ad-871d-f50e56b81012"

benchmark/bench_map.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module BenchMap
2+
3+
using BenchmarkTools
4+
using TensorInference
5+
using Artifacts
6+
7+
const SUITE = BenchmarkGroup()
8+
9+
problem = read_uai_problem("Promedus_14")
10+
11+
optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40)
12+
tn = TensorNetworkModel(problem; optimizer)
13+
SUITE["map"] = @benchmarkable most_probable_config(tn)
14+
15+
end # module
16+
BenchMap.SUITE

benchmark/bench_mar.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module BenchMar
2+
3+
using BenchmarkTools
4+
using TensorInference
5+
using Artifacts
6+
# using CUDA
7+
# CUDA.allowscalar(false)
8+
9+
const SUITE = BenchmarkGroup()
10+
11+
problem = read_uai_problem("Promedus_14")
12+
13+
optimizer = TreeSA(ntrials = 1, niters = 5, βs = 0.1:0.1:100)
14+
tn1 = TensorNetworkModel(problem; optimizer)
15+
SUITE["mar"] = @benchmarkable marginals(tn1)
16+
17+
# optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40)
18+
# tn2 = TensorNetworkModel(problem; optimizer)
19+
# SUITE["mar-cuda"] = @benchmarkable marginals(tn2; usecuda = true)
20+
21+
end # module
22+
BenchMar.SUITE

benchmark/bench_marginals.jl

Lines changed: 0 additions & 10 deletions
This file was deleted.

benchmark/bench_mmap.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module BenchMmap
2+
3+
using BenchmarkTools
4+
using TensorInference
5+
using Artifacts
6+
7+
const SUITE = BenchmarkGroup()
8+
9+
problem = read_uai_problem("Promedus_14")
10+
optimizer = TreeSA(ntrials = 1, niters = 2, βs = 1:0.1:40)
11+
12+
# Does not marginalize any var
13+
mmap1 = MMAPModel(problem; marginalizedvertices = Int[], optimizer)
14+
SUITE["mmap-1"] = @benchmarkable maximum_logp(mmap1)
15+
16+
# Marginalizes all vars
17+
mmap2 = MMAPModel(problem; marginalizedvertices = collect(1:(problem.nvars)), optimizer)
18+
SUITE["mmap-2"] = @benchmarkable maximum_logp(mmap2)
19+
20+
# Does not optimize over open vertices
21+
mmap3 = MMAPModel(problem; marginalizedvertices = [2, 4, 6], optimizer)
22+
SUITE["mmap-3"] = @benchmarkable most_probable_config(mmap3)
23+
24+
end # module
25+
BenchMmap.SUITE

0 commit comments

Comments
 (0)