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

filter_jit now also produces nicer runtime error reporting on the GPU #437

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions equinox/_jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ def __call__(self, /, *args, **kwargs):
if len(e.args) != 1 or not isinstance(e.args[0], str):
raise # No idea if this ever happens. But if it does, just bail.
(msg,) = e.args
prefix = "INTERNAL: Generated function failed: CpuCallback error: EqxRuntimeError: " # noqa: E501
is_eqx_error = msg.startswith(prefix)
if is_eqx_error:
msg = msg.removeprefix(prefix)
if "EqxRuntimeError: " in msg:
_, msg = msg.split("EqxRuntimeError: ", 1)
msg, _ = msg.rsplit("\n\nAt:\n", 1)
msg = msg + _eqx_on_error_msg
e.args = (msg,)
Expand Down
Loading