From d11050ae90109d77b65675c99ef4fbd5eb9b06a5 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 11 Nov 2024 00:37:37 -0800 Subject: [PATCH] Update utils.py --- unsloth/kernels/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/kernels/utils.py b/unsloth/kernels/utils.py index cef6ccb864..de543962ef 100644 --- a/unsloth/kernels/utils.py +++ b/unsloth/kernels/utils.py @@ -31,12 +31,12 @@ pass # tl.math.tanh now is libdevice.tanh from packaging.version import Version import triton +import triton.language as tl if Version(triton.__version__) >= Version("3.0.0"): from triton.language.extra import libdevice triton_tanh = libdevice.tanh triton_cast = tl.cast else: - import triton.language as tl triton_tanh = tl.math.tanh # No casting in old Triton versions @triton.jit