Skip to content
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

Rule for atomic_pointerset #470

Open
willtebbutt opened this issue Feb 10, 2025 · 0 comments
Open

Rule for atomic_pointerset #470

willtebbutt opened this issue Feb 10, 2025 · 0 comments
Labels
bug Something isn't working high priority

Comments

@willtebbutt
Copy link
Member

willtebbutt commented Feb 10, 2025

TuringLang/DynamicPPL.jl#799 re-highlighted a problem that causes Mooncake.jl to fail in specific situations in DynamicPPL (specific VarInfos). Happily, this just appears to be a problem with the rrule!! for atomic_pointerset, not anything more widespread. See https://github.com/TuringLang/DynamicPPL.jl/actions/runs/13218146414/job/36899908042?pr=799 . In particular, it looks like I basically hadn't considered the possibility that you might be setting a pointer-to-a-pointer when I wrote the rule, and therefore failed to consider that zero_tangent would not work. Moreover, this is implementation is simply incorrect for pointers (they have fdata), so it is a good thing that it errors loudly.

The fix would be to modify atomic_pointerset to account for the fact that the thing being pointed to might have fdata associated to it, and to not construct a zero_tangent if so. I should probably also check this case for pointerset, as I imagine that I made the same mistake there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

No branches or pull requests

1 participant