Closed simba611 closed 1 month ago
Hi @simba611, thank you for tackling this issue! I will have a look at the code shortly :)
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.92%. Comparing base (
93c05e5
) to head (5474928
). Report is 11 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Context: JITing Python functions can provide order(s) of magnitude performance boost during execution, by extracting a representation of the computation and turning it into optimized binary code. However, it also makes it more difficult to understand and debug the program when things go wrong, for instance by not having access to the Python debugger or being able to easily reason about the program's execution.
To counter-act this, we can introduce new utility functions for users that help increase the confidence in their programs and detect error states at runtime.
Description of the Change: Adds a debugging function
catalyst.catalyst_assert(bool, str)
that asserts at runtime that the given condition holds, and if not raises the provided error message. Also adds adisable-assertion
pass, which can be conditionally run based on an option to the compiler@qjit(disable_assertions=True)
which is off by default.Benefits: Makes for an easier debugging experience.
Possible Drawbacks:
Related GitHub Issues: Resolves #823