From c873ff53bbfc095efb60a046710e42cfb5fa3268 Mon Sep 17 00:00:00 2001 From: lezcano Date: Mon, 14 Oct 2024 18:35:44 +0100 Subject: [PATCH] Re-enable NumPy 2.0 semantics for add, sub, mul. https://github.com/triton-lang/triton/pull/4589 mistakenly deactivated these and reverted to the previous always-cast-to-int32 semantics. --- python/triton/language/core.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/python/triton/language/core.py b/python/triton/language/core.py index b73a2f08bb6b..b3d76fbf1bf6 100644 --- a/python/triton/language/core.py +++ b/python/triton/language/core.py @@ -1886,8 +1886,6 @@ 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) @@ -1895,8 +1893,6 @@ def add(x, y, sanitize_overflow: constexpr = True, _builder=None): 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) @@ -1904,8 +1900,6 @@ def sub(x, y, sanitize_overflow: constexpr = True, _builder=None): 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)