-
Notifications
You must be signed in to change notification settings - Fork 12
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
Increasing cell count in network increases time to convert recorded arrays #559
Comments
Also this is only the case when increasing the number of cells! You can run the same test by increasing the number of branches and see that there is not impact... |
Hi Nick, thanks for reporting. This is super interesting, in part because the timings look completely different on my laptop (Macbook pro M3): I think there are two interesting things:
v = jitted_simulate(params).block_until_ready() I hope that this will make the weird behavior go away. See here for why you are observing this behavior.
Michael |
Really help explanation @michaeldeistler! This was definitely an issue with the asynchronous dispatch, adding In terms of different machines, I've noticed that with NEURON simulations that the newest M1+ chips just destroy any other machine in terms of CPU processing speed. The results above are from an HPC node, but I get similar timing on my local computer with an intel I5 CPU. Not a real issue on my end as I've got GPU access, but I totally agree an order of magnitude difference is striking |
Also I'm profiling the performance hit when increasing the number of recordings, I'll put together an example soon. Feel free to either close this issue, or I can just continue the discussion here (and possibly adjust the title) |
Actually I just opened a PR addressing the recording issue (#561) so I think I'll go ahead and close this issue since it was mainly my own confusion on how jax works. Thanks a bunch for walking me through it! |
I've found some peculiar behavior when simulating networks with a large number of cells. While increasing the cell count in the network has a negligible impact on the simulation time, it seems that internally the recordings need to be "converted" before further analysis.
This is seen whenever you use a function that accesses data in the recorded output (like
plt.plot()
ornp.array()
). Even stranger, it does not depend on the size of the recording. In the example below I simulate networks with increasing numbers of neurons, but only record the voltage of the first neuron.It seems this linearly increases the time to convert the simulated output fron
jnp.Array
tonp.array
, but the size of the vector is the same, and the simulation time is not impacted:The text was updated successfully, but these errors were encountered: