From e70f42443da3122cbf54bd73dbf68e1adff7c255 Mon Sep 17 00:00:00 2001 From: Thomas Raoux Date: Fri, 20 Sep 2024 18:39:38 -0700 Subject: [PATCH] Turn off fast log Temporarily turn off log for now to deal with precision problem. --- python/src/ir.cc | 3 ++- python/test/unit/language/test_core.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/src/ir.cc b/python/src/ir.cc index abbf7ab41828..2ef6c4410e59 100644 --- a/python/src/ir.cc +++ b/python/src/ir.cc @@ -1469,7 +1469,8 @@ void init_triton_ir(py::module &&m) { }) .def("create_log", [](TritonOpBuilder &self, Value &val) -> Value { - return approxMath(self.create(val)); + // TODO: switch to approxMath. + return self.create(val); }) .def("create_log2", [](TritonOpBuilder &self, Value &val) -> Value { diff --git a/python/test/unit/language/test_core.py b/python/test/unit/language/test_core.py index 5cec71b40175..5b9a0b20bc31 100644 --- a/python/test/unit/language/test_core.py +++ b/python/test/unit/language/test_core.py @@ -4385,7 +4385,7 @@ def kernel(X, Y, BLOCK: tl.constexpr): k = kernel[(1, )](x, y, BLOCK=shape[0]) torch.allclose(getattr(torch, func_str)(x), y, rtol=1e-3) - if func_str in ['log', 'log2'] and is_cuda(): + if func_str in ['log2'] and is_cuda(): assert 'lg2.approx.ftz.f32' in k.asm['ptx'] if func_str in ['exp', 'exp2'] and is_cuda(): assert 'ex2.approx.ftz.f32' in k.asm['ptx']