warp icon indicating copy to clipboard operation
warp copied to clipboard

Ability to invoke adjoint functions

Open jc211 opened this issue 2 years ago • 2 comments

"Warp uses a source-code transformation approach to auto-differentiation."

I don't quite understand what this means and I know this is not how one is supposed to use tape but my question is: Is it technically possible for me to write a @wp.func foo and get back a @wp.func foo_derivative which I can save and reuse later within kernel launches? This is in contrast to doing it at the kernel level.

jc211 avatar Jul 25 '23 06:07 jc211

Hi @jc211,

Currently we don't provide a way to call the derivative directly - however this would not be too difficult and I can imagine could be quite useful. I will make a note of this feature request.

Thanks, Miles

mmacklin avatar Jul 26 '23 02:07 mmacklin

Dear all, what is the status of this issue? I have a use case where calling the automatically generated adjoints of user functions would be quite useful (to avoid having to re-code the whole adjoint chain for a customized adjoint. Given that the adjoint functions of user functions are already generated, I expect this request to be quite easy to implement, provided that a sensible naming convention is chosen. Thanks.

jsfrancal avatar Sep 13 '25 22:09 jsfrancal