Closed metab0t closed 4 months ago
See the heading 03-01 on https://cppad.readthedocs.io/latest/2024.html#mm-dd-03-01
The actual fix was in the change to fun2val.hpp in https://github.com/coin-or/CppAD/commit/c06562264d11f8a2a6d2a7f68dc6a69f08598a4d
If you are satisfied with this fix, please close this issue.
Thanks for the fix! It does solve the problem.
Just one extra curious problem @bradbell : what is the advantage of val_graph
over cpp_graph
for optimization? cpp_graph
seems like a stack-based bytecode format of the execution graph already.
The val_graph optimizer is a complete re-write of the optimizer. It treats dynamic parameter and variables the same and is much simpler in other ways. Unfortunately, the conversion from the representation that computes derivatives to the val_graph representation takes extra memory and time. On the other hand, it may be that the val_graph optimizer is better in some ways. The hope is that the optimizer can be written to be as simple as the val_graph optimizer, but not take the extra conversion time and memory.
Note that you can compare the speed of the resulting function (not counting the optimization) using val_graph or not.
There are examples and documentation for the val_graph representation in the developer build of the documentation. If you would like to know how to build this, open a discussion about the developer documentation.
I try to use
val_graph
optimizer in the following code:Exception is thrown:
By looking at the stacktrace, the problem happens in https://github.com/coin-or/CppAD/blob/05881684eaf38444853cfcbbd947671fae6aae76/include/cppad/local/val_graph/renumber.hpp#L162
The elements in
dep_vec_
(length = 4) are very big numbers which seem uninitialized.