Replies: 1 comment 15 replies
-
The JIT compiled functions produced by |
Beta Was this translation helpful? Give feedback.
15 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can see quite a few use cases for accessing the generated numba functions directly, instead of using them through the aesara function wrapper. Mostly if we want to create a function pointer that we can call from other compiled code, using
numba.cfunc
.I'm using this is a nuts sampler implemented in rust, and it would also be very useful for sunode, where we could compile the right hand side of an ODE as aesara function, compile that and pass a pointer to the function to the c library sundials to do the actual work.
In nutpie, I currently compile a function in numba mode, then access the optimized fgraph and then use numba_funcify to get an optimized numba function:
https://github.com/aseyboldt/nutpie/blob/master/nutpie/compile_pymc.py#L124
This works, but seems like a rather roundabout way of doing it. I also think it ends up compiling the numba functions twice, and thus slows things down a lot.
Did anyone else do something like this already? Should I just call the the optimization code myself, or should there be an interface for it?
Beta Was this translation helpful? Give feedback.
All reactions