You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forgive me if this is a known issue, or is desired behaviour.
I get an error when including a @show call inside my Turing model. Supposedly, a rrule!! hasn't been written for a primitive in the @show macro.
In my ignorance, I imagine it wouldn't be too hard to add.
I ran into it trying to use the @show call for quick debugging purposes - it is of course is in general not relevant to the actual model. So this issue is primarily for debugging convenience.
Minimal example below. ReverseDiff does not error. Using newest versions of Turing and Mooncake.
using Turing
import Mooncake, ReverseDiff
@model function testmodel(bar = [1, 1])
dists = [arraydist([Normal(), Normal(), Normal()]),
arraydist([Normal(), Normal()])
]
@show dists
foo = Vector(undef, length(bar))
for (idx, barval) in enumerate(bar)
foo[idx] ~ dists[idx]
end
end
sample(testmodel(), NUTS(; adtype = AutoReverseDiff(; compile = true)), 100)
sample(testmodel(), NUTS(; adtype = AutoMooncake(; config = nothing)), 100)
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue @PTWaade . You are correct that this is one of those things that ought not to be too hard -- the judicious use of @zero_adjoint (see https://compintell.github.io/Mooncake.jl/stable/utilities/defining_rules/#Functions-with-Zero-Adjoint) ought to be enough. We just need someone to take the time to understand exactly which low-level things need this rule applied to them, and to carefully test that everything works as expected.
Thank you for the quick response ! And I'm sorry for creating a duplicate, I just saw the discussion on the original issue.
This is not urgent at all. I'd be happy to help, too, but I don't have the time this semester. I'm also not sure I'm familiar enough with Mooncake to be very efficient at figuring this out, even if I had the time..
Thank you for the great work though, and all the best!
No problem at all re duplication -- we prefer to have a low bar for opening issues so that we hear about as many problems as possible, even if it does mean we occasionally get some duplication!
Forgive me if this is a known issue, or is desired behaviour.
I get an error when including a @show call inside my Turing model. Supposedly, a rrule!! hasn't been written for a primitive in the @show macro.
In my ignorance, I imagine it wouldn't be too hard to add.
I ran into it trying to use the @show call for quick debugging purposes - it is of course is in general not relevant to the actual model. So this issue is primarily for debugging convenience.
Minimal example below. ReverseDiff does not error. Using newest versions of Turing and Mooncake.
The text was updated successfully, but these errors were encountered: