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

Simulator has global side-effect of disabling decoder cache #207

Closed
arvoelke opened this issue Mar 27, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@arvoelke
Copy link
Contributor

commented Mar 27, 2019

import nengo
import nengo_loihi

print(nengo.rc.get("decoder_cache", "enabled"))

try:
    nengo_loihi.Simulator(nengo.Network())
except:
    pass

print(nengo.rc.get("decoder_cache", "enabled"))
True
False

This means that a nengo-loihi simulation followed by one-or-more nengo simulations will no longer use the cache. This can be documented, or potentially relaxed by using

Simulator(..., model=Model(dt=float(dt), label="%s, dt=%f" % (network, dt), decoder_cache=None), ...)

to construct the individual simulators? Also note:

model = nengo.builder.Model(
dt=float(dt),
label="%s, dt=%f" % (network, dt),
decoder_cache=get_default_decoder_cache())

and:

self.decoder_cache = NoDecoderCache()

arvoelke added a commit that referenced this issue Mar 28, 2019

@arvoelke arvoelke self-assigned this Mar 29, 2019

arvoelke added a commit that referenced this issue Mar 29, 2019

Pass no decoder cache to sub-models
Decoder cache wasn't working due to lack of context manager
which is normally constructed by the top-level network build.
Fixes #207.

arvoelke added a commit that referenced this issue Apr 1, 2019

hunse added a commit that referenced this issue Apr 3, 2019

hunse added a commit that referenced this issue Apr 3, 2019

Combine splitter into builder
Most of the work done by the splitter is now done in the builder.
This should give more clarity and control over the mapping between
pre-build and post-build objects. The `SplitterDirective` class
takes on the organizational tasks of the old `Splitter`, giving
directives to the builder about what should be on- or off-chip.

Also:
- Add unit tests for splitter refactoring.
- Raise `BuildError` if learning objects are on_chip. Fixes #208
  and #209.
- Pass no decoder cache to sub-models. Decoder cache wasn't working
  due to lack of context manager which is normally constructed by
  the top-level network build. Fixes #207.
- Various improvements to passthrough removal, including not removing
  useful passthrough nodes.
  Outstanding issues include: #210, #212, #213
- Handle sliced probes. Closes #205.
- Check that splitter handles sliced probes. Closes #206.
- Test that splitter does not mutate network. Closes #211.

hunse added a commit that referenced this issue Apr 3, 2019

hunse added a commit that referenced this issue Apr 3, 2019

Combine splitter into builder
Most of the work done by the splitter is now done in the builder.
This should give more clarity and control over the mapping between
pre-build and post-build objects. The `SplitterDirective` class
takes on the organizational tasks of the old `Splitter`, giving
directives to the builder about what should be on- or off-chip.

Also:
- Add unit tests for splitter refactoring.
- Raise `BuildError` if learning objects are on_chip. Fixes #208
  and #209.
- Pass no decoder cache to sub-models. Decoder cache wasn't working
  due to lack of context manager which is normally constructed by
  the top-level network build. Fixes #207.
- Various improvements to passthrough removal, including not removing
  useful passthrough nodes.
  Outstanding issues include: #210, #212, #213
- Handle sliced probes. Closes #205.
- Check that splitter handles sliced probes. Closes #206.
- Test that splitter does not mutate network. Closes #211.

hunse added a commit that referenced this issue Apr 9, 2019

Combine splitter into builder
Most of the work done by the splitter is now done in the builder.
This should give more clarity and control over the mapping between
pre-build and post-build objects. The `SplitterDirective` class
takes on the organizational tasks of the old `Splitter`, giving
directives to the builder about what should be on- or off-chip.

Also:
- Add unit tests for splitter refactoring.
- Raise `BuildError` if learning objects are on_chip or learning and
  `precompute` are combined. Fixes #208 and #209.
- Pass no decoder cache to sub-models. Decoder cache wasn't working
  due to lack of context manager which is normally constructed by
  the top-level network build. Fixes #207.
- Handle sliced probes. Closes #205.
- Check that splitter handles sliced probes. Closes #206.
- Test that splitter does not mutate network. Closes #211.
- Simulation is now identical whether precompute is True or False,
  on both emulator and chip. The tolerance for test_precompute is
  now zero.

tbekolay added a commit that referenced this issue Apr 15, 2019

tbekolay added a commit that referenced this issue Apr 15, 2019

Combine splitter into builder
Most of the work done by the splitter is now done in the builder.
This should give more clarity and control over the mapping between
pre-build and post-build objects. The `SplitterDirective` class
takes on the organizational tasks of the old `Splitter`, giving
directives to the builder about what should be on- or off-chip.

Also:
- Add unit tests for splitter refactoring.
- Raise `BuildError` if learning objects are on_chip or learning and
  `precompute` are combined. Fixes #208 and #209.
- Pass no decoder cache to sub-models. Decoder cache wasn't working
  due to lack of context manager which is normally constructed by
  the top-level network build. Fixes #207.
- Handle sliced probes. Closes #205.
- Check that splitter handles sliced probes. Closes #206.
- Test that splitter does not mutate network. Closes #211.
- Simulation is now identical whether precompute is True or False,
  on both emulator and chip. The tolerance for test_precompute is
  now zero.

tbekolay added a commit that referenced this issue Apr 15, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

tbekolay added a commit that referenced this issue Apr 15, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

tbekolay added a commit that referenced this issue Apr 15, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

tbekolay added a commit that referenced this issue Apr 23, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

tbekolay added a commit that referenced this issue Apr 23, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

arvoelke added a commit that referenced this issue Apr 23, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

tbekolay added a commit that referenced this issue Apr 24, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

tbekolay added a commit that referenced this issue Apr 24, 2019

Pass no decoder cache to sub-models
The decoder cache does not work for host models due to having
no context manager, which is normally constructed by the
top-level network builder.

This commit fixes #207 as it does not globally disable the
decoder cache. We also add some asserts to existing tests
for ensure that #207 is fixed.

@tbekolay tbekolay closed this in 11ad56d Apr 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.