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
135 stars 35 forks source link

add option to convert MassActionJumps to ConstantRateJumps #427

Open isaacsas opened 3 weeks ago

isaacsas commented 3 weeks ago

In some preliminary benchmarking for a talk I'm finding that when using Direct with a small number of jumps (~6), we can actually now get a ~30% speedup using ConstantRateJumps. This needs more investigation, but it may be that in the case of a small number of jumps, where we don't need function wrappers and use recursion for type-stability, we can now do better than MassActionJumps.

isaacsas commented 3 weeks ago

(This is also consistent with the performance difference between MassActionJumps and a hand-coded Direct method that evaluates propensities via a single function.)

ChrisRackauckas commented 3 weeks ago

That is rather surprising still, but interesting.

isaacsas commented 3 weeks ago

Yeah, I'm not yet convinced of this result, but the conversion would be easy to add and allow us to test this systematically from Catalyst-generated models in SciMLBenchmarks.