Skip to content

Commit a0b8134

Browse files
committed
Fix more RNGs
1 parent c8381b2 commit a0b8134

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

benchmarks/src/DynamicPPLBenchmarks.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ using LogDensityProblems: LogDensityProblems
99
using ForwardDiff: ForwardDiff
1010
using Mooncake: Mooncake
1111
using ReverseDiff: ReverseDiff
12+
using StableRNGs: StableRNG
1213

1314
include("./Models.jl")
1415
using .Models: Models
@@ -61,18 +62,20 @@ The AD backend should be specified as a Symbol (e.g. `:forwarddiff`, `:reversedi
6162
`islinked` determines whether to link the VarInfo for evaluation.
6263
"""
6364
function make_suite(model, varinfo_choice::Symbol, adbackend::Symbol, islinked::Bool)
65+
rng = StableRNG(23)
66+
6467
suite = BenchmarkGroup()
6568

6669
vi = if varinfo_choice == :untyped
6770
vi = VarInfo()
68-
model(vi)
71+
model(rng, vi)
6972
vi
7073
elseif varinfo_choice == :typed
71-
VarInfo(model)
74+
VarInfo(rng, model)
7275
elseif varinfo_choice == :simple_namedtuple
73-
SimpleVarInfo{Float64}(model())
76+
SimpleVarInfo{Float64}(model(rng))
7477
elseif varinfo_choice == :simple_dict
75-
retvals = model()
78+
retvals = model(rng)
7679
vns = [VarName{k}() for k in keys(retvals)]
7780
SimpleVarInfo{Float64}(Dict(zip(vns, values(retvals))))
7881
else

0 commit comments

Comments
 (0)