Skip to content

Splitter fails for sliced connections and probes #205

Closed

Description

@arvoelke

The following code has different behaviour for connections from a[0] versus a even though they are the same object (a is one-dimensional).

import nengo
import nengo_loihi

def go(do_bug):
    with nengo.Network() as model:
        nengo_loihi.add_params(model)

        a = nengo.Ensemble(1, 1, label="a")
        b = nengo.Ensemble(1, 1, label="b")
        model.config[b].on_chip = False

        nengo.Connection(a[0] if do_bug else a, b)

    with nengo_loihi.Simulator(model) as sim:
        pass

go(False)
go(True)
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-148-00268f888de2> in <module>()
     16 
     17 go(False)
---> 18 go(True)

<ipython-input-148-00268f888de2> in go(do_bug)
     12         nengo.Connection(a[0] if do_bug else a, b)
     13 
---> 14     with nengo_loihi.Simulator(model) as sim:
     15         pass
     16 

~/CTN/nengo-loihi/nengo_loihi/simulator.py in __init__(self, network, dt, seed, model, precompute, target, progress_bar, remove_passthrough)
    364             # We could warn about this, but we want to avoid people having
    365             # to specify `precompute` unless they absolutely have to.
--> 366             self.precompute = True
    367 
    368         # Build the network into the model

~/CTN/nengo-loihi/nengo_loihi/builder/builder.py in build(self, obj, *args, **kwargs)
    152 
    153     def build(self, obj, *args, **kwargs):
--> 154         built = self.builder.build(self, obj, *args, **kwargs)
    155         if self.build_callback is not None:
    156             self.build_callback(obj)

~/CTN/nengo/nengo/builder/builder.py in build(cls, model, obj, *args, **kwargs)
    216                 "Cannot build object of type %r" % type(obj).__name__)
    217 
--> 218         return cls.builders[obj_cls](model, obj, *args, **kwargs)
    219 
    220     @classmethod

~/CTN/nengo/nengo/builder/network.py in build_network(model, network, progress)
     96         logger.debug("Network step 4: Building probes")
     97         for probe in network.probes:
---> 98             model.build(probe)
     99 
    100         if context is model.decoder_cache:

~/CTN/nengo-loihi/nengo_loihi/builder/builder.py in build(self, obj, *args, **kwargs)
    152 
    153     def build(self, obj, *args, **kwargs):
--> 154         built = self.builder.build(self, obj, *args, **kwargs)
    155         if self.build_callback is not None:
    156             self.build_callback(obj)

~/CTN/nengo/nengo/builder/builder.py in build(cls, model, obj, *args, **kwargs)
    216                 "Cannot build object of type %r" % type(obj).__name__)
    217 
--> 218         return cls.builders[obj_cls](model, obj, *args, **kwargs)
    219 
    220     @classmethod

~/CTN/nengo-loihi/nengo_loihi/builder/probe.py in build_probe(model, probe)
    148     key = probeables[probe.attr] if probe.attr in probeables else probe.attr
    149     if key is None:
--> 150         conn_probe(model, probe)
    151     else:
    152         signal_probe(model, key, probe)

~/CTN/nengo-loihi/nengo_loihi/builder/probe.py in conn_probe(model, nengo_probe)
     79     else:
     80         raise NotImplementedError(
---> 81             "Nodes cannot be onchip, connections not yet probeable")
     82 
     83     probe = Probe(key='voltage', weights=weights, synapse=nengo_probe.synapse)

NotImplementedError: Nodes cannot be onchip, connections not yet probeable

Activity

  1. self-assigned this
    on Mar 27, 2019
  2. changed the title [-]Splitter tries to put node on chip for sliced connection[/-] [+]Splitter fails for sliced connections and probes[/+] on Mar 27, 2019
  3. arvoelke commented on Mar 27, 2019

    @arvoelke
    ContributorAuthor

    Here's a simpler test that fails with the same error message:

    with nengo.Network() as model:
        a = nengo.Ensemble(1, 1, label="a")
        p = nengo.Probe(a[0])
    
    with nengo_loihi.Simulator(model) as sim:
        pass
  4. added a commit that references this issue on Apr 1, 2019
    f1f80fb
  5. added 3 commits that reference this issue on Apr 3, 2019
    df54ce5
    de2b772
    ade513f
  6. added 4 commits that reference this issue on Apr 15, 2019
    2799902
    1c58e20
    4f996cd
    ce9c4d2
  7. added 2 commits that reference this issue on Apr 23, 2019
    28e26fb
    d89c1be
  8. added a commit that references this issue on Apr 23, 2019
    4a18ca9
  9. added 3 commits that reference this issue on Apr 24, 2019
    d767ec4
    58e98c0
    e116b91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions