Skip to content

Fix STDP k-value error for edge case#2661

Merged
abigailm merged 20 commits intonest:masterfrom
JanVogelsang:STDP-bugfix
Sep 11, 2023
Merged

Fix STDP k-value error for edge case#2661
abigailm merged 20 commits intonest:masterfrom
JanVogelsang:STDP-bugfix

Conversation

@JanVogelsang
Copy link
Contributor

@JanVogelsang JanVogelsang commented Apr 18, 2023

PR #2443 contained a bug in the fix, this PR hotfixes the bugfix.
Adding max_delay_ + kernel().connection_manager.get_min_delay() looked correct, but was actually adding double + long, i.e., ms + delay.
It had to be max_delay_ + Time::delay_steps_to_ms( kernel().connection_manager.get_min_delay() ) instead.

@JanVogelsang JanVogelsang self-assigned this Apr 18, 2023
@clinssen
Copy link
Contributor

Can we amend the unit test so it fails on the old code, but passes on the new code?

@clinssen clinssen self-requested a review April 18, 2023 10:50
@JanVogelsang
Copy link
Contributor Author

JanVogelsang commented Apr 18, 2023

I improved the test to correctly detect the original error correctly, tested some more parameter combinations and fixed some bugs in the test which occurred for that parameters. Additionally, I added a test for the stdp_pl_synapse_hom which is quite similar to the regular STDP test, mainly with different STDP weight dynamics.
It is not possible to make the test fail for the previous version of the bugfix, as it actually fixed the bug, but instead of archiving the spikes too short, it archived them longer than required (at least for resolutions of <1).

@JanVogelsang
Copy link
Contributor Author

Strange, NEST aborts, but why? How can I debug this issue when it doesn't occur locally?

@heplesser
Copy link
Contributor

Strange, NEST aborts, but why? How can I debug this issue when it doesn't occur locally?

Do you have the same setup locally (Python version etc) as on the CI runner? And have you tried to run the test locally as the test runner would do it, i.e., with python -m pytest --verbose --timeout 30 --numprocesses=1 test_stdp_synapse.py?

@github-actions
Copy link

Pull request automatically marked stale!

@github-actions github-actions bot added the stale Automatic marker for inactivity, please have another look here label Jun 18, 2023
@clinssen
Copy link
Contributor

@JanVogelsang : could you pull master and fix the merge conflicts? There is also one "TODO" marked in the code, could you re-enable plotting? Cheers!

@github-actions github-actions bot removed the stale Automatic marker for inactivity, please have another look here label Jun 27, 2023
@terhorstd terhorstd requested review from med-ayssar and removed request for terhorstd June 27, 2023 12:33
@JanVogelsang
Copy link
Contributor Author

JanVogelsang commented Jul 1, 2023

Sure thing! I removed some warnings while I was at it, and don't get any errors or warning locally when I run pytest the same way the CI runner does (although with a higher Python version, I use 3.11).
However, enabling plotting slows down the test significantly. It takes multiple minutes to complete with plots and just a few second without plots. In CI it doesn't make sense to use plots anyway, so I would suggest we let the user enable them on-demand instead.

Copy link
Contributor

@clinssen clinssen left a comment

Choose a reason for hiding this comment

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

Could it be that some unrelated changes were pulled in in connector_base.h and event_delivery_manager.cpp (and some other kernel files)?

@terhorstd terhorstd requested review from clinssen and removed request for med-ayssar July 3, 2023 09:58
@clinssen clinssen changed the title Hotfix: Fix STDP k-value error for edge case Fix STDP k-value error for edge case Jul 3, 2023
@JanVogelsang
Copy link
Contributor Author

JanVogelsang commented Jul 3, 2023

You are right, those were actually incorrectly added.
And there are some other changes that are unrelated, but not worth their own PR. Just some lines that Pooja forgot in a recent PR (#2618).

Copy link
Contributor

@clinssen clinssen left a comment

Choose a reason for hiding this comment

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

Thanks!

@JanVogelsang
Copy link
Contributor Author

@abigailm Can you review this PR?

@terhorstd terhorstd added T: Bug Wrong statements in the code or documentation S: High Should be handled next I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Aug 22, 2023
@JanVogelsang
Copy link
Contributor Author

@abigailm Now that you are back from vacation, can you review this?

@abigailm
Copy link
Contributor

All looks fine to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: High Should be handled next T: Bug Wrong statements in the code or documentation

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants

Comments