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

Faster communication with host/chip #256

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft

Faster communication with host/chip #256

wants to merge 27 commits into from

Commits on Nov 12, 2019

  1. Update for Nengo 3.0

    drasmuss committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    f4f62cd View commit details
    Browse the repository at this point in the history
  2. Update for NengoDL 3.0

    drasmuss committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    92e6258 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a242019 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ba296b4 View commit details
    Browse the repository at this point in the history
  5. TMP remove nengo-dl version requirement

    Pending the NengoDL 3.0 release
    drasmuss committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    fc6c384 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2019

  1. Ensure scipy.sparse is properly imported

    Some import statements just imported `scipy` when we needed
    `scipy.sparse`. Import order differences made this an occasional
    bug. Fixes #252.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    0bd224b View commit details
    Browse the repository at this point in the history
  2. Run tests in python 3.6 by default

    This allows us to do a proper `bones-check` with `black`.
    The hardware tests are still in 3.5.2 to support NxSDK.
    
    This commit also fixes some slight changes by `nengo-bones` 0.6.0
    that were missed in the upgrade commit because of the missing
    `bones-check`.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    2b3442e View commit details
    Browse the repository at this point in the history
  3. Support NxSDK 0.8.7

    Not backwards compatible with previous versions.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    d4e97d1 View commit details
    Browse the repository at this point in the history
  4. Support NxSDK 0.9.0

    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    630761c View commit details
    Browse the repository at this point in the history
  5. Allow user to force precompute=False

    This is useful for testing SNIPs.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    b7ca05f View commit details
    Browse the repository at this point in the history
  6. Add wall-time step timers to Simulator

    - Add a timer around the `Simulator._run_steps` call, to measure the
      time taken for all steps.
    - Connect to the board outside the timing loop, so that this does not
      count towards the step time.
    - Add a timer specific to SNIPs, to get the most accurate timing
      (after we call the board run function, so all setup has happened).
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    f537952 View commit details
    Browse the repository at this point in the history
  7. Only create global spike generator if required

    This reduces unnecessary communication with the chip
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    045c9d5 View commit details
    Browse the repository at this point in the history
  8. DecodeNeurons.get_ensemble user-friendly

    Previously, fixed checking of `neurons_per_dimension` and fixed
    value for `add_to_container` made `get_ensemble` not particularly
    useful for users trying to make their own `DecodeNeurons`. Now,
    these are configurable, and default to the values that users would
    likely want.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    6a4b5cf View commit details
    Browse the repository at this point in the history
  9. Add host SNIP for faster communication

    The host SNIP runs on the host and facilitates communication
    with the superhost using sockets. This is faster than using
    the default RPC interface.
    
    We also take care to make sure both the host and chip SNIPs
    end properly, by sending a message with a negative spike count.
    This helps to eliminate board hangs.
    
    To allow the host SNIP to work with multiple `run` calls, we
    keep it idling in between `run` calls, waiting for a message.
    If the board disconnects before a subsequent run call,
    the negative spike count message will tell the host SNIP to stop.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    3797f11 View commit details
    Browse the repository at this point in the history
  10. Larger channel packet size

    This improves performance by reducing the number of channel reads.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    a17bfa2 View commit details
    Browse the repository at this point in the history
  11. Fix socket overloading

    The socket between the superhost and host was dropping data when
    trying to send larger numbers of spikes. This seems to be solved
    by getting rid of the step counter on the host snip. Something about
    sending the number of steps as a separate message at the start
    threw things off in the socket, I guess.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    6c94e86 View commit details
    Browse the repository at this point in the history
  12. Reduce extra computation in host2chip_snips

    - Also assert one block per core with learning
    - Also get core less often (outside loop) in learn SNIP
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    edf77d6 View commit details
    Browse the repository at this point in the history
  13. Simplify chip receivers for clarity and speed

    Previously, `Simulator._collect_receiver_info` spent significant time
    calling `receive` on each receiver to load information into a queue
    in the receiver, and then getting it back out again. We now skip that
    step, and just do everything in right in `_collect_receiver_info`.
    
    - Eliminating the `hasattr` call in `_collect_receiver_info` also
      has a significant effect on speed.
    - Simpler queueing in `HostReceiveNode` avoids `while` loop and helps
      with speed there.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    4c4a5f7 View commit details
    Browse the repository at this point in the history
  14. Faster spike packing

    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    a20d2c2 View commit details
    Browse the repository at this point in the history
  15. Copy HostSendNode x value to work with new Nengo

    We used to do this copy in Nengo, now we don't, so need to copy here.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    22983ee View commit details
    Browse the repository at this point in the history
  16. Flip host2chip and host step order

    This allows the Nengo model on the (super)host to be running
    simultaneously with the chip, reducing time per step but adding
    in a one step delay between the (super)host model and chip model.
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    e7ce444 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    5fcb6d3 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    aff58e1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    455d095 View commit details
    Browse the repository at this point in the history
  20. Use proper queue in HostReceiveNode for speed

    This makes things faster by not requiring us to increment a counter
    through the node, and also makes sure we get all the data.
    
    We also fix the time in this node to use zero-based timesteps
    rather than one-based timesteps (to conform with core Nengo).
    hunse committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    c97cb20 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    376f4df View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    a5a06f1 View commit details
    Browse the repository at this point in the history