[Fix] [AMD] activation: Run ReLU2 natively on ROCm (#44198)

Signed-off-by: Aarne Talman <aarne.talman@amd.com>
This commit is contained in:
Aarne Talman
2026-10-20 12:05:14 -07:00
committed by GitHub
parent 82ac83a8d0
commit 29274b41c6
+4
View File
@@ -290,6 +290,10 @@ class ReLU2(BaseFusedOp):
def forward_cuda(self, x: torch.Tensor) -> torch.Tensor:
return relu2(x)
def forward_hip(self, x: torch.Tensor) -> torch.Tensor:
# The JIT relu2 kernel is CUDA-only and not imported on ROCm.
return self.forward_native(x)
class QuickGELU(BaseFusedOp):
def forward_native(self, x: torch.Tensor) -> torch.Tensor: