JuliaGameTheoreticPlanning / ParametricMCPs.jl

Mixed complementarity problems parameterized by "runtime"-parameters with support for implicit differentiation.
MIT License
17 stars 2 forks source link

Use ADTypes.jl #33

Open lassepe opened 5 months ago

lassepe commented 5 months ago

ADTypes does not support Julia 1.8. Hence it would be good to wait for https://github.com/SciML/ADTypes.jl/issues/47 to be resolved.

codecov[bot] commented 5 months ago

Welcome to Codecov :tada:

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered :open_umbrella:

gdalle commented 5 months ago

If you're tinkering with several AD packages and willing to use ADTypes, you may wanna take it one step further with DifferentiationInterface. At the moment only the version on main supports the latest ADTypes, but I'm aiming for a v0.3 release in the coming weeks

lassepe commented 5 months ago

Thank you for the suggestion. In our use case, it is fairly important that the AD backend is symbolic/tracing. A typical upstream use case of this package looks like this:

https://github.com/JuliaGameTheoreticPlanning/MCPTrajectoryGameSolver.jl/blob/main/src/solver_setup.jl

In that setting, the user typically provides the symbolic description of the problem rather than in terms of a callable function.

The key advantage of a symbolic approach here is that the user doesn't have to think too much about runtime performance while describing the problem (since tracing will generate an efficient in-place function for them anyway). My understanding is that DifferentiationInterface does not support that use case very well (?).

That said, I think there is value in using DifferentiationInterface on the inplace function generated by, e.g., Symbolics.build_function to generate the Jacobians; c.f. https://github.com/JuliaGameTheoreticPlanning/ParametricMCPs.jl/issues/24