diffrax icon indicating copy to clipboard operation
diffrax copied to clipboard

Extracting number of function and Jacobian evaluations from diffeqsolve

Open amir-saadat opened this issue 2 years ago • 3 comments

Hey Patrick, Is it possible to get the number of function and Jacobian evaluations from the output of diffrax.diffeqsolve? Thanks

amir-saadat avatar Jun 23 '22 22:06 amir-saadat

These aren't currently available but agreed that this would make sense as a statistic to collect.

This is the kind of thing that'd be really easy to do once (or if) stateful/effectful operations become a thing in JAX. And a huge pain to manually thread the counting operations through without it! [CC @LenaMartens for interest since we were discussing stateful operations recently.]

patrick-kidger avatar Jun 24 '22 08:06 patrick-kidger

Is this for logging purposes or would you use the value itself in a subsequent computation? Would a way to print these counts through eg. a JAX print be enough? (CC: @sharadmv)

LenaMartens avatar Jun 24 '22 10:06 LenaMartens

Thanks @patrick-kidger for the info. @LenaMartens, we'd like to log this ideally.

amir-saadat avatar Jun 24 '22 15:06 amir-saadat