-
Notifications
You must be signed in to change notification settings - Fork 1
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
nengo_fpga.Simulator runs 1-2 time-steps ahead of nengo.Simulator #40
Comments
I believe this is due to the fact that we use the first simulator step to initialize everything... does that sound right @xchoo? |
Maaaaaaaaybe? I'll add a card to investigate this |
Wouldn't it be the other way around then (if the first time-step is effectively a no-op, wouldn't the FPGA be a step behind rather than ahead)? |
It might be that for nengo_fpga we consider timestep 0 to be the first timestep, whereas in nengo, it's timestep dt as the first timestep? (iirc) |
If anything, nengo_fpga should run 1 timestep behind (because of the UDP socket delay). This requires further investigation. |
Yes, the first recorded timestep is |
Actually, @arvoelke that looks like a 2 timestep difference?? 😲 |
I was looking into a related issue where we were missing the packet from the first timestep,
The solution here was to initialize the remote (device) side time to Fixing this closed the step offset by 1, this means PYNQ now matches the reference simulator, and the DE1 is off by one instead of two. I'm guessing there is a similar issue with sim time in the DE1 C driver which may account for the second step offset, though I haven't looked yet. I modified Aarons script above and got these plots for reference: |
Just putting this here as reference for when I come back to this: initializing |
It might help by looking at what happens if there is input on the very first time-step, and only that one time-step. I vaguely recall this producing a weird result on one of the boards. The gain will need to be made non-zero. Looking at non-spiking might also help make it easier to spot. For spiking, you would want to make the input large enough to integrate into a spike given the gain on the neuron (e.g., |
I'm posting an update here with some additional info as it's related and I'm not sure it warrants a separate issue. It appears as though there were actually two facets to this issue:
For the latter, I haven't done an in depth investigation yet but I want to note some preliminary observations for posterity. I noticed this trying to port the keyword spotter to the PYNQ FPGA:
@xchoo is currently investigating NengoFPGA socket performance, so chances are things will change, we should potentially just wait on his results/rework before digging into this. We can use our workaround of adding a dummy initial step for now. |
A more pointed hypothesis for when we come back to this:
|
The difference is one time-step for
pynq
(not shown) and two time-steps forde1
(shown above).However if we change the second simulator from
nengo_fpga.Simulator
tonengo.Simulator
we get the expected result:The text was updated successfully, but these errors were encountered: