-
Notifications
You must be signed in to change notification settings - Fork 17
Use the same Tag for the sparse Hessian of the Lagrangian #351
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
base: main
Are you sure you want to change the base?
Conversation
thanks @amontoison for the update. please tag us again when this is released so that we can test it 🤞🏽 |
lz::Vector{ForwardDiff.Dual{Tag, T, 1}} | ||
glz::Vector{ForwardDiff.Dual{Tag, T, 1}} | ||
lz::Vector{ForwardDiff.Dual{Val{:SparseADHessian}, T, 1}} | ||
glz::Vector{ForwardDiff.Dual{Val{:SparseADHessian}, T, 1}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no idea it could work this way. I thought the first type was connected to the function !?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Tag is just used to know what is the inner / outer function when we have nested differentiation.
The Tag can be the type of the function, Nothing or a custom symbol.
It will not impact performance, it is just for correctness.
Benchmark resultJudge resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Benchmark resultJudge resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Benchmark resultJudge resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
Benchmark resultJudge resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsA ratio greater than
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfoTarget
Baseline
Target resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Baseline resultBenchmark Report for /home/runner/work/ADNLPModels.jl/ADNLPModels.jlJob Properties
ResultsBelow is a table of this job's results, obtained by running the benchmarks.
Benchmark Group ListHere's a list of all the benchmark groups executed by this job:
Julia versioninfo
Runtime information
|
@amontoison making progress 🙂🤞🏽 |
@jbcaillau The problem is deeper than expected, ReverseDiff.jl calls ForwardDiff.jl internally sometimes and it is when it breaks your code. I probably need to overload a few functions in ReverseDiff.jl to fix your issue. |
thanks for the update. are we the only one with such an issue when doing forward over reverse? |
To the best of my knowledge, yes you are the only one concerned by this issue. |
@amontoison under the control of @PierreMartinon: the nlp returned by direct_transcription below is ADNLPModel with standard access to both objective and constraints (check its construction there). using OptimalControl
using NLPModelsIpopt
x0 = [ 0.
1. ]
A = [ 0. 1.
-1. 0. ]
B = [ 0.
1. ]
Q = [ 1. 0.
0. 1. ]
R = 1.
tf = 3.
ocp = @def begin
t ∈ [0, tf], time
x ∈ R², state
u ∈ R, control
x(0) == x0
ẋ(t) == A * x(t) + B * u(t)
0.5∫( x(t)' * Q * x(t) + u(t)' * R * u(t) ) → min
end
docp, nlp = direct_transcription(ocp)
solve(ocp) # error "Cannot determine ordering of Dual tags ForwardDiff.Tag{ReverseDiff.var..."
solve(ocp; adnlp_backend = :default) # no error |
What is the status here? It doesn't seem right tbh. |
Related issues:
cc @jbcaillau, @ocots