Nengo SpiNNaker faster than real time

Hi,

I would like to know if there is a way to run a nengo SpiNNaker simulation faster than real time, or is it a feature that is not there?

Best,
Manos

Hi @manosangelidis!

NengoSpinnaker is currently designed to run a Nengo simulation in real time as it targets real-time applications. However, you can remove this limitation by editing the nengo_spinnaker/simulator.py file.

In that file, look for and comment out this block of code:

# If that step took less than timestep then spin
time.sleep(0.0001)
while run_time < host_steps * local_timestep:
    time.sleep(0.0001)
    run_time = time.time() - start_time

I would caution taking this step though, we haven’t rigorously tested running the Spinnaker interface at full tilt and there may be issues with ensuring synchronized communication between the Spinnaker hardware and the Python code running on your computer.

Hi,

Great response, I will do so, thanks a lot!

Best,
Manos

@tcstewar Is one of the authors of the NengoSpinnaker codebase, and he can provide a more detailed explanation into why the real-time limitation is there, and how you could (maybe) safely remove this restriction.

Hi @manosangelidis, and good question. This was one of the features that we kept talking about adding to nengo_spinnaker but never got around to it.

@xchoo is definitely right that one place that needs to change is that bit in the simulator.py file. That’s what controls the speed of the input and output to spinnaker, and lets it go on to the next time step. However, if we want nengo_spinnaker to run faster than realtime, then we also need to make sure that each SpiNNaker core has less work to do, so that the calculations can actually be completed on time. And that means that we also have to modify the process that takes the network and separates it into small parts for each core. The code for that is scattered around the builder.

However, depending on the network that you’re running, this might not be a problem anyway. You might be able to just manually make your Ensembles smaller (i.e. use 5 Ensembles of size 100 rather than one Ensemble of size 500) and that might work out fine, without making modifications to the builder.

Hi Terry, thanks for the great answer. Actually my Ensembles already reach the limit of the neurons that nengo SpiNNaker can run. I think this might be because 1 specific Ensemble has 2000 neurons, which causes SpiNNaker to throw an exception. Do you think there is a workaround around this issue? The overall network size is around 2300 neurons, so I suppose that SpiNNaker can probably run that faster than real time, since real time is already achieved.

Best regards,
Manos