nengo / nengo-loihi

Run Nengo models on Intel's Loihi chip
https://www.nengo.ai/nengo-loihi/
Other
35 stars 12 forks source link

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

Closed arvoelke closed 5 years ago

arvoelke commented 5 years ago
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:

https://github.com/nengo/nengo-loihi/blob/025cdf9973a45a43f6907587ede4d3cb6c828476/nengo_loihi/simulator.py#L406-L409

and:

https://github.com/nengo/nengo-loihi/blob/025cdf9973a45a43f6907587ede4d3cb6c828476/nengo_loihi/builder/builder.py#L90