From 603fcc96f2ed5b934b5d985ae0bf9bb4cf5321c8 Mon Sep 17 00:00:00 2001 From: chenyu Date: Mon, 28 Oct 2024 15:34:19 -0400 Subject: [PATCH] limit UOps.ALU min/max to non-float only (#7336) does this impact anything? some inf is incorrect now --- tinygrad/ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/ops.py b/tinygrad/ops.py index 55a3cf5f1b..dd9bae658b 100644 --- a/tinygrad/ops.py +++ b/tinygrad/ops.py @@ -377,7 +377,7 @@ class UOp(MathTrait, metaclass=UOpMetaClass): if self.op is UOps.SPECIAL: return 0, self.arg[1]-1 if isinstance(self.arg[1], int) else dtypes.max(self.dtype) if self.op is UOps.CONST: return self.arg, self.arg if self.op is UOps.VCONST: return (min(self.arg), max(self.arg)) - if self.op is UOps.ALU: + if self.op is UOps.ALU and not dtypes.is_float(self.dtype): s0,s1,s2 = [cast(UOp, self.src[i] if i < len(self.src) else None) for i in range(3)] if self.arg is BinaryOps.ADD: return s0.vmin+s1.vmin, s0.vmax+s1.vmax if self.arg is BinaryOps.MUL: