Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

add tl.math.tanh instead of tl.libdevice.tanh#339

Open
michaelfeil wants to merge 1 commit intoELS-RD:mainfrom
michaelfeil:libdevice-math
Open

add tl.math.tanh instead of tl.libdevice.tanh#339
michaelfeil wants to merge 1 commit intoELS-RD:mainfrom
michaelfeil:libdevice-math

Conversation

@michaelfeil
Copy link

Seems like tanh moved to a

see triton/language/math.py-L1238

@core.extern
def tanh(arg0, _builder=None):
    return core.extern_elementwise(
        "libdevice", libdevice_path(), [arg0], {
            (core.dtype("fp32"), ): ("__nv_tanhf", core.dtype("fp32")),
            (core.dtype("fp64"), ): ("__nv_tanh", core.dtype("fp64")),
        }, is_pure=True, _builder=_builder)

@michaelfeil
Copy link
Author

@pommedeterresautee FYI, unit tests seem to pass. What do you think about this PR?

@michaelfeil
Copy link
Author

@pommedeterresautee friendly reminder!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant