Skip to content

Commit

Permalink
Re-enable NumPy 2.0 semantics for add, sub, mul. (#4905)
Browse files Browse the repository at this point in the history
triton-lang/triton#4589 mistakenly deactivated
these and reverted to the previous always-cast-to-int32 semantics.
  • Loading branch information
lezcano authored Oct 14, 2024
1 parent 664ac51 commit fa229d1
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions python/triton/language/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1909,26 +1909,20 @@ def where(condition, x, y, _builder=None):
def add(x, y, sanitize_overflow: constexpr = True, _builder=None):
x = _unwrap_if_constexpr(x)
y = _unwrap_if_constexpr(y)
x = semantic.to_tensor(x, _builder)
y = semantic.to_tensor(y, _builder)
return semantic.add(x, y, sanitize_overflow, _builder)


@builtin
def sub(x, y, sanitize_overflow: constexpr = True, _builder=None):
x = _unwrap_if_constexpr(x)
y = _unwrap_if_constexpr(y)
x = semantic.to_tensor(x, _builder)
y = semantic.to_tensor(y, _builder)
return semantic.sub(x, y, sanitize_overflow, _builder)


@builtin
def mul(x, y, sanitize_overflow: constexpr = True, _builder=None):
x = _unwrap_if_constexpr(x)
y = _unwrap_if_constexpr(y)
x = semantic.to_tensor(x, _builder)
y = semantic.to_tensor(y, _builder)
return semantic.mul(x, y, sanitize_overflow, _builder)


Expand Down

0 comments on commit fa229d1

Please sign in to comment.