-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing / incorrect impl of Base.parent
for LogDensityProblemsAD.jl interface
#197
Comments
Was about to make a PR myself, but figured I should first check if @willtebbutt is happy with this:) |
The issue has also been noted in TuringLang/Turing.jl#2289 (comment). @torfjelde, feel free to create a PR. |
Ah, interesting. Is the In my view, adding a method of |
Tbh, I don't know 😅 I read the src code as |
Version 0.2.25 of Tapir.jl should resolve this. Could someone please check? |
I triggered a rerun of TuringLang/Turing.jl#2289. |
It seems there are additional places that need fix: https://github.com/TuringLang/Turing.jl/actions/runs/9988691426/job/27802772815?pr=2289#step:8:775 |
I've commented directly on the PR associated to that run -- it looks more like a Turing.jl issue than a Tapir.jl issue to me, but I might be misinterpreting. |
You are indeed correct @willtebbutt 👍 |
Closing this since the remaining issues with Turing are caused by separate reasons. |
LogDensityProblemsAD.jl implements
Base.parent
forADGradientWrapper
(https://github.com/tpapp/LogDensityProblemsAD.jl/blob/449e5661bc2667f7bef061e148a6ea5526cbb427/src/LogDensityProblemsAD.jl#L34) by just accessing theℓ
field, which is assumed to return the original logdensity passed toADgradient
.IIRC that field is not the original logdensity but a
Tapir.CoDual
? Hence it might be worth overloadingBase.parent
to return the "correct" thing, or alternatively change what theℓ
field represents.Lack of this will cause issues in applications where one wants to re-construct the gradient wrapper with a new logdensity programmatically, e.g. TuringLang/Turing.jl#2231 (and more specifically, TuringLang/Turing.jl#2231 (comment)).
The text was updated successfully, but these errors were encountered: