-
Notifications
You must be signed in to change notification settings - Fork 59
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
autodiff_deferred
with derivatives of order greater than 2
#1173
Comments
No it definitely needs to be |
Makes sense. Could you comment on the error then? Am I making some elementary mistake with the interface? |
I also run into a similar error. On Enzyme main (5e4e2ef) and Julia 1.10.2: using Enzyme
f(x) = 4 * x^3
x = 3.0
function df_dx(x)
autodiff_deferred(
Forward,
f,
DuplicatedNoNeed,
Duplicated(x, 1.0),
)[1]
end
function d2f_dx2(x)
autodiff_deferred(
Forward,
df_dx,
DuplicatedNoNeed,
Duplicated(x, 1.0),
)[1]
end
# Forward over forward over forward fails
autodiff_deferred(
Forward,
d2f_dx2,
DuplicatedNoNeed,
Duplicated(x, 1.0),
)
# Reverse over forward over forward fails
autodiff_deferred(
Reverse,
d2f_dx2,
Active,
Active(x),
) The errors for the two cases are similar, for example for the first:
Does anyone have an example where third order AD works? |
I'm working on an application where I really want non-allocating higher-order derivatives. Here is my little code setup:
And I can use this to get second derivatives as
But when I ask for a third derivative I get an error:
gives
Does this mean that autodiff_deferred can't differentiate other autodiff_deferred? So that if I want a third derivative in forward-mode I need to do something that looks like autodiff(autodiff(autodiff_deferred))? I would appreciate any thoughts on executing this as efficiently as possible! Thanks in advance.
The text was updated successfully, but these errors were encountered: