Skip to content

Commit

Permalink
Turn off fast log (triton-lang#4777)
Browse files Browse the repository at this point in the history
Temporarily turn off log for now to deal with precision problem.
  • Loading branch information
ThomasRaoux authored and bertmaher committed Dec 6, 2024
1 parent e3b1089 commit 6d2b31f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion python/src/ir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,8 @@ void init_triton_ir(py::module &&m) {
})
.def("create_log",
[](TritonOpBuilder &self, Value &val) -> Value {
return approxMath(self.create<math::LogOp>(val));
// TODO: switch to approxMath.
return self.create<math::LogOp>(val);
})
.def("create_log2",
[](TritonOpBuilder &self, Value &val) -> Value {
Expand Down
2 changes: 1 addition & 1 deletion python/test/unit/language/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit 6d2b31f

Please sign in to comment.