Skip to content

Commit 5c79686

Browse files
committed
fix test errors
1 parent 18f4c73 commit 5c79686

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1818
LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
1919
MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d"
2020
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
21+
Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6"
2122
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
2223
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
2324
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -45,6 +46,7 @@ JET = "0.9, 0.10"
4546
LogDensityProblems = "2"
4647
MCMCChains = "6.0.4, 7"
4748
MacroTools = "0.5.6"
49+
Mooncake = "0.4.137"
4850
OrderedCollections = "1"
4951
ReverseDiff = "1"
5052
StableRNGs = "1"

test/ext/DynamicPPLMooncakeExt.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ using Distributions
33
using Random
44
using Test
55
using StableRNGs
6-
using Mooncake: NoCache, set_to_zero!!, set_to_zero_internal!!, zero_tangent
7-
using DynamicPPL.TestUtils.AD: @be
8-
using Statistics: median
6+
using Mooncake: Mooncake, NoCache, set_to_zero!!, set_to_zero_internal!!, zero_tangent
7+
using DynamicPPL.TestUtils.AD: @be, median
98

109
# Define models globally to avoid closure issues
1110
@model function test_model1(x)
@@ -106,6 +105,7 @@ end
106105
speedup = time_iddict / time_nocache
107106
@test speedup > 1.5 # Conservative expectation - should be ~4x
108107

108+
# Sanity check
109109
@info "Performance improvement" speedup time_iddict_μs = time_iddict / 1000 time_nocache_μs =
110110
time_nocache / 1000
111111
end
@@ -188,8 +188,5 @@ end
188188

189189
# Global should be faster (uses NoCache)
190190
@test time_global < time_closure
191-
192-
@info "Closure handling" time_global_ms = time_global * 1000 time_closure_ms =
193-
time_closure * 1000
194191
end
195192
end

0 commit comments

Comments
 (0)