8000 Monitor unit test non-deterministically fails in CI/CD · Issue #109 · lava-nc/lava · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Monitor unit test non-deterministically fails in CI/CD #109

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

Closed
mathisrichter opened this issue Nov 26, 2021 · 0 comments · Fixed by #110
Closed

Monitor unit test non-deterministically fails in CI/CD #109

mathisrichter opened this issue Nov 26, 2021 · 0 comments · Fixed by #110
Assignees
Labels
1-bug Something isn't working

Comments

@mathisrichter
Copy link
Contributor

@PhilippPlank: This error happens at the GitHub checks occasionally. It never happened when I run my unit tests and the solution is to re-run the tests on GitHub. What is the problem with this test and does it connected with the division by 0 runtime warning?

Error: Test failed: proc.monitor.test_monitors.Monitors.test_monitor_collects_voltage_and_spike_data_from_population_lif
69 Traceback (most recent call last):
70 File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
71 yield
72 File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/unittest/case.py", line 592, in run
73 self._callTestMethod(testMethod)
74 File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
75 method()
76 File "/home/runner/work/lava/lava/tests/lava/proc/monitor/test_monitors.py", line 236, in test_monitor_collects_voltage_and_spike_data_from_population_lif
77 self.assertTrue(np.all(spike_data == np.array([[0, 0, 0, 1, 0, 0],
78 File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/unittest/case.py", line 688, in assertTrue
79 raise self.failureException(msg)
80 AssertionError: False is not true

@mathisrichter: I believe this is the same non-deterministic behavior we were seeing with our SpikeGenerator. The Monitor probes OutPorts by setting up an InPort that receives from it. But it does not use recv() right away - instead it uses probe() first. Since the order in which LIF and Monitor get executed within one time step is not deterministic, a spike is sometimes picked up in one time step, sometimes in the next. The unit test tests for it arriving in a particular time step.

def run_spk(self):
    """
    During this phase, InPorts of Monitor process collects data from
    monitored OutPorts
    """
    # Check if this Monitor Process instance has been assigned to monitor
    # any OutPort by checking proc_params["n_in_ports"], if so loop over
    # those InPorts; readout their values to correspoinding data-stroing
    # Var
    for i in range(self.proc_params["n_in_ports"]):
        in_port_name = self.proc_params["InPorts"][i]
        out_read_name = self.proc_params["VarsData2"][i]
        # Check if buffer is non-empty, otherwise add zero to the list
        if getattr(self, in_port_name).csp_ports[0].probe():
            getattr(self, out_read_name)[:, self.current_ts - 1] = \
                np.squeeze(np.array(getattr(self, in_port_name).recv()))
        else:
            getattr(self, out_read_name)[:, self.current_ts - 1] = 0
@mathisrichter mathisrichter added the 1-bug Something isn't working label Nov 26, 2021
@mathisrichter mathisrichter added this to the Release v0.2.0 milestone Nov 26, 2021
@mathisrichter mathisrichter self-assigned this Nov 26, 2021
mathisrichter added a commit to mathisrichter/lava that referenced this issue Nov 26, 2021
…on-deterministically

Signed-off-by: Mathis Richter <mathis.richter@intel.com>
mgkwill pushed a commit that referenced this issue Nov 27, 2021
monkin77 pushed a commit to monkin77/thesis-lava that referenced this issue Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0