Skip to content
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

Run context condition checks only once, after model parsing #1105

Merged
merged 10 commits into from
Oct 10, 2024

Conversation

clinssen
Copy link
Contributor

@clinssen clinssen commented Sep 29, 2024

This is a spin-off from #1050.

Refactor cocos such that they run only once, after model parsing.

Fixes some other bugs that emerged as part of this refactor. For instance, two cocos turned out to actually make needed changes to the model; the modification part has now been spun off to the new AssignImplicitConversionFactorsTransformer. (I can also make the transformer into a pure visitor; please let me know if you prefer this approach.)

Changes order of operations in compartmental code generator: to prevent symbol not found error, add propagator variable first, then add the update expressions that reference this variable.

@clinssen clinssen marked this pull request as draft September 29, 2024 07:43
@clinssen clinssen force-pushed the symboltable_checks branch 2 times, most recently from eec6c89 to 45f2a47 Compare September 30, 2024 14:00
@clinssen clinssen force-pushed the symboltable_checks branch 4 times, most recently from 3f1e731 to 0ff3456 Compare October 2, 2024 13:29
Copy link

github-actions bot commented Oct 2, 2024

🐰 Bencher Report

Branch1105/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
bencher::mock_0📈 view plot
⚠️ NO THRESHOLD
1.66
bencher::mock_1📈 view plot
⚠️ NO THRESHOLD
18.37
bencher::mock_2📈 view plot
⚠️ NO THRESHOLD
25.10
bencher::mock_3📈 view plot
⚠️ NO THRESHOLD
34.59
bencher::mock_4📈 view plot
⚠️ NO THRESHOLD
45.70
🐰 View full continuous benchmarking report in Bencher

Copy link

github-actions bot commented Oct 4, 2024

🐰 Bencher Report

Branch1105/merge
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
tests/nest_continuous_benchmarking/test_nest_continuous_benchmarking.py::TestNESTContinuousBenchmarking::test_stdp_nn_synapse📈 view plot
⚠️ NO THRESHOLD
4,162,135,894.60
🐰 View full continuous benchmarking report in Bencher

@clinssen clinssen marked this pull request as ready for review October 7, 2024 08:33
@clinssen clinssen requested a review from pnbabu October 7, 2024 08:33
@@ -142,10 +144,14 @@ def parse_file(cls, file_path=None):
for model in ast.get_model_list():
model.accept(ASTSymbolTableVisitor())
SymbolTable.add_model_scope(model.get_name(), model.get_scope())
Logger.set_current_node(model)
AssignImplicitConversionFactorsTransformer().transform(model)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a Transformer, this should be part of the transformation step. But, I understand that we have to do this before we check the CoCos. We also cannot move this as part of the transformation step and then check the cocos because some cocos transform the model by moving variables across models, especially when synapse models are present (please correct me if I am wrong). So do you think this shouldn't technically be called a Transformer but just a visitor doing the conversion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Changed the transformer into a visitor.

Copy link
Contributor

@pnbabu pnbabu left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you!

@clinssen
Copy link
Contributor Author

Thank you for the review! Let's merge as soon as the tests pass.

@clinssen clinssen merged commit 9fc69b4 into nest:master Oct 10, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants