Discrepancy between execution time measurements on nengo_loihi

Hi,

I have the problem that there is a large discrepancy between the execution time measurements when I measure it with the Loihi time probe or use the build in time package in python like this:

sim = nengo_loihi.Simulator(model)
board = sim.sims["loihi"].nxsdk_board
import time
sim_start = time.time()
with sim:
    sim.run(run_time)
sim_end= time.time()

Its seems to be due to the slow I/O speed of the Loihi chip. Is there anything that can be done to get the time measured with the python time package closer to the measurement with the time probe.

Thanks a lot,

Emanuel

Hi @emanuelbuchholz, and welcome to the Nengo forums! :smiley:

Using the python time mechanism, and the nxsdk execution time probe measures two different things. When you do this:

sim_start = time.time()
with sim:
    sim.run(run_time)
sim_end= time.time()

Multiple things are being measured. These are (in sort of the right order):

  1. The time it takes for Nengo to build your model.
  2. And the time it takes for NengoLoihi to take the built Nengo model and compile it into something that the Loihi board can use.
  3. And the time it takes for NxSDK to load and compile the model onto the Loihi board.
  4. And the time it takes for the Loihi board to initialize.
  5. And the time it takes for the simulation to finish running (this includes any I/O between the Loihi board and the superhost computer)
  6. And the time it takes for the simulation to complete, and shut down

In comparison, the NxSDK execution time probe only measures the time it takes for the simulation to run on the board (and any I/O that is between the board and superhost computer) – i.e., #5 from the above list.

As to your question, it’s impossible to get the python time package to report a measurement closer to the NxSDK execution time probe (because they are measuring two different things). Depending on your specific use case, you’ll have to use either one of them, or both! :smiley: