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

[WIP] Testing compatibility of user-defined gradients approach #2667

Closed
wants to merge 50 commits into from
Closed

[WIP] Testing compatibility of user-defined gradients approach #2667

wants to merge 50 commits into from

Conversation

andrjohns
Copy link
Collaborator

This PR is being used to test the downstream compatibility of an approach to user-defined gradients. Given that the approach is based on a lot of specialised tuple manipulation and general template trickery, I'd like to make sure that it's not fragile to any of the various compilation/testing layers in the pipeline.

I have replaced the gradient specifications for a unary function (exp), binary function (hypot), and a matrix/varmat function (diag_pre_multiply) to see whether compilation and values/gradients are stable throughout the pipeline

@andrjohns
Copy link
Collaborator Author

Looks like there's some compatibility issues with the older g++, closing to investigate

@andrjohns andrjohns closed this Feb 12, 2022
@andrjohns andrjohns reopened this Feb 13, 2022
@wds15
Copy link
Contributor

wds15 commented Mar 28, 2022

Cool beans! Is there some design doc around? Would this approach also allow for efficient Jacobian adjoint product things, which is more efficient in case we only want the gradient in reverse mode? Having analytic gradients is a great thing, don't get me wrong! If you want to performance sensitive test, then you can attempt to make this work with a non-stiff ODE problem and use the RK45 integrator. Supplying the gradient for the user defined ODE RHS should speed up things a lot if this approach is fast.

@andrjohns
Copy link
Collaborator Author

Thanks! Yep, the latest iteration added an implementation where the gradient function can be specified as an adjoint-jacobian product, either for just reverse-mode or for both reverse- and forward-mode.

A design-doc is still in the works, just want to make sure that all works downstream first!

@andrjohns
Copy link
Collaborator Author

Closing for now to clear PR backlog, will re-open once ready for review

@andrjohns andrjohns closed this May 1, 2022
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

Successfully merging this pull request may close these issues.

3 participants