simulation speed with num_replicates versus looping #1901
Replies: 4 comments 3 replies
-
This is a drastic difference, I agree. Any chance you could try running this through the profiler and see where we're spending the time? |
Beta Was this translation helpful? Give feedback.
-
Yep. Here's the loop version using msprime git HEAD and results sorted by cumulative time.
And the same thing, sorted by total time.
|
Beta Was this translation helpful? Give feedback.
-
Excellent, thanks @grahamgower. Looks like the majority of the time is spent in Well, this is good news I guess - the bottlenecks are all in Python, so we should be able to trim quite a bit of time off. |
Beta Was this translation helpful? Give feedback.
-
#1908 made some good inroads into this. A lot of time is still spend in |
Beta Was this translation helpful? Give feedback.
-
In #1899, @jeromekelleher pointed out just how much faster it is to pass
num_replicates
versus looping.Output:
Addmittedly, each of these simulations is very small which magnifies the overhead of the looping approach. But such small simulations are actually very common when doing simulation-based inference (e.g. discussion #1834), in which case we can't use
num_replicates
because the simulation parameters are different in each simulation. So I wonder, is there anything that could be done to reduce overhead here?Beta Was this translation helpful? Give feedback.
All reactions