-
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
Speeding up snips by communicating less often #26
Draft
tcstewar
wants to merge
19
commits into
main
Choose a base branch
from
speed-skipping
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
eaebf8e
First draft of documentation.
tbekolay cfe42bc
Fix n_steps in shape demo
drasmuss d14606b
Remove second confusing VTH_MAX
hunse ea5482b
Add MNIST pseudo-conv net example
drasmuss da7be19
Match learning rates to Nengo
tbekolay 8c23740
Moved spike generator into snips
e77a8dc
Added snip_io_steps to control communication rate
03a6d42
Only move spike generators to be on-chip for loihi
a9eff59
PEP8 fixes
ab549fe
Flake8 fixes
d4e0a15
fixup! Added snip_io_steps to control communication rate
hunse d89dfa3
Added code comments for clarity
b598de6
Changed default snip_io_steps to 1 (from 10)
a2cac8a
fixup! Added code comments for clarity
68303cc
fixup! Moved spike generator into snips
5380800
Added test for interneurons on or off host
tcstewar a71e353
Removed repetition of input synapse
e64de2e
fixup! Removed repetition of input synapse
tcstewar 688f8c0
fixup! Removed repetition of input synapse
tcstewar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,13 @@ def __init__(self, network, dt=0.001, seed=None, model=None, # noqa: C901 | |
self.precompute = precompute | ||
self.snip_io_steps = snip_io_steps | ||
|
||
if target is None: | ||
try: | ||
import nxsdk | ||
target = 'loihi' | ||
except ImportError: | ||
target = 'sim' | ||
|
||
self.chip2host_sent_steps = 0 # how many timesteps have been sent | ||
if network is not None: | ||
nengo.rc.set("decoder_cache", "enabled", "False") | ||
|
@@ -180,8 +187,10 @@ def __init__(self, network, dt=0.001, seed=None, model=None, # noqa: C901 | |
progress_bar=False) | ||
else: | ||
# we need online communication | ||
spiking_interneurons_on_host = target != 'loihi' | ||
host, chip, h2c, c2h_params, c2h = splitter.split( | ||
network, INTER_RATE, INTER_N) | ||
network, INTER_RATE, INTER_N, | ||
spiking_interneurons_on_host=spiking_interneurons_on_host) | ||
network = chip | ||
self.chip2host_receivers = c2h | ||
self.host2chip_senders = h2c | ||
|
@@ -208,13 +217,6 @@ def __init__(self, network, dt=0.001, seed=None, model=None, # noqa: C901 | |
self.loihi = None | ||
self.simulator = None | ||
|
||
if target is None: | ||
try: | ||
import nxsdk | ||
target = 'loihi' | ||
except ImportError: | ||
target = 'sim' | ||
|
||
if target == 'simreal': | ||
logger.info("Using real-valued simulator") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. E.g. here |
||
self.simulator = self.model.get_simulator(seed=seed) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to what's being done here, but it might be nice to have some sort of output (print statements? logger statements?) that indicate which target has been chosen. I would probably do it even in the case that the user has explicitly specified
target
(so after thisif
block).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly, although I'm not sure what the best sort of message would be. I'd definitely leave it for a separate PR, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure we already have these logging statements, they're just not raised here.