Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Computing time (for network with synapses) scales unexpectedly with timestep and simulation time #1997

Open
jlubo opened this issue Oct 5, 2022 · 5 comments

Comments

@jlubo
Copy link
Collaborator

jlubo commented Oct 5, 2022

Maybe it's not a bug, but it's definitively unexpected: network simulations with long timesteps and long simulation time take much longer than such with short timesteps and short simulation time, even though the network does not produce spikes. I've found this to occur for network models with and without synaptic plasticity. In the trivial case where all synapses are removed, everything seems to run as expected.

The behavior can be reproduced with the code provided here (without plasticity). The file set_arbor_env will have to be adapted to the specific Arbor installation. The script build_and_run_net_test should run three simulations with short, medium, and long timesteps, respectively, on a single CPU core. On my local machine, I get the following output:

short:

meter                         time(s)      memory(MB)
-------------------------------------------------------------------------------------------
load-balance                    0.002           0.228
simulation-init                 3.925          29.548
simulation-run                  0.145           0.003
meter-total                     4.073          29.778

medium:

meter                         time(s)      memory(MB)
-------------------------------------------------------------------------------------------
load-balance                    0.002           0.227
simulation-init                 3.669          29.561
simulation-run                 65.701           0.003
meter-total                    69.372          29.791

long:

still running for hours...

I've been using Arbor version 0.6.1-dev, state of commit 8af6bd2 (including SDE computation as of commit 5d141aa, but don't know if that makes any difference for the given example).

@schmitts
Copy link
Contributor

schmitts commented Oct 6, 2022

https://github.com/arbor-sim/arbor/blob/master/arbor/simulation.cpp#L304

sets the interval of the epochs according to the minimal delay (which is constant 3 ms in the example at hand).

@schmitts
Copy link
Contributor

All we need to change in the example supplied by @jlubo is to set the synaptic delay >= the dt:

d0 = max(self.dt, self.syn_config["t_ax_delay"])

@jlubo
Copy link
Collaborator Author

jlubo commented Nov 4, 2022

For the record: Unfortunately, the suggestion by @schmitts doesn't solve the whole issue. We've found that there might be a general issue with long timesteps: 1. Arbor uses interpolation for computing exact spike times even for long time steps; 2. the stochastic solver is based on the Euler-Maruyama method, which does not converge if timesteps become too large. We will now try to implement an exchange of mechanisms for computing long timesteps with the sparse solver, and at the same suppress spike computation (which is not necessary then).

@thorstenhater
Copy link
Contributor

So, has this changed on the current master w/ fixed-dt?

@jlubo
Copy link
Collaborator Author

jlubo commented Apr 6, 2023

I could solve the (additional) problem mentioned in my last post by using the workaround suggested above by @schmitts and exchanging the mechanism/recipe such that the stochastic solver is used for short timesteps and the sparse solver for long timesteps.

Regarding the general issue: it hasn't changed with the fixed-dt feature, presumably because here the update steps still depend on the synaptic delay by t_interval_ = min_delay()/2;.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants