Skip to content

Passthrough removal fails for sliced probes #206

Closed

Description

@arvoelke
def go(do_bug):
    with nengo.Network() as model:
        a = nengo.Ensemble(1, 1, label="a")
        passthrough = nengo.Node(size_in=1, label="passthrough")
        b = nengo.Ensemble(1, 1, label="b")

        nengo.Connection(a, passthrough)
        nengo.Connection(passthrough, b)

        p = nengo.Probe(passthrough[0] if do_bug else passthrough)

    with nengo_loihi.Simulator(model, remove_passthrough=True) as sim:
        pass

go(False)
go(True)
AssertionError                            Traceback (most recent call last)
<ipython-input-1-bbe32de37e3c> in <module>()
     21 
     22 go(False)
---> 23 go(True)

<ipython-input-1-bbe32de37e3c> in go(do_bug)
     17         p = nengo.Probe(passthrough[0] if do_bug else passthrough)
     18 
---> 19     with nengo_loihi.Simulator(model, remove_passthrough=True) as sim:
     20         pass
     21 

~/CTN/nengo-loihi/nengo_loihi/simulator.py in __init__(self, network, dt, seed, model, precompute, target, progress_bar, remove_passthrough)
    328             node_neurons=self.model.node_neurons,
    329             node_tau=self.model.decode_tau,
--> 330             remove_passthrough=remove_passthrough,
    331         )
    332         network = self.networks.chip

~/CTN/nengo-loihi/nengo_loihi/splitter.py in split(net, precompute, node_neurons, node_tau, remove_passthrough)
    144 
    145     # --- Step 5: place probes
--> 146     place_probes(networks)
    147 
    148     # Commit to the moves marked in the previous steps

~/CTN/nengo-loihi/nengo_loihi/splitter.py in place_probes(networks)
    484     for probe in networks.original.all_probes:
    485         target = base_obj(probe.target)
--> 486         networks.move(probe, networks.location(target))
    487 
    488 

~/CTN/nengo-loihi/nengo_loihi/splitter.py in move(self, obj, target, force)
     99         if not force:
    100             assert obj not in self, "already moved"
--> 101         assert target in self.targets, "invalid target"
    102         logger.debug("Moving %s to %s", obj, target)
    103         if obj in self.adds:

AssertionError: invalid target

The bug does not happen when remove_passthrough=False.

I believe the fix is to change this line:

probed_objs = set(base_obj(p.target) for p in net.all_probes)

so that ObjView are resolved into their underlying base objects (as done in the splitter). Note the other base_obj calls are okay, because they all use pre_obj and post_obj which already resolve the ObjView.

Note this issue is somewhat independent of #205, as the latter bug occurs even when remove_passthrough=False.

Activity

  1. self-assigned this
    on Mar 27, 2019
  2. added a commit that references this issue on Apr 1, 2019
    110be8a
  3. added 3 commits that reference this issue on Apr 3, 2019
    df54ce5
    de2b772
    ade513f
  4. added 4 commits that reference this issue on Apr 15, 2019
    2799902
    1c58e20
    4f996cd
    ce9c4d2
  5. added a commit that references this issue on Apr 23, 2019
  6. tbekolay commented on Apr 26, 2019

    @tbekolay
    Member

    Done in #202.

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