Skip to content

Don't re-wrap exceptions in exc.TorchOpTracingError #84

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

Merged
merged 1 commit into from
May 29, 2025
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: 6 additions & 0 deletions helion/_compiler/type_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,8 @@ def propagate_unary(self, op: ast.unaryop, origin: Origin) -> TypeInfo:
return SymBoolType.new_unbacked(origin)
try:
return TypeInfo.from_example(_eval_unary(op, self.fake_value), origin)
except exc.Base:
raise
except Exception as e:
raise exc.TorchOpTracingError(e) from e

Expand Down Expand Up @@ -1564,6 +1566,8 @@ def _compare(self, op: ast.cmpop, left: TypeInfo, right: TypeInfo) -> TypeInfo:
_eval_compare(op, left_example, right_example),
self.origin(),
)
except exc.Base:
raise
except Exception as e:
raise exc.TorchOpTracingError(e) from e
if isinstance(left, UnknownType):
Expand Down Expand Up @@ -1733,6 +1737,8 @@ def visit_BinOp(self, node: ast.BinOp) -> TypeInfo:
_eval_binary(node.op, left_example, right_example),
self.origin(),
)
except exc.Base:
raise
except Exception as e:
raise exc.TorchOpTracingError(e) from e

Expand Down
Loading