SciML / JumpProcesses.jl

Build and simulate jump equations like Gillespie simulations and jump diffusions with constant and state-dependent rates and mix with differential equations and scientific machine learning (SciML)
https://docs.sciml.ai/JumpProcesses/stable/
Other
140 stars 35 forks source link

investigate dropping FunctionWrappers #66

Open isaacsas opened 5 years ago

isaacsas commented 5 years ago

In redoing benchmarks with stock Julia 1.1 I'm finding that on a Cartesian grid random walk simulation (32^3 mesh, so ~6*32^3 jumps) Direct consistently beats DirectFW. So it seems like Julia can now handle very deep recursion efficiently (how the jumps are evaluated to ensure type stability).

I'm not sure how to exploit this in methods using dependency graphs, where only a few jumps would be evaluated per time-step and we don't know them at compile time, but it would be great to be able to ditch function wrappers for ConstantRateJumps in the non-Direct SSAs.

isaacsas commented 5 years ago

In fact, across several reaction networks too I'm never seeing an advantage to using FunctionWrappers. At a minimum it seems we can probably drop DirectFW and FRMFW.

isaacsas commented 5 years ago

It would also be good to benchmark the difference between MassActionJumps and pure ConstantRateJumps again on the latest Julia versions. For Direct they may no longer be needed (as opposed to methods that only update a small subset of rates).

ChrisRackauckas commented 5 years ago

I wonder who would know the answer to what changed. Maybe we can ask Jameson tomorrow. I have no idea why this would be different in 1.1.

ChrisRackauckas commented 4 years ago

Was this ever investigated again?

isaacsas commented 4 years ago

Won’t we still need it in the non-Direct SSAs since they won’t have the recursion trick to build a single nested chain of calls to all constant rate jumps?

On Jun 5, 2020, at 9:02 PM, Christopher Rackauckas notifications@github.com wrote:

 Was this ever investigated again?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ChrisRackauckas commented 4 years ago

yes, they'll need it to not dynamic dispatch