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

[frontend] added overflow checks in debug mode #4589

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ptillet
Copy link
Collaborator

@ptillet ptillet commented Aug 27, 2024

No description provided.

@@ -128,6 +128,26 @@ def binary_op_type_checking_impl(lhs: tl.tensor, rhs: tl.tensor, builder: ir.bui
return lhs, rhs


def binary_op_sanitize_overflow_impl(lhs: tl.tensor, rhs: tl.tensor, builder: ir.builder, binary_op: callable):
if lhs.type.scalar.int_bitwidth >= 64 or not builder.options.debug:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a separate option from enabling asserts generally, so it's possible to enable asserts without running overflow checks in every kernel? I'm thinking specifically of inductor which uses asserts to check indirect indexing expressions, but wouldn't want the performance hit of checking every index calculation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants