From fa229d1c4bee16c094be9427334575ec1e79f66c Mon Sep 17 00:00:00 2001 From: Mario Lezcano Casado <3291265+lezcano@users.noreply.github.com> Date: Tue, 15 Oct 2024 00:17:10 +0100 Subject: [PATCH] Re-enable NumPy 2.0 semantics for add, sub, mul. (#4905) 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 06a15f93fd..6d7300a1e2 100644 --- a/python/triton/language/core.py +++ b/python/triton/language/core.py @@ -1909,8 +1909,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) @@ -1918,8 +1916,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) @@ -1927,8 +1923,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)