Skip to content

Commit fa229d1

Browse files
authored
Re-enable NumPy 2.0 semantics for add, sub, mul. (#4905)
triton-lang/triton#4589 mistakenly deactivated these and reverted to the previous always-cast-to-int32 semantics.
1 parent 664ac51 commit fa229d1

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

python/triton/language/core.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,26 +1909,20 @@ def where(condition, x, y, _builder=None):
19091909
def add(x, y, sanitize_overflow: constexpr = True, _builder=None):
19101910
x = _unwrap_if_constexpr(x)
19111911
y = _unwrap_if_constexpr(y)
1912-
x = semantic.to_tensor(x, _builder)
1913-
y = semantic.to_tensor(y, _builder)
19141912
return semantic.add(x, y, sanitize_overflow, _builder)
19151913

19161914

19171915
@builtin
19181916
def sub(x, y, sanitize_overflow: constexpr = True, _builder=None):
19191917
x = _unwrap_if_constexpr(x)
19201918
y = _unwrap_if_constexpr(y)
1921-
x = semantic.to_tensor(x, _builder)
1922-
y = semantic.to_tensor(y, _builder)
19231919
return semantic.sub(x, y, sanitize_overflow, _builder)
19241920

19251921

19261922
@builtin
19271923
def mul(x, y, sanitize_overflow: constexpr = True, _builder=None):
19281924
x = _unwrap_if_constexpr(x)
19291925
y = _unwrap_if_constexpr(y)
1930-
x = semantic.to_tensor(x, _builder)
1931-
y = semantic.to_tensor(y, _builder)
19321926
return semantic.mul(x, y, sanitize_overflow, _builder)
19331927

19341928

0 commit comments

Comments
 (0)