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

Hessian-tracing over ForwardDiff is broken #13

Closed
gdalle opened this issue Apr 10, 2024 · 4 comments
Closed

Hessian-tracing over ForwardDiff is broken #13

gdalle opened this issue Apr 10, 2024 · 4 comments

Comments

@gdalle
Copy link
Collaborator

gdalle commented Apr 10, 2024

See this comment by @Vaibhavdixit02: JuliaDiff/DifferentiationInterface.jl#165 (review)

I think that's because we don't know how to take Tracers of Dual numbers or something of the sort

@adrhill
Copy link
Owner

adrhill commented Apr 10, 2024

When called with prepare_hessian SparsityConnectivityTracer choice throws

ERROR: MethodError: no method matching dual_definition_retval(::Val{…}, ::SparseConnectivityTracer.Tracer, ::Float64, ::ForwardDiff.Partials{…})

This might be due to ForwardDiff defining dual_definition_retval for Real but Tracer being a Number:
https://github.com/JuliaDiff/ForwardDiff.jl/blob/1907196ba50e3eb337860301ece3ec37d0582257/src/dual.jl#L199-L204

How about adding a ForwardDiff extension with a dual_definition_retval method for Tracer?

@gdalle
Copy link
Collaborator Author

gdalle commented Apr 10, 2024

Yeah that seems like the wisest course of action. And add the appropriate tests (no idea what these are)

@adrhill adrhill changed the title Hessians are buggy in DI with ForwardDiff Hessian-tracing over ForwardDiff is broken Apr 10, 2024
@adrhill
Copy link
Owner

adrhill commented Apr 30, 2024

Is this still a desired feature now that we have HessianTracer #24?

@gdalle
Copy link
Collaborator Author

gdalle commented Apr 30, 2024

Nope

@gdalle gdalle closed this as completed Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants