-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-132732: Clear errors in JIT optimizer on error #136048
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
base: main
Are you sure you want to change the base?
gh-132732: Clear errors in JIT optimizer on error #136048
Conversation
Asking just to educate myself: what kind of errors are we expecting inside the JIT and is it safe to always clear them? |
In general, we want to shift as much computation as possible to optimization-time instead of runtime. Some classes of errors, like The other class of errors are ones that are easier to ask forgiveness than permission for. For example, constant-evaluating stuff like |
if (PyErr_Occurred()) { | ||
PyErr_Clear(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be:
if (PyErr_Occurred()) { | |
PyErr_Clear(); | |
} | |
assert(PyErr_Occurred()); | |
PyErr_Clear(); |
...or are there cases where an error hasn't occurred, but we end up here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the current code goes to error on some cases where we run out of memory too, but no memoryerror is set.
Uh oh!
There was an error while loading. Please reload this page.