DynamicPPL.jl icon indicating copy to clipboard operation
DynamicPPL.jl copied to clipboard

"[DynamicPPL] attempt to link a linked vi" warning when aborting sampling and returning minus infinity

Open jlperla opened this issue 3 years ago • 5 comments

I have some code that may have failures and need to reject the sample, which I do with something like

    if !(sol.retcode == :Success)
        @addlogprob! -Inf
        return
    end

This used to work fine (though it gives a warning which doesn't appear to be possible to turn off the last time I looked). In recent DynamicPPL, though, it has additional warnings for each parameter

┌ Warning: The current proposal will be rejected due to numerical error(s).
│   isfinite.((θ, r, ℓπ, ℓκ)) = (true, true, false, true)
└ @ AdvancedHMC C:\Users\jesse\.julia\packages\AdvancedHMC\51xgc\src\hamiltonian.jl:47
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821
┌ Warning: [DynamicPPL] attempt to link a linked vi
└ @ DynamicPPL C:\Users\jesse\.julia\packages\DynamicPPL\1qg3U\src\varinfo.jl:821

Is this an innocuous warning? If so, any way to turn it off (and also the one in AdvancedHMC if that has been resolved.

jlperla avatar Aug 16 '22 21:08 jlperla

I'm having trouble identifying what change in DPPL is causing this tbh; I'll have to do some digging. I also can't reproduce this issue with an example model, e.g. DynamicPPL.TestUtils.demo_dot_assume_dot_observe() :confused:

It shouldn't cause any issues wrt. correctness though because it just goes "oh, it's already linked; I won't link it then". But stilll weird that it shows up, so I'm slightly worried.

torfjelde avatar Aug 18 '22 13:08 torfjelde

I am getting the same warning on a model I just started working on. Can you please elaborate on what exactly it means for end users? The message isn't very helpful.

juliohm avatar Sep 20 '22 20:09 juliohm

I'm also getting this warning.

CiaranOMara avatar Oct 19 '22 03:10 CiaranOMara

@torfjelde will #417 fix this?

yebai avatar Nov 02 '22 20:11 yebai

No, not that I'm aware of. I think this is an issue in Turing, but needs a bit more digging to find the source.

torfjelde avatar Nov 03 '22 10:11 torfjelde

This is likely resolved. Please re-open if similar issues are observed again.

yebai avatar May 07 '24 07:05 yebai