Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/docker/ci_commit_pins/triton.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9c7bc0a3d41407bff948b40cd0e9c793147e49bc
80ed7f41e4b5d6e71651847e4725f4e7c2999a08
9 changes: 4 additions & 5 deletions torch/_inductor/codegen/triton.py
Original file line number Diff line number Diff line change
Expand Up @@ -1217,11 +1217,10 @@ def tan(x):
@staticmethod
@maybe_upcast_float32()
def tanh(x):
if config.use_fast_math and torch.version.hip:
if get_triton_version() > (3, 4):
return f"libdevice.fast_tanhf({x})"
else:
return f"libdevice.tanh({x})"
if torch.version.hip and get_triton_version() > (3, 2):
# On ROCm, use fast_tanhf depending on Triton version
# Requires ROCm fork of Triton 3.3, 3.4, 3.5 or upstream Triton 3.6+
return f"libdevice.fast_tanhf({x})"
else:
return f"libdevice.tanh({x})"

Expand Down