jatinchowdhury18 / RTNeural

Real-time neural network inferencing
BSD 3-Clause "New" or "Revised" License
543 stars 57 forks source link

Introduce RealtimeSanitizer (RADSan) real-time safety checking #121

Closed davidtrevelyan closed 7 months ago

davidtrevelyan commented 7 months ago

This PR does the following:

A couple of questions from me:

  1. Is RTNEURAL_REALTIME a good enough name? Happy to change it to something else :)
  2. Would it be a good idea to add RTNEURAL_REALTIME to the real-time methods of the Layer implementations?
codecov-commenter commented 7 months ago

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (04cb333) 95.70% compared to head (c3103c9) 95.70%.

Files Patch % Lines
RTNeural/batchnorm/batchnorm.h 50.00% 2 Missing :warning:
RTNeural/batchnorm/batchnorm2d.h 50.00% 2 Missing :warning:
RTNeural/batchnorm/batchnorm2d_eigen.h 50.00% 2 Missing :warning:
RTNeural/batchnorm/batchnorm2d_xsimd.h 50.00% 2 Missing :warning:
RTNeural/batchnorm/batchnorm_eigen.h 50.00% 2 Missing :warning:
RTNeural/batchnorm/batchnorm_xsimd.h 50.00% 2 Missing :warning:
RTNeural/conv1d_stateless/conv1d_stateless_eigen.h 50.00% 1 Missing :warning:
RTNeural/conv1d_stateless/conv1d_stateless_xsimd.h 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #121 +/- ## ======================================= Coverage 95.70% 95.70% ======================================= Files 58 58 Lines 3891 3891 ======================================= Hits 3724 3724 Misses 167 167 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

davidtrevelyan commented 7 months ago

Nice one, thanks @jatinchowdhury18 - agreed! I've just pushed up some additions of the attribute to the Layer methods that I think are intended to be real-time safe. Would you mind quickly double checking that I've understood them correctly, and haven't added the attribute to any methods that aren't intended to be real-time safe?

jatinchowdhury18 commented 7 months ago

Sure thing! Your additions look good to me. I hadn't really thought much about whether the methods used to set the layer weights were realtime-safe, but it's cool that they are! I guess that could be important if there's a situation where someone wants to "modulate" their layer weights or something like that.

I'm ready to merge this PR if you are!

davidtrevelyan commented 7 months ago

Great! Yeah - super cool that the weights can be modulated - kind of like circuit bending for ML 🙃

Also, it could equally be really useful for controlling any highly interpretable differentiable elements that may live in the network, like a differentiable fader or something. Lots to play with, and I think RTNeural is really well placed in offering that option to creative developers!

I'm happy for this MR to be merged if you are! Thanks for the review 🙏