Skip to content

Conversation

@pnbabu
Copy link
Contributor

@pnbabu pnbabu commented May 7, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented May 8, 2025

🐰 Bencher Report

Branch1208/merge
Testbedubuntu-latest

🚨 1 Alert

IterationBenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
0tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py::TestNESTContinuousBenchmarking::test_stdp_nn_synapseLatency
seconds (s)
📈 plot
🚷 threshold
🚨 alert (🔔)
3.87 s
(+13.73%)Baseline: 3.41 s
3.75 s
(103.39%)

Click to view all benchmark results
BenchmarkLatencyBenchmark Result
seconds (s)
(Result Δ%)
Upper Boundary
seconds (s)
(Limit %)
tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py::TestNESTContinuousBenchmarking::test_stdp_nn_synapse📈 view plot
🚷 view threshold
🚨 view alert (🔔)
3.87 s
(+13.73%)Baseline: 3.41 s
3.75 s
(103.39%)

BenchmarkLatencyBenchmark Result
seconds (s)
(Result Δ%)
Upper Boundary
seconds (s)
(Limit %)
tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py::TestNESTContinuousBenchmarking::test_stdp_nn_synapse📈 view plot
🚷 view threshold
🚨 view alert (🔔)
3.21 s
(-5.60%)Baseline: 3.40 s
3.74 s
(85.82%)

BenchmarkLatencyBenchmark Result
seconds (s)
(Result Δ%)
Upper Boundary
seconds (s)
(Limit %)
tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py::TestNESTContinuousBenchmarking::test_stdp_nn_synapse📈 view plot
🚷 view threshold
🚨 view alert (🔔)
3.25 s
(-4.42%)Baseline: 3.40 s
3.74 s
(86.89%)

🐰 View full continuous benchmarking report in Bencher

@pnbabu pnbabu marked this pull request as ready for review August 13, 2025 13:59
@pnbabu pnbabu requested a review from clinssen August 13, 2025 14:00
y += [syn_stats["y"]]
z += [syn_stats["z"]]

# TODO: Adjust tolerance
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you take care of this TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tolerance is a bit high. The tests fail if I decrease the tolerance. I tried a few things, such as adjusting rtol and atol, but couldn't lower the difference. Do you have any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to plot the Lorenz system in a more familiar way, by giving it a higher temporal resolution, see pnbabu@4752f59

I thought that perhaps the high needed tolerance values are due to the reference simulation being one timepoint off (i.e. delayed or shifted forward by one timepoint). Unfortunately I didn't get a chance to test this further. I would be okay merging this PR with to-dos in place if they are additionally turned into a GitHub Issue.

non_linear_synapse

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plotting the high-temporal resolution for the NEST simulation is a bit tricky because the synapse values can only be captured at the end of a simulation run, which is set to 1 ms in the test. Do you think lowering it to 0.1 ms would benefit here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to get some confidence in the reference simulation results; now that I see the familiar Lorenz dynamics, I am more happy about that. I still do not understand why the numerical error tolerances should be so high (1E-3) though. One hypothesis would be that the recorded values are shifted by one timepoint (one resolution timestep), but I haven't had time to look into this further yet. The basic problem is (explaining the) high numerical tolerances.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I adjusted the test a bit to have the same start and end time points. Your hypothesis might be correct. A while back I had plotted the solution from both GSL and scipy solvers and they seemed to match well.

image


if self.option_exists("strictly_synaptic_vars") and removesuffix(synapse.get_name(), FrontendConfiguration.suffix) in self.get_option("strictly_synaptic_vars").keys() and self.get_option("strictly_synaptic_vars")[removesuffix(synapse.get_name(), FrontendConfiguration.suffix)]:
strictly_synaptic_vars.append(self.get_option("strictly_synaptic_vars")[removesuffix(synapse.get_name(), FrontendConfiguration.suffix)])
strictly_synaptic_vars.extend(self.get_option("strictly_synaptic_vars")[removesuffix(synapse.get_name(), FrontendConfiguration.suffix)])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug, right? How could this ever have worked before?

Copy link
Contributor Author

@pnbabu pnbabu Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The synapse model used in the test in this PR has variables that strictly belong to the synapse. Hence, I added them to strictly_synaptic_vars in the codegen_opts introduced in #1229.
This then caused the append in the line to create a list of lists, which failed at line:

assert type(var) is str

That's why I changed it to extend. Perhaps we should change all the append calls here to extend instead to avoid errors.

@clinssen
Copy link
Contributor

clinssen commented Sep 5, 2025

Could you also update running_nest.rst, especially under the heading "Event-based updating of synapses"? Cheers!

The synapse is allowed to contain an ``update`` block. Statements in the ``update`` block are executed whenever the internal state of the synapse is updated from one timepoint to the next; these updates are typically triggered by incoming spikes. The NESTML ``timestep()`` function will return the time that has elapsed since the last event was handled.

Synapses in NEST are not allowed to have any nonlinear time-based internal dynamics (ODEs). This is due to the fact that synapses are, unlike nodes, not updated on a regular time grid. Linear ODEs are allowed, because they admit an analytical solution, which can be updated in a single step from the previous event time to the current event time. However, nonlinear dynamics are not allowed because they would require a numeric solver evaluating the dynamics on a regular time grid.
Synapses can have ODEs with linear and non-linear dynamics. In the case of linear dynamics, the ODEs are solved with the propagators provided by the ODE-toolbox; for non-linear dynamics, the ODEs are solved using a fourth order Runge-Kutta solver with adaptive timestep.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the tolerances be adjusted like in the neuron model? Could you add a reference to GSL or to the GSL solver?

@pnbabu pnbabu requested a review from clinssen October 17, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants