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

More compiler friendly error handling. #554

Merged
merged 1 commit into from
Nov 23, 2022

Conversation

neworderofjamie
Copy link
Contributor

@neworderofjamie neworderofjamie commented Nov 1, 2022

Turns out that compiling the code generated by our CHECK_CUDA_ERRORS macro can cause runner.cc compilation to take a long time and a lot of memory. Switching this out of a simpler macro that just calls std::abort can reduce compile times by up to 10x on a model with 10000 state variables (equivalent to about 100 neuron populations, nearly all-to-all connected):
fig_2_alternate_error
This simpler error handling macro can now be enabled from C++ with:

void modelDefinition(NNmodel &model)
{
    ...
    GENN_PREFERENCES.generateSimpleErrorHandling = true;
    ...
}

or from Python like:

model = GeNNModel("float", "my_model", generateSimpleErrorHandling=True)

@neworderofjamie neworderofjamie added this to the GeNN 4.9.0 milestone Nov 1, 2022
@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Base: 88.82% // Head: 88.82% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (1383827) compared to base (ec5bbe9).
Patch coverage: 75.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #554      +/-   ##
==========================================
- Coverage   88.82%   88.82%   -0.01%     
==========================================
  Files          76       76              
  Lines       12341    12344       +3     
==========================================
+ Hits        10962    10964       +2     
- Misses       1379     1380       +1     
Impacted Files Coverage Δ
src/genn/backends/cuda/backend.cc 80.44% <66.66%> (-0.06%) ⬇️
include/genn/backends/cuda/backend.h 97.61% <100.00%> (+0.05%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@tnowotny tnowotny left a comment

Choose a reason for hiding this comment

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

Good work on this. For a moment I thought it might be a good idea to make the simple error handling the default but now I think you have it right as for small models it is not an issue and you would want the more informative output as a default option.

@neworderofjamie
Copy link
Contributor Author

Yeah, the longer term plan is to consider what error information is actually useful and maybe move some of the error handling out of the generated code

@neworderofjamie neworderofjamie merged commit d66fe3c into master Nov 23, 2022
@neworderofjamie neworderofjamie deleted the compiler_friendly_error_handling branch November 23, 2022 12:54
@neworderofjamie neworderofjamie modified the milestones: GeNN 4.9.0, GeNN 4.8.1 Mar 1, 2023
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