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
#683 introduces a separate path when creating the thunk (_usethunks() ? Thunk($(esc(func))) : $(esc(body))). However, this would introduce new variables into the caller's scope and create Core.Box thus causing type instability, which breaks some rrule type stability checks in NeuralAttentionlib.jl.
Currently, I have two ways to solve this:
replace $(esc(body)) with $(esc(func))() which turns the else path into a function call, thus no variable introduction.
mimic how @async and @spawn using $ to interpolate values. so @thunk would be defined as:
#683 introduces a separate path when creating the thunk (
_usethunks() ? Thunk($(esc(func))) : $(esc(body))
). However, this would introduce new variables into the caller's scope and createCore.Box
thus causing type instability, which breaks some rrule type stability checks in NeuralAttentionlib.jl.Currently, I have two ways to solve this:
$(esc(body))
with$(esc(func))()
which turns the else path into a function call, thus no variable introduction.@async
and@spawn
using$
to interpolate values. so@thunk
would be defined as:However, I don't understand #683 enough to see what would be better for 2nd order AD. Maybe @pxl-th or @mcabbott would have some thoughts on this.
The text was updated successfully, but these errors were encountered: