-
Notifications
You must be signed in to change notification settings - Fork 4
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
Testing the benchmark with ADNLPModel 0.8.3 #17
Comments
@ocots @frapac . I'm impressed with the results so far. In testing the Goddard rocket problem, the total time decreased from ~870ms to ~80ms!! |
@0Yassine0 Don't hesitate to remove MadNLP in your environment, as we are not using it currently. Can you test the new release of OptimalControl with ADNLPModels 0.8.3 on
It would be nice if the new release improve significantly the time spent in NLP function evaluations for this instance. |
Yes, exactly that's what I did. I just use it when comparing with Ipopt and KNITRO.
The result speaks for itself. |
Indeed. Good job @0Yassine0 ! |
@jbcaillau @PierreMartinon @joseph-gergaud ¡ Increíble ! |
@ibtissammim it may help you. |
What should be compared between v0.8.2 and v0.8.3 is the number of colors. |
😱 @0Yassine0 @frapac impressive! guys, I would like further comments on this (closed) issue. @amontoison ?
|
The additional comment I can give is how variables are connected to each other in the Lagrangian of your problem. It's problem-dependent, but your problems could have quite a common pattern in the objective/constraints depending on the subset of optimal control problems and your discretization scheme. An example of how it impacts AD is: f(x) = x[1] * sum(x[i] for i=1:n)
c(x) = x The Hessian of the Lagrangian will have a dense row (the first one), and thus we can't compute any combination of the columns of the Hessian with a column coloring (overlap on the first row of a potential compressed column). Therefore, we need to perform n directional derivatives to obtain each H[1, i]. The difference now is that we exploit the symmetry; thus, the first row is also the first column of the Hessian, and we can only do one directional derivative to compute them all. The second issue is, for a computed coefficient H[i, j], is it the j-component of the i-column (computed in the compressed column of a specific color) or the i-row of the j-column (computed as another compressed column)? You want to correctly build the sparse Hessian after you have computed all nonzeros with AD (decompression step), and that's not easy to implement efficiently. |
thanks @amontoison Got it that symmetry reduces significantly the number of directional derivatives to compute. Question: the sparsity structure is always know in advance and fixed1; to what extent is it helpful (= computationally relevant) / better to pass this structure to AD / optimiser, vs. using graph coloring as indicated above? Footnotes
|
If you have the sparsity structure, you can avoid the sparsity detection, which can be quite expensive even if we use The idea is to provide Note that you still need to do the coloring afterward. The coloring is used to determine the seeds (combinations of columns of the identity matrix) that we should use for the directional derivatives to get all nonzeros of the sparse Jacobian / Hessian. @tmigot started a tutorial to explain how to do that last year: Quick summary of what we do in ADNLPModels.jl:
|
ADNLPModel 0.8.3 uses a different algorithm for the coloring, using the symmetry of the Hessian. It may improve the performance in OptimalControl.jl.
xref control-toolbox/CTDirect.jl#111 (comment)
The text was updated successfully, but these errors were encountered: