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
My custom reverse rule works as expected in 1st order reverse mode, but I need to give the corresponding function @noinline tag for it to be picked up in 2nd order forward over reverse. In the MWE below I've introduced a bug in the rule such that both the gradient and the hv product should be different between g and g_custom; gradients are always different, but hv products are only different when I add @noinline.
@danielwe with the just landed fixes to nesting (and in particular not calling deferred anymore on the inside but regular autodiff), does this still err?
Finally got around to testing this. Updating the MWE to conform to API changes (Config -> RevConfig), it now works correctly if I replace autodiff_deferred with just autodiff. Awesome! (The original bug report happened before autodiff was allowed in 2nd order AD.)
However, if I stick to autodiff_deferred (adding the Const annotation to the function as required by the simplified API), I still get the error unless I use @noinline as described in the OP.
So if autodiff_deferred is deprecated as public API this issue can be closed (and ideally docs updated accordingly). If end users should still be able to use autodiff_deferred and get correct results, there's a remaining issue here.
My custom reverse rule works as expected in 1st order reverse mode, but I need to give the corresponding function
@noinline
tag for it to be picked up in 2nd order forward over reverse. In the MWE below I've introduced a bug in the rule such that both the gradient and the hv product should be different betweeng
andg_custom
; gradients are always different, but hv products are only different when I add@noinline
.Output as written: different gradients, equal hv products.
Output with
@noinline
: both gradients and hv products different.The text was updated successfully, but these errors were encountered: